wunder beta

🎮 How Video Games Work

Look under the hood of the games you play. You'll understand game loops, physics, graphics, and AI and see how code turns input into a living, interactive world.

10
lessons
~60 min
to learn
🔬 Science
subject
Adults
level
Start the course →

What you’ll learn

  1. The Deadline That Designs EverythingUnderstand the frame budget as a hard deadline, and see the three moves every technique in the course makes against it.At 60 fps a game has 16.7 ms to read input, run AI, step physics, cull and draw. It's a deadline, not an average: missing it produces a stutter, which is qualitatively worse than being slow. Every technique in game engineering is one of three moves — don't do the work, do it in advance, or fake it convincingly.
  2. The Game LoopDescribe the input/update/render loop and why games are the category where time passes on its own.Every game is the same loop: process input, update the world, render, repeat. Unlike most software, the world advances whether the player acts or not — which is the source of every hard problem in the course. Input is about transitions rather than state, and real engines buffer events because players tap between frames.
  3. Delta Time, and Why Physics BreaksExplain why variable timesteps break physics, and how a fixed-timestep accumulator with interpolation resolves it.Moving a fixed amount per frame makes a game run faster on faster hardware; delta time fixes speed but not physics, because step size changes the result of an approximation. A fixed-timestep accumulator runs identical steps on every machine — several of them after a hitch, never one huge one — and the leftover fraction interpolates rendering so drawing stays smooth at any frame rate.
  4. Physics: Integration and CollisionExplain integration, the quadratic cost of collision, the broad/narrow phase split, and tunneling.Movement is trivial; noticing contact is quadratic — 1,000 objects is 499,500 pairs per step. Broad phase asks a cheap, sloppy question using bounding boxes and spatial structures, and narrow phase does exact geometry only on the survivors: be wrong quickly, then be right rarely. Tunneling isn't a bug in the collision check — it's a fast object fitting between two discrete steps.
  5. Rendering I: From Triangles to PixelsExplain meshes, why triangles, the GPU's design, and the five-stage pipeline from vertices to pixels.Every 3D object is a hollow shell of triangles, chosen because three points are always flat while four can bend. GPUs trade cleverness for thousands of simple cores doing the same job to millions of items at once. Rasterization converts geometry to pixels, and the per-pixel fragment stage is where most frames are spent — which is why resolution is the most reliable performance dial.
  6. Rendering II: Paying for the FrameExplain draw calls, culling, level of detail and baking as ways of not spending the frame budget.Frames are usually lost to organization rather than detail — above all to draw calls, where the CPU pays a setup cost per request, so a game can crawl while its GPU idles. Frustum and occlusion culling skip what can't be seen, LOD swaps models by distance (visible as popping), and baking precomputes static lighting — which is why static objects long had better shadows than moving ones.
  7. Game AI: Legible, Not IntelligentReframe game AI as legibility engineering, and explain behavior trees, navigation meshes and A*.Game AI aims to be legible, beatable and cheap; an optimal enemy is trivial to write and miserable to play, so most of the work is telegraphing, waiting turns and narrating intent. Behavior trees put priorities in the structure, replacing the quadratic transition tangle of state machines. A* (Hart, Nilsson & Raphael, 1968) searches a prebuilt navigation mesh, keeping optimality by using an estimate that never over-promises.
  8. Netcode: Light Is Too SlowExplain why multiplayer requires prediction, interpolation, reconciliation and lag compensation.Light is too slow for the frame budget: a continental round trip costs tens of milliseconds, so everything on your screen is in the past. Client-side prediction moves your character immediately and reconciliation corrects it against the authoritative server; other players are interpolated between updates. Lag compensation rewinds the world to adjudicate your shot — which is why the person being shot eats the inconsistency.
  9. Inside an Engine: Data Is PerformanceExplain what an engine is, and why memory layout rather than algorithms often decides performance.An engine is everything that isn't your game, and what you're buying is that it fits the budget on five platforms for a decade. Because RAM is far slower than the CPU, which fetches whole cache lines on a bet, scattering object data across memory means fetching mostly-unwanted bytes and waiting. Grouping like data into arrays makes the same maths several times faster — the core insight behind entity-component-system design.
  10. Feel, and the Loop That Never ChangedExplain input latency as the source of 'feel', and see the loop unchanged across sixty years.'Feel' is largely a latency budget: polling, up to a frame of waiting, simulation, a GPU a frame behind, and display processing stack into a delay several times the frame time — which is why 30 vs 60 fps is mostly an argument about lag, not smoothness. Spacewar! (1962), Pong (1972, with no processor at all) and Doom (1993) are all the same loop against the same deadline, differing only in what they chose to fake.

Questions this course answers

Why is a game's 16.7 ms per frame described as a deadline rather than a performance target?

A web page taking 400ms instead of 300 is just slower; those are throughput problems. A frame taking 20ms instead of 16.7 is a hitch the eye catches instantly — which is why average frame rate is a dishonest statistic.

Nearly every technique in game engineering is one of three moves against the clock. Which is NOT one of them?

The refresh rate is the deadline, not a dial the engine turns to get slack. Everything else in this course — culling, LOD, baking, batching, prediction — is one of the other three moves.

What makes games different from most software categories?

In a spreadsheet nothing happens until you act. In a game the loop is running in the pause menu at 3am. Everything hard in this course — timesteps, netcode, latency — comes from time passing on its own.

Why do games track button transitions rather than just 'is the button down?'

It's the bug every beginner ships once. Real engines also buffer events, because players tap between frames — if you only sample at the frame boundary you can miss a press entirely, and the player will swear the controller is broken.

Old PC games sometimes became unplayably fast on newer machines because:

Move 5 units per frame and the game speeds up with the hardware. Delta time fixes it: move speed × elapsed time, so a slow machine takes fewer, larger steps and both arrive at the same place. Some PCs even shipped a 'turbo' button whose real job was to make the computer worse.

Delta time fixes speed, but a variable timestep still breaks physics. Why?

One 100ms step gives a different trajectory than ten 10ms steps. So a crate stack is stable at 60fps and explodes at 20, and two multiplayer machines running the same physics genuinely diverge.

Grounded in trusted sources

  • Jason Gregory, Game Engine Architecture (3rd ed., CRC Press, 2018)
  • Robert Nystrom, Game Programming Patterns (Genever Benning, 2014) — free online at gameprogrammingpatterns.com
  • Glenn Fiedler (Gaffer On Games) — 'Fix Your Timestep!' and the networked physics series
  • Akenine-Möller, Haines & Hoffman, Real-Time Rendering (4th ed., CRC Press, 2018)
  • Christer Ericson, Real-Time Collision Detection (Morgan Kaufmann, 2005)
  • Millington & Funge, Artificial Intelligence for Games (3rd ed., CRC Press, 2019)
  • Hart, Nilsson & Raphael, 'A Formal Basis for the Heuristic Determination of Minimum Cost Paths', IEEE Trans. Systems Science and Cybernetics 4(2), 1968 — the A* paper
  • Valve Developer Community — 'Source Multiplayer Networking'; Yahn Bernier, 'Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization' (GDC 2001)

Every Wunder lesson is built from real, reputable sources — never invented.

Related Science courses

Wunder is a personalized learn-anything platform — tell it any topic and it builds a beautiful, fact-checked course in minutes, with narration, a knowledge check, and a college-style University track.

Browse more Science courses · All topics · Home

© 2026 Wunder Learning LLC · Terms & Privacy