Remix.run Logo
verelo 5 hours ago

You can read the code, but my suggestion on how to do this is to just ingest the save game files. They're super easy to work with, especially now we have the magic of LLMs.

In my case i'm creating various json files that describe game state, players, diplomacy, attendance, etc. Then i just throw that at the LLM and give it the goal of writing a newspaper article about where the game is at. The json files are incremental, so i'm not reading all the past versions on every turn. At the end of the current turn it just appends the current turn data to the json file, and then does the generation. These files are also what power the frontend UI, so it's all super lightweight and fast.

To make the graphs, you need to know state at the end of the current turn as the save files don't retain any history. So i store the most recent save file from each turn in order to achieve this.

It's been a journey of reverse engineering this game, but that's kind of the joy of it all.