Article summary
Mental models are how a developer keeps a large codebase in their head without it melting out of their ears.
On small projects, you can usually follow the code to find what you need. On large-scale projects, that stops working. You need a working model of:
-
the system’s shape (boundaries, responsibilities, dependencies),
-
the system’s flow (data movement, control paths, failure modes),
-
the system’s rules (contracts, constraints, and assumptions; what the code promises, what it forbids, and what it quietly relies on).
If that model is fuzzy, you pay for it everywhere: debugging takes longer, refactors feel risky, and “simple changes” turn into week-long archaeology.
Puzzle games are basically a gym for this skill. The good ones force you to construct a model, test it, find the edge cases, update it, and only then move on. That loop is the same loop you use when you’re trying to understand a gnarly subsystem, reason about concurrency, or design a feature that won’t collapse under its own complexity.
Games
Below are three puzzle games that repeatedly make you build (and rebuild) models without requiring you to memorize APIs, read documentation, or schedule a meeting about it.
The Talos Principle

What the game does mechanically
The Talos Principle builds puzzles out of a small, reusable toolset then combines those tools in increasingly “systems-y” ways. Early on you’re working with basics like jammers (disabling barriers/turrets/etc.), pressure plates, and movable blocks. Later, you add laser-based components like connectors (routing beams) and more exotic tools like fans and recorders.
That toolset matters: because it’s small, you can’t “learn a new gimmick” every time you get stuck. You have to learn the system.
How that builds mental modeling
-
You learn to reason about constraints, not steps
A lot of Talos puzzles aren’t solved by “do A, then B, then C.” They’re solved by figuring out what must be true at the end (gate open, laser routed, tool in position), and then working backward through constraints: line-of-sight, power routing, what can be carried where, what must remain active, etc. Connectors, in particular, push you toward constraint thinking because placement is all about line-of-sight and beam routing limits. -
You develop a feel for “state that persists” vs “state you can temporarily borrow”
Jammers and connectors often have to be moved around while keeping something else true (a barrier disabled, a receiver powered). That’s the same muscle as refactoring while keeping the contract intact: you temporarily “borrow” a component to do work, but you restore the system to the expected behavior before moving on. -
You get trained to look for reusable functionality
Talos rewards noticing that the same tool can serve multiple roles depending on context: a box is weight, a platform, a line-of-sight raiser, a blocker, a carrier. The moment you start seeing tools as primitives instead of “the box thing,” you’re doing the same thing you do when you stop seeing code as “that weird helper” and start seeing it as “a cache,” “a gate,” or “a transaction boundary.”
If you want a puzzle game that feels like building a model of a small physics-and-logic engine, this is it.
The Witness

What the game does mechanically
The Witness is built around line-drawing puzzles on panels, but the real game is rule discovery. Each area teaches (without explaining) a rule or symbol then starts combining rules, stacking exceptions, and mixing puzzle types until you have to internalize the underlying logic.
It also has puzzles where the environment itself is part of the rule set: observation and perspective become inputs.
How that builds mental modeling
-
You practice building models from sparse feedback
The Witness rarely tells you what a symbol means. You infer it from a few examples, form a hypothesis, then test it. That “hypothesis → test → revise” loop is exactly what you do when you inherit a subsystem with no docs and only failing tests. -
You learn to distinguish the interface from the mechanism
The Witness pushes you to ask: “What does this symbol guarantee?” rather than “What do I think it’s doing?” You build a minimal rule, then validate it against new puzzles that expose which inputs matter and which details are noise. In software terms, it’s understanding a module’s contract instead of coupling your thinking to its current implementation. -
You get better at spotting hidden assumptions
The Witness is ruthless about assumptions. You’ll confidently apply a rule… and then the game introduces a constraint that reveals you were relying on an unstated simplification. -
You build an understanding as to how rules interact
Later puzzles are less about any single rule and more about interactions between rules. That’s the same mental move as understanding how caching interacts with authorization, or how retries interact with idempotency, or how “simple” state changes interact with concurrency.
If Talos is “systems tools combined,” The Witness is “rules discovered and composed.” Both are mental modeling from different angles.
Portal Stories: Mel

Portal and Portal 2 are classics for a reason. They teach you to think in spatial transformations, conservation (momentum matters), and multi-step causal chains where an action now affects your future position and options. Portal 2 expands the toolset with additional testing elements: things like lasers/beam redirection, hard-light bridges, excursion funnels, gels, and more.
So where does Portal Stories: Mel fit?
Portal Stories: Mel is a community-made, free total conversion mod for Portal 2, with a full campaign of new chambers and a deliberate emphasis on tougher puzzles. The mod is also explicit about puzzle intent: solvable with clever thinking, not quick reactions.
In practice, it tends to feel like it starts where Portal 2 leaves off: it assumes you already know the language of Portal puzzles and uses that to push you into deeper planning and multi-room reasoning.
How that builds mental modeling
-
You’re forced to plan across “modules,” not just rooms
Many chambers in Mel are structured so you can’t treat a room as a self-contained puzzle. You have to build a larger model: what resources exist, where you can route them, how actions propagate, and how you’ll get yourself (and sometimes objects) from one state to another. Players routinely describe difficulty coming from multi-room layouts and needing to visualize a solution path before it works. -
It trains “toolchain” thinking
Portal puzzles are often about chaining mechanics: place portals to move an object, route a beam, activate something, then use the new state to create a movement path. Portal 2’s mechanics are explicitly framed as tying goal states together through interactions. That’s basically “build a pipeline,” except the pipeline is made of physics. -
It punishes brittle models
When a puzzle is harder, you can’t rely on a vague idea like “I’ll probably fling over there somehow.” You need a precise model: what velocity do I exit with, what surfaces are portalable, what must be active simultaneously, what can be moved where, what state do I need to preserve while I relocate? That precision is the same thing you need when you’re reasoning about edge cases in async flows or distributed interactions.
If Portal teaches the language, Portal Stories: Mel raises the bar on fluency. You no longer simply recognize mechanics, but become able to compose them deliberately.
Best Puzzle Games
Mental modeling on large projects is the difference between moving with confidence and moving by superstition. Puzzle games won’t replace the experience you get from real engineering work, but they can sharpen the tools you use every day.
If you want a clean starting point:
-
Play The Talos Principle to practice constraint-driven systems thinking.
-
Play The Witness to practice rule discovery, hypothesis testing, and composability.
-
Play Portal (1/2) to learn spatial/causal chaining, then Portal Stories: Mel when you want puzzles that demand a stronger, more explicit model.
And if you’re feeling stuck on a codebase right now: treat it like one of these puzzle games. Stop trying random moves. Write down your current model, identify what you’re assuming, and design the next “experiment” to prove or disprove it.
The Witness looks like one I could get something out of – besides fun – I’ll give it a try