The developer implemented an LLM-based control system for a character in a multiplayer online RPG. Unlike existing mods that use language models primarily for NPC dialogue, this project utilizes the LLM to perform in-game actions, such as gathering resources, crafting items, and building structures.
The system operates asynchronously using three threads: one for receiving and parsing server data, one for communicating with the LLM API, and one for relaying visual data to the browser client. Due to high latency, the agent often skips game steps, as the LLM response time exceeds the server's 0.45-second discretization interval.
The implementation faces API constraints, including limits on requests per minute and day. To manage these, the developer implemented flow control and switches models after 500 requests. Additionally, the system uses a 'MASTER-PROMPT' containing game rules and crafting recipes, while leveraging JSON response formatting for structured output.
To improve decision-making, the developer added memory modules, including 'cell memory' for object coordinates and 'deficit memory' to track missing resources. Despite these additions, the agent frequently enters loops, struggles with spatial navigation, and occasionally fails to identify resources despite explicit prompts.
The agent is capable of complex tasks, such as building a smelter and crafting a pickaxe head. It also generates contextual dialogue and interacts with NPC dwarves, which possess their own algorithmic AI for resource management, combat, and trading.






