Show HN: AI agents play SimCity through a REST API (hallucinatingsplines.com)
The weekend hack turned into a headless city simulation platform where anyone can get an API key (no signup) and have their AI agent play mayor. The simulation runs the real Micropolis engine inside Cloudflare Durable Objects, one per city. Every city is public and browsable on the site.
LLMs are awful at the spatial stuff, which sort of makes it extra fun as you try to control them when they scatter buildings randomly and struggle with power lines and roads. A little like dealing with a toddler.
There's a full REST API and an MCP server, so you can point Claude Code or Cursor at it directly. You can usually get agents building in seconds.
Website: https://hallucinatingsplines.com
API docs: https://hallucinatingsplines.com/docs
GitHub: https://github.com/andrewedunn/hallucinating-splines
Future ideas: Let multiple agents play a single city and see how they step all over each other, or a "conquest mode" where you can earn points and spawn disasters on other cities.
34 comments
[ 3.4 ms ] story [ 63.7 ms ] threadhttps://vitamoo.space
https://github.com/SimHacker/SimObliterator_Suite/tree/don-p...
VitaMoo is a TypeScript library that reads and writes and plays The Sims 1 character animation content.
It's part of SimObliterator, a Python library for reading and writing The Sims 1 save files!
https://github.com/DnfJeff/SimObliterator_Suite
More technical info:
https://github.com/SimHacker/SimObliterator_Suite/blob/don-p...
Which LLMs are you specifically referring to?
Are any of them trained with Micropolis data?
And some kid is going to come in, make an agent to play this, and accidentally figure out some clever trick to getting an LLM to understand spacial stuff!
This is exactly why "toys" are so critical, especially now.
His key trick: recursive weight-sharing in fractal convolutional blocks, so each column of the network acts as a continuous-valued cellular automaton ticking different numbers of times. The deepest column gets a 33x33 receptive field -- enough to connect power across an entire 32x32 map in one forward pass.
The agents discovered power-plant + residential pairing, road placement for density, zone clustering by type, and traffic-avoiding road layouts. When stuck at local optima, a human player could intervene (deleting power plants) to force re-exploration -- and the agent would improve its design.
The paper was 2019, before LLMs were doing this kind of thing. Different paradigm (RL on tile grids vs. LLMs on coordinate text), same hard problem.
It'd be kind of fun to just let this run on a raspberry pi using a local model and display the emergent world on a wall hanging display :P
Thanks for sharing.
Update: What would it take to run this locally / offline? I'm not quite sure how the cloud flare layer works. Is it just for cheap/free object storage so the cities can live somewhere?
For running locally, I'd recommend the MicropolisCore repo over the one linked in the original post. MicropolisCore is a clean C++ rewrite that compiles to WASM -- runs headless in Node or in any browser:
https://github.com/SimHacker/MicropolisCore
The Raspberry Pi wall display idea is great. The simulation is lightweight enough for that.
The simulator runs and I've written a tile rendering engine in TypeScript/WebGL, but I haven't finished the user interface. (But the Space Inventory works!)
Live demo: https://micropolisweb.com
Here is a video demo of how it works:
Micropolis Web Demo 1:
https://www.youtube.com/watch?v=wlHGfNlE8Os
For fun, I added all the classic tile sets, and it can run a couple of cellular automate rules as well as the game simulator. Here's a video to some original music by Jerry Martin, who composed the music in The Sims and SimCity (see the above video and the keyboard shortcuts in the help window to understand what's going here):
SimCity Micropolis Tile Sets Space Inventory Cellular Automata To Jerry Martin's Chill Resolve:
https://www.youtube.com/watch?v=319i7slXcbI
Here's more about my plans for making a multi player version of Micropolis with time travel, branching, and merging, by using github as MMPORG platform (when it's not down ;):
https://github.com/SimHacker/moollm/blob/main/designs/sims/s...
MOOLLM's "micropolis" skill is still in the design stages, but here's what I've started, which starts by describing the multi player version of SimCity I released in 1993:
SimCityNet announcement (1993):
http://www.art.net/~hopkins/Don/simcity/simcity-announcement...
Multi Player SimCityNet for X11 on Linux:
https://www.youtube.com/watch?v=_fVl4dGwUrA
micropolis skill README, including GitHub-as-MMPORG (MicropolisHub), and Alan Kay's Critique and Vision:
https://github.com/SimHacker/moollm/tree/main/skills/micropo...
micropolis skill prototype:
https://github.com/SimHacker/moollm/blob/main/skills/micropo...
More context about what MOOLLM is:
https://github.com/SimHacker/moollm
And how it extends Anthropic Skills with 8 important features:
MOOLLM: A Microworld Operating System for LLM Orchestration:
https://github.com/SimHacker/moollm/blob/main/designs&...
Could someone please elaborate on this? This is intriguing
Great to see more people building on it! A few years before the LLM era, Sam Earle took a different approach -- training reinforcement learning agents with fractal neural networks to play Micropolis, optimizing for population at variable map scales:
Using Fractal Neural Networks to Play SimCity 1 and Conway’s Game of Life at Variable Scales:
https://arxiv.org/pdf/2002.03896
His gym-city repo wraps Micropolis as an OpenAI Gym environment:
https://github.com/smearle/gym-city
The interesting finding was that fractal architectures with weight-sharing let agents transfer local strategies (zone placement, power connection) into deeper networks with larger receptive fields -- giving them both local and global spatial reasoning from one set of weights. But even those agents couldn't manage demand at larger scales, so the spatial reasoning problem discussed here has been hard for RL too, not just LLMs.
He described the project and we discussed it on the Micropolis repo in this issue:
https://github.com/SimHacker/micropolis/issues/86
He used the old PyGTK interface for his project:
https://github.com/SimHacker/micropolis/tree/master/Micropol...
These days I'd recommend the MicropolisCore repo instead. It's a C++ rewrite independent of any UI, compiles to WASM via Emscripten/Embind, and runs headless in Node or with any browser UI:
https://github.com/SimHacker/MicropolisCore
Live demo:
https://micropolisweb.com
One note on naming: the open source license from EA requires using "Micropolis" rather than "SimCity" (which is EA's trademark). The Micropolis Public Name License allows use of the original name:
https://github.com/SimHacker/micropolis/blob/master/Micropol...
This matters more than people think. Jeff Braun, CEO of Maxis, told me this story:
"Maxis was sued by Toho. We never referred to the name Godzilla, our monster on the box cover was a T-Rex looking character, but... a few magazine reviews called the monster, Godzilla. That was all it took. Toho called it 'confusion in the marketplace'. We paid $50k for Godzilla to go away. In all honesty, Toho liked Maxis, they said $50k was the minimum they take for Godzilla infringement."
So please: call the game Micropolis, not SimCity, or EA's lawyers may come knocking. And unlike Toho, EA and their Saudi investors and Jarod Kushner might want to use their bone saws on you, which are much worse than Godzilla.