2 min

Notes on simulation

On the texture of believable systems.

Notes on simulation

What does it mean for a system to feel real? Not look real — anything can look real for a moment — but to behave in a way that satisfies the part of you that's been paying attention.

I keep finding that the difference between a thing that feels real and a thing that feels like a demo is mostly a matter of edge cases. Demos are smooth in the middle and jagged at the boundary. Real systems are usually a little jagged everywhere — but the jaggedness is consistent.

What "consistency" means

function tick(state: World, dt: number): World {
  return state.entities.reduce(applyForces, state);
}

Consistency means the same physics applies to every entity, even the one nobody is watching. It means the player's footstep makes the same sound as the shopkeeper's. It means there is no special case for "main character."

This is the kind of thing you can only enforce structurally. You can try to remember to apply it; you will fail. You have to build the system so that unwatched corners are not even a category.

Why this is hard

The simulation should be denser than the perception of it.

That's the constraint. You can't fake density. You can only build a system where density is the cheap path, and then trust that perception will follow.

What does that look like in practice?

  • Same rules for everything (no protagonists)
  • Costs that scale with use (no free actions)
  • State that persists when nobody's looking (no respawn)
  • Failure modes that compose (no "this can't happen" assertions)

The last one is the hardest. Real systems fail in ways that combine: the network is slow and a key is missing and the user double-clicked. If your error handling has special cases for each, you've already lost.

Where I'm going with this

Most of the systems I build are not simulations in any literal sense. They're caching layers, build pipelines, sync engines. But the question is the same: what would make this feel like a place, not a demo?

I don't have an answer that fits in a post. But the question is generative. Every time I look at a system I'm working on and ask "would the behavior I see here also happen if no one were looking?" — the answer points somewhere useful.

More on this soon.