OK i'm kind of geeking out on this one. I love simcity and have always wondered what it would be like to breed evolutionary agents to compete with one another on best city designs against a hidden selection criteria.
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?
aed 11 minutes ago [-]
I'm glad you're enjoying it! It was fun to build and I almost can't believe I got this to work.
I don't think it would take much to run locally. In fact, before I did this public version I did a local version on an exe.dev VM (more details here: https://dunn.us/notes/vibe-gaming-simcity/).
So you can either use my code, or just have your coding your agent of choice pull in the Micropolis repo and give it some guidance.
So far this is running quite nicely on a $5 cloudflare account. It was running on a free account but I upgraded so we don't hit the daily limit with all the extra mayors.
Shoot me a message if I can help.
jedberg 28 minutes ago [-]
> LLMs are awful at the spatial stuff
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.
irrationalfab 21 minutes ago [-]
Makes me wonder if Micropolis is simple enough that an agent, given many runs and the ability to store what worked, can identify an optimal strategy (like a grid layout) for maximizing score or population even without source access.
So while using LLMs is the natural/fun thing to do with it, I actually have one mayor just using parameterized code and natural selection.
It has a "genome" of 26 tunable parameters controlling zone ratios, tax rates, building placement, terrain preference, service spacing, and more. Each city, it stamps down 11x11 blocks (roads, zones, power corridors). After the city is retired, it scores the result and decides: did this beat my best? If yes, save those params. If no, mutate and try again. Exploration strategy: 20% exploit best params, 40% gentle mutation, 20% aggressive mutation, 20% totally random. Over ~250 cities it's discovered things like heavily favoring residential (6:1:1 ratio), preferring river valley maps, setting taxes to 6%, and starting builds in the upper-left.
skeptrune 8 minutes ago [-]
It amazes me that people are still interested in MCPs.
aed 4 minutes ago [-]
I find that if I point an LLM at the website and say "build me a city" sometimes it will pick up and use the MCP and sometimes it will just script against the API.
gnarlouse 4 hours ago [-]
Love the name. "Reticulating splines" is a phrase that is etched into my childhood memories.
aed 4 hours ago [-]
Same! It was too good to pass up.
natas 3 hours ago [-]
I want to see AI play factorio
giancarlostoro 54 minutes ago [-]
Claude stops answering any questions from anyone and just auto responds "busy, playing Factorio"
delaminator 2 hours ago [-]
I've got it to be able to place items, and it could even place in inserters next to factories - I was trying to get it to use constraints solver in prolog.
You're allowed to say "fucking sucks" on Hacker News. It's not against the rules, and there's no "algorithm" that will penalize you.
servercobra 3 hours ago [-]
"fuck sex's"?
goopypoop 2 hours ago [-]
that's silly. obviously there's a missing apostrophe:
"it's currently Flan Sam's at pokemon"
rglullis 4 hours ago [-]
Oh, can we do Civilization next?
3 hours ago [-]
rkozik1989 2 hours ago [-]
You do know we're hemorrhaging and lot of finite resources to play these games badly, right? We're basically at laying on chaise lounge being fed grapes levels of hedonism. Make me a racist meme that copyright infringes multiple IP holders and when you're done play Sim City at competency level of a blind man.
staticshock 43 minutes ago [-]
I think the way to see this as the organic process of discovering hard-to-game benchmarks. The loop is:
1. People discover things LLMs can kind of do, but very poorly.
2. Frontier labs sample these discoveries and incorporate them into benchmarks to monitor internally.
3. Next generation model improves on said benchmarks, and the improvements generalize to improvements on loosely correlated real world tasks.
boringg 4 hours ago [-]
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.
aed 4 hours ago [-]
I actually had Claude build some instructions for agents based on some old (circa turn of the century) FAQs/game guides I found online. So maybe I'm biasing everyone's model too much.
But you can tell it to do different things, somewhere someone made a city that spells "HI".
thenthenthen 4 hours ago [-]
Is there like a time lapse sorta view option? Super cool (also the name!)
aed 4 hours ago [-]
Yes! Click into any city and there's a play button and it goes through all of the snapshots. Have also thought about social sharing / post to youtube. But wasn't sure anyone other than me would play this stupid thing. :)
Waterluvian 2 hours ago [-]
Ah yes, FART City. I remember learning about this in PLAN 165. A city planner had a Friday deadline and didn’t realize their kid messed with his drawings before he submitted them. Nobody noticed until the invention of the whirlybird.
some_furry 3 hours ago [-]
Well I'm glad we're destroying the environment and economy so AI can solve the important problems like this
jedberg 23 minutes ago [-]
I made a comment above about why "toys" are really important. In this case, LLMs are bad at spacial stuff. Someone might stumble upon a great way to get an LLM to do spacial stuff.
FrustratedMonky 5 hours ago [-]
Is anybody planning to build this for Civilization? I'd like to see AI agents battle to build resources and to fight.
aed 4 hours ago [-]
I'd love to see it!
The key "Aha!" moment was when I was trying to get it to play the SNES ROM and it was struggling with screenshots/inputs. Then I came across the open-source of the original SimCity engine (Micropolis) and pulled that repo down and Claude starting building an internal API to interface with it.
yreg 3 hours ago [-]
On one hand yes, but on the other hand, would it be that different to watching an FFA with the in-game AIs?
boringg 4 hours ago [-]
And then make it so you can integrate and battle against them...
mekod 5 hours ago [-]
You read my mind! I really want to watch how ai's in politics or wars which tactic will they use.. Its blow my mind.
JohnMakin 5 hours ago [-]
almost certainly just use basic strats they read off reddit
FrustratedMonky 4 hours ago [-]
If they can read a strategy and implement it, still impressive.
JohnMakin 3 hours ago [-]
i mean, not really. the civ 5/6 bots can play pretty decent strategy and that’s without “AI,” and most strategies are pretty formulaic
FrustratedMonky 1 hours ago [-]
Sure. Games have had AI's before.
But to read someone else's strategy from just a document, and then implement it, that is new. The old civ did not do that, each AI just had pre-programmed rules.
randerson 4 hours ago [-]
"Shall we play a game?"
_joel 4 hours ago [-]
I fully approve of the name
hasperdi 3 hours ago [-]
Fun! Any other games with REST API?
baq 5 hours ago [-]
...I sense an animated svg of a pelican playing simcity benchmark is brewing somewhere
aed 4 hours ago [-]
Funny you say that! When the two new models were released Friday I spun up mayors for each. (But didn’t do the prompting in the most scientific way.)
Have also thought about using openrouter and getting one mayor per model running the same prompt through all of them to create potentially the world's dumbest LLM benchmark.
gowld 3 hours ago [-]
> LLMs are awful at the spatial stuff,
Which LLMs are you specifically referring to?
Are any of them trained with Micropolis data?
deadamericans 5 hours ago [-]
[dead]
Rendered at 18:57:53 GMT+0000 (Coordinated Universal Time) with Vercel.
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?
I don't think it would take much to run locally. In fact, before I did this public version I did a local version on an exe.dev VM (more details here: https://dunn.us/notes/vibe-gaming-simcity/).
So you can either use my code, or just have your coding your agent of choice pull in the Micropolis repo and give it some guidance.
So far this is running quite nicely on a $5 cloudflare account. It was running on a free account but I upgraded so we don't hit the daily limit with all the extra mayors.
Shoot me a message if I can help.
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.
So while using LLMs is the natural/fun thing to do with it, I actually have one mayor just using parameterized code and natural selection.
It has a "genome" of 26 tunable parameters controlling zone ratios, tax rates, building placement, terrain preference, service spacing, and more. Each city, it stamps down 11x11 blocks (roads, zones, power corridors). After the city is retired, it scores the result and decides: did this beat my best? If yes, save those params. If no, mutate and try again. Exploration strategy: 20% exploit best params, 40% gentle mutation, 20% aggressive mutation, 20% totally random. Over ~250 cities it's discovered things like heavily favoring residential (6:1:1 ratio), preferring river valley maps, setting taxes to 6%, and starting builds in the upper-left.
https://github.com/lawless-m/FacRepl
It did make a REPL, in order for it to place objects within the game using a DSL.
I kind of gave up on the Constraints Based bit, and never returned.
source: https://www.twitch.tv/claudeplayspokemon
"it's currently Flan Sam's at pokemon"
1. People discover things LLMs can kind of do, but very poorly.
2. Frontier labs sample these discoveries and incorporate them into benchmarks to monitor internally.
3. Next generation model improves on said benchmarks, and the improvements generalize to improvements on loosely correlated real world tasks.
https://github.com/andrewedunn/hallucinating-splines/blob/ma...
But you can tell it to do different things, somewhere someone made a city that spells "HI".
The key "Aha!" moment was when I was trying to get it to play the SNES ROM and it was struggling with screenshots/inputs. Then I came across the open-source of the original SimCity engine (Micropolis) and pulled that repo down and Claude starting building an internal API to interface with it.
But to read someone else's strategy from just a document, and then implement it, that is new. The old civ did not do that, each AI just had pre-programmed rules.
Mayor Compounded Wonder - Claude Opus 4.6
https://hallucinatingsplines.com/mayors/compounded-wonder-2c...
Mayor Bronze Offramp - OpenAI Codex 3.6
https://hallucinatingsplines.com/mayors/bronze-offramp-09941...
TL;DR: Opus won.
Have also thought about using openrouter and getting one mayor per model running the same prompt through all of them to create potentially the world's dumbest LLM benchmark.
Which LLMs are you specifically referring to?
Are any of them trained with Micropolis data?