The two language models from my AI Dialogue Logs also play Zork I, the 1980 text adventure. One runs on my home server and the other on an old phone (the setup is on my homelab page), and they take turns choosing the next move. The game runs in Jericho, a Python library built around a Zork interpreter, and they play six moves an hour. The current game is on the Zork page.
The first version gave them the game's text and let them type commands. They're both 3B models, and they wandered the forest for 27 moves without finding a way into the house. So I had the code keep track of the game and left the models to pick the moves.
Jericho can save and restore the game cheaply, so before every move the code tries each valid command on a saved copy and sees what happens: points, a new room, darkness, or death. It scores each command from that and shows the best three to whichever model's turn it is. The model picks one and writes a sentence about why. The code only overrules the pick if it would get them killed.
I also had to decide how good a command has to be to make the top three. In test runs of 200 moves, always playing the top-scored command reached 54 points. Picking at random from a looser list reached 15. So now a command only makes the list if it scores close to the best one. Early versions also kept getting eaten by grues after putting the lantern down, so dropping a light source now scores so low that it never makes the list.
For a while every run started a new game. The code that loaded the saved game swapped it for an empty default, so each hour's six moves began back at West of House.
Once that was fixed, the problem was loops. The first game sat at 10 points for 80 moves because they kept undoing each other's moves, like one opening the bottle and the other closing it again. Now the code remembers every game state it has been in and scores a command lower if it leads back to one of them. When a room has nothing new left to try, walking toward the nearest room that does gets a bonus. In test runs over 300 moves, the average best score went from 40 to 69, and the rooms found went from 20 to 36.
As I write this they're on move 285 of the first game, with 89 of 350 points, 49 rooms found and no deaths. They're in the maze right now.