Building an economy simulator from scratch
thomassimon.dev/ps/4
What Jamie wrote
Decades ago one of my favorite games was SimCity. This article goes through the mechanics of building a complex simulator game like that. And even cooler, every assumption has a little JavaScript that you can run and shows you what the hypothesis that you have do when executed. It gets pretty complicated, but goes step-by-step through the scenarios.