Original, and still long term, goal of this project is to create a MUD with locations and characters generated by an LLM, either on it's own as an autonomous builder that steadily extends the MUD, or under direction of players who suggest content to be created.
As a first step on this journey, the project currently is focused around generating simple single player text adventure games. There is a tool that generates adventure game content via interaction with an LLM, and a tool for playing the generated games. Playing a game does not involve the LLM, only generating the game.
The generator creates an outline with locations, characters, items, and quests. However, currently only location support is complete. The player lets you navigate from location to location and interact with the locations. Interactivity is programmed entirely by the LLM. We let it define actions that can be triggered by player input or state changes. When an action is triggered, it can produce output and/or update game state.
git clone https://github.com/eyeree/llmud.git
cd llmud
echo OPENAI_API_KEY=<your-key> > .env
You can choose from a number of test themes or enter a custom theme. You can also choose the size of the generated adventure (a large adventure may not work at this time due to token limits).
You can ignore all the output written to the console during this process. It is for debugging only... Output is written to an ./output/<TIMESTAMP> directory. The output content.json file contains the complete game definition. The other files are for debugging only. If you provide the directory parameter on the command like, the tool will attempt to read a previously generated outline.json file from that directory and use it generate the rest of the game content.
npm run create [<directory>]
After generating an adventure, you can play the adventure using the command:
npm run play <directory>
You must provide the path to the directory containing the content.json file that defines the game content.
(may not be in order)
-
add support for characters, items, and quests.
-
add support for character dialog trees. These can be implemented using the state machine, but it would get complicated. Better to ask the LLM to use an abstraction.
-
simplify data formats - JSON Schema is verbose. I'm surprised that ChatGPT understands the Action semantics as well as it does. But the big problem is with token consumption. ALso, it seels like gpt-4 is way faster when generating simple text output than when generating complex JSON output.
-
build a web interface. Let people generate new content and play through existing content via web site. May have to limit create access due to ChatGPT API costs...
-
switch to using an open source model running locally
-
pivot to usage as a MUD. Add multiple players to the game engine and allow interaction between players. (lots of work)
-
use existing text MUD/adventure game engine?