About Us
When we set terrar.ai up, our goal was to introduce agentic AI into Terraria, a concept that had never been explored before. Along the way, we faced a number of challenges, but also learned a great deal about game dev and AI integration.
What Drove Us
This was largely an uncharted territory for us. Neither had ever modded a game, let alone any experience making games. We wanted to push the boundaries of what's possible in a sandbox game, and Terraria was the perfect avenue for it.
At the same time, prior to this hackathon, we had seen many success stories about AI agent integration in other games, namely Chess, Poker, and Minecraft, which inspired us to do the same for an arguably more complex game, Terraria. And we were very happy to do so. For the past few decades, pre-programmed NPCs have ruled over the game dev scene. We're firm believers that AI game agents will cause a big shift in an otherwise constant landscape. When that happens, we'll be overjoyed to see terrar.ai as the first step into that giant leap.
What We Learned
We quickly learned that building real-time, context-aware agents require only the FASTEST inference, and no large amount of latency will do if we aim for a smooth AI experience. Further, without a background in video games nor C#, we were very glad to leverage the SDKs available to us: first, tModLoader, which enabled us to "speak" to Terraria, and second, xAI for inference. Learning the ropes became easy once we learned to reference the documentation closely. We also learned that taking breaks is both efficient and healthy. Coming back to a hard problem with a fresh set of eyes is what allowed us to stay on our A game. :)
How We Built It
- tModLoader: We used tModLoader, an open-source framework that allows for modding Terraria using C#. This provided the foundation for integrating custom game agents.
- AI Backend - Grok by xAI: We chose Grok for its low-latency, high-speed inference, ensuring our agents could make decisions quickly and maintain a smooth gameplay experience.
- ReAct Framework: The agents were built using the ReAct framework, which allows them to reason, act, observe, and replan. This made our agents adaptive and able to respond intelligently to player actions and game dynamics.
Challenges We Faced
- No Native LangChain Support for C#: There was no dedicated Agents SDK for C# in the context of Terraria modding, so we had to create our own solution from scratch, which was admittedly very hacky.
- Unfamiliar Terrain: One of us had never even played Terraria, which made understanding the game mechanics and how to best integrate the agents a significant challenge.
- LLM Inconsistency & Latency Issues: We faced problems with inconsistent outputs from large language models (LLMs) and high latency, especially during intense gameplay moments like boss fights. Ensuring that agents made decisions quickly enough without disrupting the flow of the game was a constant balancing act.
Conclusion
Despite these obstacles, we succeeded in creating the first dynamic AI agents for Terraria, bringing new strategic depth to the game. Terrar.ai gives players the ability to deploy AI companions who adapt to the situation, making every decision a calculated risk. Every summon, every move, and every agent deployed has a direct impact on gameplay transforming Terraria into a cooperative, AI-enhanced experience.
Built With
- c#
- grok


Log in or sign up for Devpost to join the conversation.