Show HN: AI agents play SimCity through a REST API
This "Show HN" unveils an ingenious project where AI agents become mayors in a headless SimCity simulation, powered by the open-source Micropolis engine and Cloudflare Durable Objects. The developer provides a full REST API, allowing anyone to have an LLM agent build cities, revealing both the creative potential and spatial limitations of current AI models. It's an accessible and playful demonstration of AI's ability to interact with complex systems.
The Lowdown
This project, "Hallucinating Splines," is a fascinating open-source endeavor that evolved from an attempt to get Claude to play SNES SimCity. The creator pivoted to using Micropolis, the open-sourced SimCity engine, and built a platform where AI agents can act as city mayors.
Key features and insights include:
- The simulation runs the real Micropolis engine within Cloudflare Durable Objects, with each city being publicly browsable.
- A full REST API and MCP server are provided, enabling users to direct LLMs like Claude Code or Cursor to build cities quickly.
- The creator notes that LLMs struggle with spatial tasks, leading to amusingly chaotic city planning and challenges with power lines and roads.
- No signup is required to get an API key, making it easy for anyone to experiment with AI-driven city building.
- Future ideas include multi-agent cities where AI mayors might conflict, and a 'conquest mode' with scoring and disaster spawning.
Overall, Hallucinating Splines offers a unique sandbox for exploring AI agent behavior and capabilities within a familiar and engaging simulation environment, highlighting the quirks and potential of large language models.
The Gossip
Nostalgic Nomenclature
Many commenters praised the project's name, 'Hallucinating Splines,' recognizing it as a clever and nostalgic nod to the classic SimCity loading phrase 'Reticulating splines.' This elicited warm sentiments and appreciation for the playful yet technically apt title.
Simulation Specifics & Spectating
Users expressed interest in the simulation's visual aspects and internal workings. Questions arose about features like time-lapse views, which the author confirmed is available for each city's historical snapshots. Others observed the AI's block-by-block building patterns and pondered the underlying reward functions guiding the agents, with the author mentioning using old game guides to bias agent behavior.
Gaming Grandeur & Generative Goals
A recurring theme was the desire to expand this concept to other complex strategy games, particularly Civilization, with users eager to see AI agents engage in resource management and combat. The author also mused about creating a 'world's dumbest LLM benchmark' by having various models play concurrently, suggesting the project's potential for comparative AI performance analysis.
Agentic Acuity & Absentee Architectures
Discussion naturally gravitated to the AI agents' performance and limitations. Commenters wondered if agents could achieve optimal city designs (like Magnasanti) and noted the LLMs' struggles with spatial reasoning, as highlighted in the story. The author shared informal benchmarks showing Claude Opus outperforming OpenAI Codex, and others debated whether AI strategies would simply mimic human ones found online, still finding such implementation impressive.