Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 16, 2026. Learn more…

Leanpub Header

Skip to main content

Masters of the Metropolis

A Simulation-First Introduction to Programming, Systems, and Thinking in Code

Build a city. Not a toy project — a living system.

In Masters of the Metropolis, you don’t learn programming by memorising syntax. You learn by constructing a simulation that evolves over time.

Every chapter adds something real: time, citizens, economy, infrastructure, events.

By the end, you’ve built more than code. You’ve built a system that behaves.

Minimum price

$25.00

$29.00

You pay

Author earns

$
PDF
About

About

About the Book

Masters of the Metropolis is a simulation-first introduction to programming, systems thinking, and how real software is built.

Instead of teaching Python through isolated exercises, this book takes a different approach: you build a living system from the ground up.

A city.

Starting from a blank file, you will construct a fully working simulation that grows chapter by chapter. Buildings appear. Citizens move in. Time advances. Economies form. Infrastructure fails. Decisions create consequences that echo across the system.

By the end, you won’t just have learned syntax. You will have built:

  • A real-time simulation running in your terminal
  • Citizens with behaviours, relationships, and life arcs
  • A dynamic economy with feedback loops and failure states
  • An event-driven system with emergent outcomes
  • A full dashboard interface with live updates
  • Save/load systems, analytics, and testing infrastructure

But the real goal is deeper than the features.

This book teaches you how to think in code.

You will learn how to:

  • Grow a system without losing control of its structure
  • Design around state, rules, and events
  • Debug behaviour, not just errors
  • Make code that survives change
  • Understand why some designs scale and others collapse

Each concept is introduced only when the simulation demands it. Nothing is abstract. Every idea earns its place.

This is not a reference manual.
It’s a guided build of something real.

If you’ve learned the basics of Python but don’t know what to build next, this is that next step.

Author

About the Author

Rob Lear

I work at the intersection of code, systems, and explanation.

I’ve spent a lot of time thinking about how complex things behave when you let them run: cities, software, processes, habits. That usually pulls me toward simulation-style thinking — breaking big systems into small moving parts, then watching what happens when they interact over time.

Most of my work lives somewhere between engineering and teaching. I care less about abstract correctness and more about whether something actually runs in your head after you read it. If it doesn’t become usable, it doesn’t count as understood.

I tend to build things iteratively. Rough first passes, then refinement, then pressure-testing ideas until they either collapse or become simple enough to explain cleanly. I prefer working code and clear mental models over polished theory.

Outside of tech, my faith in Christ is a quiet but steady part of how I think about purpose, responsibility, and truth. I don’t treat it as decoration or branding — it’s just part of the foundation that shapes how I try to live and create.

I’m also interested in how people actually learn, not how we assume they learn. That usually means stripping ideas down to their working parts, removing unnecessary ceremony, and rebuilding them in a way that feels more direct and less intimidating.

If there’s a common thread, it’s this: I like building systems that make other systems easier to understand.

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub