logoalt Hacker News

Show HN: AI agents play SimCity through a REST API

47 pointsby aedlast Monday at 3:54 PM14 commentsview on HN

This is a weekend project that spiraled out of control. I was originally trying to get Claude to play a ROM of the SNES SimCity. I struggled with it and that led me to Micropolis (the open-sourced SimCity engine) and was able to get it to work by bolting on an API.

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.


Comments

boringgtoday at 2:43 PM

Fun idea! It really seems to go for the block by block design. I see some other ones that are a bit more divergent but not successful. I wonder what its internal reward function is striving for.

show 1 reply
thenthenthentoday at 2:40 PM

Is there like a time lapse sorta view option? Super cool (also the name!)

show 1 reply
_joeltoday at 2:39 PM

I fully approve of the name

gnarlousetoday at 2:28 PM

Love the name. "Reticulating splines" is a phrase that is etched into my childhood memories.

show 1 reply
FrustratedMonkytoday at 1:28 PM

Is anybody planning to build this for Civilization? I'd like to see AI agents battle to build resources and to fight.

show 3 replies
baqtoday at 1:40 PM

...I sense an animated svg of a pelican playing simcity benchmark is brewing somewhere

show 1 reply
deadamericanstoday at 1:40 PM

[dead]