Thanks for the link! That's the older C/TCL/Tk code from the original micropolis repo and OLPC release. Here's the latest version of the code, translated to C++ with better names and comments, in the newer MicropolisCore repo:
https://github.com/SimHacker/MicropolisCore/blob/main/packag...
Chaim Gingold wrote a book all about "Building SimCity":
https://mitpress.mit.edu/9780262547482/building-simcity/
He answered questions about it in this HN discussion:
https://news.ycombinator.com/item?id=40698442
For more detail than the article gives, Chaim Gingold drew the whole loop for his book "Building SimCity: How to Put the World in a Machine" (MIT Press, 2024), and kindly let us put his diagrams in the MicropolisCore repo.
Chaim Gingold's "SimCity Reverse Diagrams":
https://github.com/SimHacker/MicropolisCore/tree/main/images...
Simulation Loop (Simulate):
https://github.com/SimHacker/MicropolisCore/blob/main/images...
Map Data Flow:
https://github.com/SimHacker/MicropolisCore/blob/main/images...
Maps:
https://github.com/SimHacker/MicropolisCore/blob/main/images...
Map Scan:
https://github.com/SimHacker/MicropolisCore/blob/main/images...
Make Traffic:
https://github.com/SimHacker/MicropolisCore/blob/main/images...
Animation Characters:
https://github.com/SimHacker/MicropolisCore/blob/main/images...
From the micropolis repo README:
NOTE: Please See: MicropolisCore
https://github.com/SimHacker/MicropolisCore
This "micropolis" repo is mainly for historical purpose, and it's probably better to use the newer MicropolisCore repo for development.
I rebooted micropolis into the fresh new MicropolisCore repo, without all the old X11/TCL/Tk stuff.
MicropolisCore is a C++ rewrite/refactor/cleanup of the original C code into a simulation engine that's independent of the user interface.
The full lineage of the code is C64 => Mac => SunOS/NeWS/HyperLook => Unix/X11/TCL/Tk + multiplayer => Linux/X11/TCL/Tk + multiplayer => OLPC/X11/TCL/Tk (single player) => C++ MicropolisCore => C++/SWIG/Python/PyGTK => C++/SWIG/Python/TurboGears/AMF/Flash/OpenLaszlo => C++/Emscripten/Embind/TypeScript/SvelteKit.
Now it compiles with emscripten/embind into WASM, and it's possible to run it "headless" in node, or with any kind of user interface in the browser.
So if you're making something new, you should use MicropolisCore, but if you're into retrocomputing and want to renovate the TCL version, or even the old PyGTK or Python/TurboGears/AMF/Flash/OpenLaszlo version, then this repo's got what you need!
----
Work in progress live demo (I have't finished the UI yet, but the simulator and tile engine run):
Video demo:
https://www.youtube.com/watch?v=wlHGfNlE8Os
SimCity Micropolis Tile Sets Space Inventory Cellular Automata To Jerry Martin's Chill Resolve: