Reverse Engineering SimTower (phulin.me)
205 points by patrickhulin 3 days ago
This is the story of building https://towers.world, a ~perfect, tick-for-tick reproduction of 1993 game SimTower.
I spent weeks reverse-engineering the original EXE and writing up a detailed spec of how the simulation actually works under the hood — population flow, elevator AI, the whole star-rating system. The specs are all on GitHub if you want to read them: https://github.com/phulin/tower-together/tree/main/specs
It's also collaborative. Multiple players can connect to the same tower, the simulation keeps running as long as anyone's connected, and build actions sync across clients in real time.
Because I rebuilt the UI, I could add features like shift-click to build grids of rooms - instead of painstakingly clicking to build rows of offices and hotels, shift-click allows a 10-floor grid to be built all at once.
The game runs on Cloudflare Durable Objects, one of my favorite web primitives.
Everything is open source: https://github.com/phulin/tower-together
johnfn 9 hours ago
First of all, super cool. I have a soft spot for SimTower as well. :)
> I didn’t want to do a function-by-function port. First, APIs may be copyrightable - and copying a binary that closely might implicate copyright more than an approach closer to clean-room design. But it was clear that I needed some level of feedback from the ground-truth binary in order to provide a hill for the LLM to climb on the reimplementation.
Interesting, but isn't this what, say, the Ocarina of Time reverse engineer port does[1]? I imagine the fact that this hasn't been served a takedown notice from Nintendo is a proof that it's defensible? Or at least that there's precedent, ha.
Anyway, this is really cool. I genuinely think the only thing that's missing for me to waste an afternoon here is the sound effects!
charcircuit 2 hours ago
It is not proof. It is a clear derived work infringing on the copyright of Nintendo.
realusername an hour ago
Depends of the country, a lot of countries have exceptions for interoperability (at least the whole EU) and since these projects are mainly used to make ports to other systems, it may be covered.
neals 23 minutes ago
Played it for a few cycles. I feel like the elevators are a bit bugged, they keep idle in the lobby why people are waiting to get on (and turning red)
dsl 4 hours ago
It is missing the most important function.
If the first tile you build is a lobby in the bottom left corner, it is supposed to double your starting money. :)
ashdnazg 3 hours ago
The real question is how many other things it's missing.
Reading the process in TFA, it's very much dependent on the comprehensiveness of the testing framework. And apparently, the tests never built a lobby in the bottom left corner...
Anything else it didn't try, is probably also not documented and not implemented.
With the growing use of AI in reverse engineering, we might need to shift our goals to more strongly verifiable ones, such as matching decompilation.
disillusioned 2 hours ago
Literally the first thing I tried. :-/
jlev1 13 hours ago
Wow!
There was a little-known sequel to SimTower called Yoot Tower (named after Yoot Saito). It was a commercial flop, but I played it in the 2000s and again in the 2010s and very much enjoyed it! It had a lot of added customizability (more choices of restaurants and shops, for one thing). I would love to see that game recreated.
zamadatix 11 hours ago
Project Highrise is also worth checking out. It's a 2016 re-imagination of the same type of game. I'm not sure I enjoyed it as much as I did Yoot Tower... but I'm also not sure if that's just because Yoot Tower was a few decades younger back when I played :).
pixelcort 12 hours ago
One of the maps in Yoot Tower is Kegon Falls. When I moved to Japan I found out it was a real place. Just took another day trip up there last month. Of course IRL it’s just an elevator but the view each season is amazing.
thispbowden 13 hours ago
Love Yoot Tower! Can we clone it next?
patrickhulin 13 hours ago
yes! I've been thinking about how to do it, but it will take some work!
swyx 7 hours ago
> This project used an absolutely ridiculous number of tokens. I had to upgrade to the Claude Code $200/month plan and carefully avoid usage in the 8 AM-2 PM 2x peak window.
that doesnt sound too terrible to be honest. TIL that 8am-2pm is 2x usage.
dwedge 4 hours ago
I want someone to do this with SimCopter. I loved that game but I don't think it was very popular
sysworld an hour ago
SimCopter was the best game!! You could even fly around your own simcity build!
qingcharles 7 hours ago
Can you talk about how you actually disassembled the EXE and reverse-engineered it?
MrPowerGamerBR 9 hours ago
Just a fyi for anyone that doesn't know: A few years back Don Hopkins got the permission from Yoot Saito to open source Yoot Tower, SimTower's sequel: https://github.com/YootTowerManagement/YootTower
...however I don't think that the source was ever published anywhere, considering that the repository still doesn't have the source code yet. ("Please check out the YootTower repo, where I'll publish the source code once it's cleaned up, reviewed and approved by Yoot, and relicensed with the MIT licensed.")
DonHopkins 3 hours ago
I spoke with Yoot about it recently. There are some issues with Nintendo and licensing that may take some time to work through. My fingers are crossed, but it might take a while and require patience. We all want it to happen though!
Meanwhile I'm working on Micropolis (based on the original SimCity Classic code, cleaned up, and compiled with Emscripten into WASM), and also reimplementing The Sims character animation system and content management and creation system in TypeScript with WebGPU and MOOLLM. ;)
Micropolis WASM + WebGL tile renderer demo:
MicropolisCore repo:
https://github.com/SimHacker/MicropolisCore
Micropolis design docs:
https://github.com/SimHacker/MicropolisCore/tree/main/design...
Sims character animation demo with WebGPU renderer:
Source code:
https://github.com/DnfJeff/SimObliterator_Suite/tree/main/vi...
Design docs:
https://github.com/DnfJeff/SimObliterator_Suite/tree/main/vi...
Designs for creating LLM driven Sims content editing and creation tools, uplifting and simulating The Sims in MOOLLM, and downloading The Sims content back into the original game:
https://github.com/SimHacker/moollm/tree/main/designs/sim-ob...
>"What would your Sims say if they could finally talk to you?"
>Two-way bridge between The Sims 1 save files and MOOLLM. Characters, objects, and pets step between a 26-year-old game VM and an LLM-powered universe, retaining and synchronizing their parallel existences.
>The One-Line Version
>Drag a 25-year-old Sims save file in. Watch the character wake up. Have a conversation with them. Send them home changed.
The Uplift: Sims ↔ MOOLLM Character Bridge
https://github.com/SimHacker/moollm/blob/main/designs/sim-ob...
It's all still a work in progress that I hack on when I have spare time (and spare money for tokens), so no ship date known! ;)
DonHopkins 3 hours ago
Also, Fabian Wesner's posted about using Claud Code to analyze the original micropolis repo's code and documentation to generate a new version.
Here is a deep dive "podcast" he generated (presenting Claud's analysis in a conversational format) that describes the work. I listened to it, and it got the important trademark and licensing issues right, was quite comprehensive and technically accurate, up until the end where they said maybe there's something to learn about city planning from SimCity! ;)
https://drive.google.com/file/d/1SGAkLIb4CQMPKU7TJ2sRdEjc0Dh...
It pretty much parallels the analysis docs in his repo, which are also quite accurate:
https://github.com/FabianWesner/micropolis/tree/master/docs
This lightning talk I gave at HAR 2009 goes into what you can actually learn from playing SimCity/Micropolis (and reading and extending the code), thanks to Seymour Papert's and Alan Kay's philosophy of Constructionist Education, and it's much wider and more generally useful than just city planning:
https://donhopkins.medium.com/har-2009-lightning-talk-transc...
To save you the indignity of LinkedIn scraping your browser extensions, here is a copy of Fabian Wesner's post and my response with the link spying urls resolved:
https://www.linkedin.com/posts/fabian-wesner_micropolis-simc...
Fabian Wesner | CTO | Passionate about AI and Entrepreneurship | 1 month ago
Claude Code is extremely good at documenting legacy software. That's a huge blessing, especially when the original developers are no longer around or are finally ready to retire.
If you haven't tried this, you might be missing out. So I did it for you.
#Micropolis is the open-source release of the original #SimCity, published by Electronic Arts in 1989. EA released the source code under GPLv3 in 2008 for the One Laptop Per Child project. The codebase is decades old, and there's likely no one left who knows it inside out.
SimCity was one of the very first games I played, back in 1990 on my father's 286. Just a few months after the Wall fell. So this one is personal.
I let Claude Code read the entire codebase and write a full documentation. As far as I can see, it looks correct and complete. I'm no expert on this particular codebase, but that's exactly the point: there might be no expert left on earth. I have tried this on other software where I am an expert, and the results are surprisingly accurate.
You can find the resulting docs and the prompt here: https://github.com/FabianWesner/micropolis/tree/master/docs
I also converted the docs into a podcast episode for easier consumption:
https://drive.google.com/file/d/1SGAkLIb4CQMPKU7TJ2sRdEjc0Dh...
Enjoy!
I know I’m not the first to use Claude Code on this treasure and - of course - I already rebuilt the game with JavaScript.
More on this tomorrow!
Don Hopkins | Full Stack Generalist AI Engineer
Although I may have two feet firmly planted in mid-air, I am still on Earth and know the code. I reviewed it and am I'm impressed with this documentation, which even caught my experimental Eliza chatbot easter egg in the PyGTK version! Importantly it correctly covered all the licensing and trademark issue, and mentioned that active development has moved on to the cleaned up and renovated MicropolisCore repo.
https://github.com/SimHacker/MicropolisCore
Here are the latest design docs:
https://github.com/SimHacker/MicropolisCore/tree/main/design...
The documentation you generated does a good job at mapping out and comparing the several different versions of the code. Albert Hofkamp and I cleaned up and refactored the code into C++ MicropolisCore (which I integrated with Python with SWIG, and later WebAssembly with emscripten/embind), and we wrote Doxygen comments and documentation in the code.
Chaim Gingold deeply studied multiple versions of the SimCity source code for his PhD thesis in Play Design, and interviewed many people involved, then wrote the definitive magnum opus "Building SimCity". Chaim is the one person on Earth who understands SimCity better than Will Wright!
https://direct.mit.edu/books/monograph/5791/Building-SimCity...
>Building SimCity: How to Put the World in a Machine
>A deep dive into the trailblazing simulation game SimCity, situating it in the history of games, simulation, and computing. Building SimCity explores the ...
Good grief you can't hide easter eggs any more!
"Additionally, the web version includes: PacBot -- an AI robot that follows roads toward heavy traffic and "eats" cars, reducing traffic density. This was an early experiment in programmable game avatars."
PacBot appears one minute into this video:
https://youtu.be/8snnqQSI0GE?t=56
>Micropolis Online (SimCity) Web Demo. A demo of the open source Micropolis Online game (based on the original SimCity Classic source code from Maxis), running on a web...
DonHopkins 2 hours ago
At 3:35 I love how the speech synthesizer mispronounces "CherryPy" as "Cherry Pee".
https://drive.google.com/file/d/1SGAkLIb4CQMPKU7TJ2sRdEjc0Dh...
grogenaut 7 hours ago
I played when I was a kid. I figured out you could just build condos like crazy and make money pause build more, and repeat, get tons of money, build all the way up. But I couldn't figure out how to get people to the top level for that achievement.
I'm gonna Google that and see what I got wrong
manwe150 6 hours ago
I see to recall it being an express elevator to floor 90 (multiple of 15), then a short regular elevator for the rest of the way to the cathedral. I beat the game several times, usually with the 100% lowest-cost office build.
LostMyLogin 6 hours ago
> First, the AI makes premature conclusions about subsystems, records them, and then struggles to figure out when to abandon its earlier guesses.
This perfectly describes what feels off to me about Opus 4.7 (unsure if that’s what you are using). It seems to go down an incorrect path, I correct it, but it still references things from it. Trying to direct it back becomes a mess.
Has anyone experience this as well or am I going crazy? Doesn’t happen with 4.6 for me.
appplication 6 hours ago
I’ve had not great experiences with Opus 4.7. It seems the model is overall less effective at reliably delivering via my standard way of interacting, and it also forgets things it was asked several times, even just minutes after being reminded again (e.g. “don’t in-line imports”).
I’m probably holding it wrong, but I think a given a sufficiently advanced AI it would essentially be impossible to use it incorrectly. Feels like a step backwards in this regard.
Dwedit 9 hours ago
I remember that SimTower (Windows 3.1 version) would briefly draw the dialog boxes in Japanese, then immediately redraw it in English. This was on a computer without any Japanese fonts.
ChickeNES 6 hours ago
Heh, I have four different games I am currently experimenting with, luckily I skipped this one as I am still expecting the original/Yoot source will be published (hopefully DonHopkins sees this and it nudges him to get it uploaded!).
DonHopkins 2 hours ago
I posted an update in response to this message:
efromvt 11 hours ago
Can you still build a garage in the bottom corner to get more starting money??
taejavu 15 hours ago
Very cool! I used to play this game for a few minutes every morning at a friends place before school. With the clone being open source, would you be open to QoL patches? I don’t have anything specific in mind, just curious how close to the original you want to stay.
patrickhulin 13 hours ago
Patches are welcome, especially for UI stuff - the simulation I'd like to keep matching exactly. I have one deviation already: the floors are 0-indexed and lobbies are on 15, 30, ..., which would be 16, 31, ... in the original game.
cortesoft 9 hours ago
I love SimTower, and one of the reasons I keep my SheepShaver environment working is so I can still play it on Mac OS 9.
I’ll have to check this out!
ad_hockey 4 hours ago
FYI you can also play it in the browser, although it's the DOS version: https://playclassic.games/games/simulation-dos-games-online/...
rho4 3 hours ago
You can only serve the 3 closest levels to a lobby with stairs or escalators.
EdwardDiego 8 hours ago
I sunk ages into "the world's most brutal elevator simulator" - how does the game model elevator demand? I always wondered if it was some sort of Poisson distribution.
ryeguy_24 14 hours ago
Oh my gosh, this really brought me back. Haven't played that game in 30 years. What a great use of AI. Thanks for the trip down memory lane.
findalex 14 hours ago
I loved this game so much. Can't wait to see Santa.
DonHopkins an hour ago
It would be great for the movie theater to be able to play any video synchronized across multiple players so you can watch it together, like the awesome movie theater in Cursor Camp. Then we could all watch the extremely weird original SimTower movies together, in their 8-bit error diffusion dithered glory:
https://www.youtube.com/watch?v=qq8o7gg87k4
Condom Duck:
https://youtu.be/qq8o7gg87k4?t=211
Psycho Party:
https://youtu.be/qq8o7gg87k4?t=381
Cursor Camp (recent hn discussion and neil.fun link):
https://news.ycombinator.com/item?id=47949939
Also, LGR did these great reviews of SimTower and Yoot Tower, which he truly loves, so he disclaims that they are not exactly non-biased:
LGR - SimTower - PC Game Review (15 years ago):
https://www.youtube.com/watch?v=_4ToEDrhxo0
LGR - Yoot Tower: The Sequel to SimTower (5 years ago):
ok_dad 5 hours ago
I love you this was the best sim game when I was a kid and now I’ll spend my weekend on your site!
schnebbau 14 hours ago
Amazing, loved this game when I was younger. I would keep restarting every time I thought of a more effective layout.
I don't think I ever made it to the cathedral though.
SuperNinKenDo 11 hours ago
God I loved this game back in the day. Thank you!
EDIT: Nevermind... [sigh]
I_am_uncreative 11 hours ago
What's with the edit?
cozzyd 10 hours ago
Judging from user's posting history, they're not the biggest fans of llms
This is kind of the perfect use case though -- it's a game who cares if it's right or not.