openskills.info
Course Preview

Game Physics and Collision

Game physics and collision is the code that moves objects under forces such as gravity and decides when two objects touch. A physics engine steps time forward in fixed slices, finds overlapping shapes, and pushes bodies apart so a character stands on a floor instead of falling through it. Game engines such as Godot, Unity, and Unreal Engine ship this layer, or you add a library such as Box2D or Jolt.

itSoftware engineering

Recommended first:game-mathematics

Don't Panic: Game Physics and Collision

Game physics is the code that moves things in a game according to forces, and collision is the code that notices when two of them touch. A crate falls, hits a floor, tips over, and slides, and nobody animated any of it: the engine computed it.

The whole thing is a loop that repeats many times per second. Advance time by a fixed slice, find which shapes overlap, and push bodies apart so the character stands on the floor instead of falling through it. Everything else in this course is a detail of one of those three verbs.

The first idea to keep is the fixed timestep. Screens draw frames at whatever pace the machine manages, but physics wants equal slices, usually one sixtieth of a second. A leftover-time counter called the accumulator hands out slices, and the renderer blends between the last two results. Feed physics raw frame time instead and the same scene behaves differently at different frame rates, and stacks of boxes can shake or explode.

The second idea is that shapes are cheap stand-ins. The engine does not test your detailed character model against the level. It tests a capsule or a box, in two passes: a broad phase that finds pairs that might touch, and a narrow phase that checks those few pairs exactly. Bodies come in three kinds: static (never moves), kinematic (moved by your code), and dynamic (moved by forces).

The third idea is that time comes in steps, which is where the classic bug lives. Picture a bullet flying at a paper-thin wall. One step ends with the bullet short of the wall, and the next ends with it beyond, so the engine never sees them touch. The bullet simply arrives on the other side. This is tunneling. Continuous collision detection sweeps the motion to catch it, but it costs more, so engines offer it per body. A shorter timestep also helps.

The surprise is that physics is not automatically repeatable. Two runs with identical inputs can differ. Godot's manual says outright that its physics is not deterministic. Jolt can reproduce a run, but only if the calls arrive in the same order and the very same binary executes them.

If a reader keeps one habit, make it this: filter early. Layers and masks decide which pairs may interact before any geometry is tested. A trigger (called a sensor or an Area in some engines) reports overlap without pushing anything, which suits pickup zones.

Where to go next depends on the question. The Cheatsheet holds the formulas and the engine vocabulary side by side. The Practice tab has worked numbers for the accumulator, the overlap tests, and the impulse formula. Field Notes covers where teams get stuck, such as tall stacks and enabling continuous detection everywhere. The Landscape tab lists the engines and libraries, from Box2D to Jolt, so you can see who ships what.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources