Skip to content

55 visual cheat sheets · AI-ready

Game Development Cheat Sheet

Game development and physics concepts, each with an interactive Three.js visual, formulas, code and a prompt you can paste into your AI assistant. Every page is also available as Markdown for LLMs.

Three.js & Rendering

How a 3D scene becomes pixels: rays, normals, culling, shaders and the standard ways to draw less.

All Three.js & Rendering →

Rendering

Interactive visual
common

Billboarding

flat cards that always turn to face the camera

A billboard is a flat quad rotated every frame to face the camera, so a 2D image reads as 3D. Use full facing for sprites, Y-axis only for trees.

Interactive visual
common

Fragment Shaders

a tiny program that runs once for every pixel

A fragment shader computes the colour of each pixel a triangle covers. Feed it UVs, normals and a time uniform and it paints anything.

Interactive visual
core

Frustum Culling

don't draw what the camera can't see

Frustum culling skips objects whose bounding volume lies fully outside the camera's six view planes, before any draw call is made.

Interactive visual
common

Level of Detail (LOD)

spend triangles only where the player can see them

LOD swaps a mesh for cheaper versions as it shrinks on screen, so far objects cost a fraction of near ones. Hysteresis stops the swaps flickering.

Interactive visual
core

Raycasting

shoot an invisible line and ask what it touches first

A ray is an origin plus a direction. Raycasting returns the nearest surface it crosses, with hit point, distance and surface normal.

Interactive visual
core

Surface Normals

the unit arrow that says which way a surface faces

A normal is a unit vector perpendicular to a surface. Lighting, slope checks, bounces and decals all start from it, so it must be right.

Interactive visual
core

Z-Fighting

two surfaces, one depth value, endless flicker

Z-fighting is the shimmering stripes you get when two surfaces are closer than the depth buffer can resolve. Fix the geometry, the near plane or the bias.

Mathematics

The math under game code: rotations, interpolation and deterministic randomness.

All Mathematics →

Rotations

Interactive visual
core

Quaternions

four numbers that rotate without gimbal lock

A unit quaternion stores a 3D rotation as an axis and half-angle. It composes cheaply, never gimbal-locks and slerps along the shortest arc.

Interpolation

Interactive visual
core

Easing Functions

bend linear progress into motion with weight

An easing function remaps progress t from 0..1 so motion accelerates, decelerates, overshoots or bounces instead of moving at a robotic constant speed.

Procedural

Interactive visual
common

Seeded Noise

same seed in, same world out, every time

A seeded PRNG plus gradient noise and fBm turns one integer into an endless, smooth, repeatable world: same seed, same terrain on every machine.

Game Feel

Timing and motion rules that make jumps, hits and cameras respond the way players expect.

All Game Feel →

Timing

Interactive visual
common

Coyote Time

let the player jump a few frames after leaving the ledge

Coyote time keeps a jump available for ~0.1 s after the character walks off an edge, so presses that feel on time are not eaten by the game.

Interactive visual
core

Delta Time

scale every change by how long the last frame took

Delta time is the seconds since the last frame. Multiply speeds and rates by it so a game plays the same at 30, 60 or 144 fps.

Interactive visual
common

Hit Stop

freeze both fighters for a few frames when a blow lands

Hit stop pauses the attacker and target for a few frames on impact. The brief freeze sells weight and gives the eye time to read the hit.

Interactive visual
common

Input Buffering

remember a press for a moment and fire it when it becomes legal

Input buffering stores a press for ~0.1 s and performs it as soon as the action becomes possible, so slightly early inputs still count.

Interactive visual
core

Invincibility Frames

after a hit, ignore damage for a short, clearly signalled window

Invincibility frames (i-frames) make a character ignore damage for a short window after a hit or during a dodge, with blinking to show it.

Motion

Interactive visual
core

Acceleration and Friction

ramp velocity toward the input instead of snapping to it

Ramp velocity toward input × max speed with an acceleration, and back to zero with a separate deceleration, to give movement weight.

Interactive visual
common

Squash and Stretch

deform along the motion, keep the volume constant

Stretch an object along its velocity and squash it on impact, scaling the other axes so volume stays constant. Motion reads as fast and elastic.

Camera

Interactive visual
common

Camera Deadzone

let the player move inside a box before the camera follows

A camera deadzone is a box around the screen centre where the target moves freely. The camera only follows when the target pushes past its edge.

Interactive visual
common

Screen Shake

add trauma on impact, shake by trauma squared, let it decay

Trauma-based screen shake: hits add trauma (0–1) that decays over time, and the camera is offset by trauma² × smooth noise for impact.

Systems

Code patterns most games need for objects, effects, simulation and collision.

All Systems →

Patterns

Interactive visual
core

Object Pooling

create everything up front, then recycle instead of allocate

Pre-allocate bullets, effects and enemies once, then hand out and return them. No allocation or GC spikes mid-fight, and a hard cap on live objects.

Interactive visual
core

Particle System

thousands of short-lived points, one draw call

An emitter spawns particles at a rate, each lives for a set time under simple forces, and all of them render in a single instanced draw call.

Simulation

Interactive visual
core

Fixed Timestep

physics ticks at a steady rate, rendering just blends between ticks

Run physics in constant dt slices from an accumulator, clamp long frames, and interpolate between the last two states for smooth, repeatable motion.

Collision

Interactive visual
core

Hitboxes & Hurtboxes

attacks carry hitboxes, bodies carry hurtboxes, and they only meet on active frames

Attacks own hitboxes that exist only during active frames; characters own hurtboxes. An overlap is a hit, registered once per swing per target.

Interactive visual
core

Tunneling & Continuous Collision

fast objects skip over thin walls between two ticks

A fast object can be on one side of a thin wall at one tick and past it at the next. Swept tests (CCD) check the whole path between positions.

AI

Navigation, steering and decision-making for game characters.

All AI →

Navigation

Interactive visual
core

A* Pathfinding

expand the node that looks cheapest so far plus estimated cost to go

A* searches a graph by always expanding the node with the lowest cost so far plus estimated cost to go. With an admissible heuristic, the path is optimal.

Steering

Interactive visual
core

Steering Behaviors

steer toward a desired velocity, a little each frame

Seek, arrive and separation each compute a desired velocity; steering is desired minus current velocity, capped and summed. Simple rules, lifelike motion.

Decision making

Interactive visual
core

Finite State Machine

one state at a time, explicit events move between them

An FSM keeps an AI or character in exactly one state, such as Idle, Patrol, Chase or Attack. A table of events decides every legal transition.

Performance

Where the 16.67 ms of a frame go, and the standard ways to spend less of them.

All Performance →

CPU

Interactive visual
core

Frame Budget

every system shares one slice of time per frame

At 60 Hz a frame has 16.67 ms for input, gameplay, physics, AI and rendering combined. Measure each system and keep the total under budget with headroom.

Interactive visual
common

Time Slicing

let a different group think each frame

Split expensive per-entity work into buckets and run one bucket per frame. Cost per frame drops by the bucket count; each entity reacts a little later.

GPU

Interactive visual
core

Draw Calls

draw a thousand things in one request

Each mesh costs the CPU a draw call plus state changes. Instancing and batching turn thousands of identical objects into one call; track renderer.info.

Interactive visual
common

Overdraw

every layer on a pixel is paid for again

Overdraw is shading the same pixel more than once. Stacked transparent particles and big quads multiply fill cost; trim sprites and limit layers.

Interactive visual
common

Texture Atlas

many images, one texture, one material

Pack many sprites into one texture and address each by its UV rectangle, so objects share a material and batch into few draw calls. Pad to stop bleeding.

World

Interactive visual
advanced

Chunk Streaming

keep only the world around the player in memory

Split a big world into chunks, load those within a radius of the player and unload them past a larger radius, so the boundary never thrashes.

Interactive visual
core

Spatial Partitioning

only compare things that are near each other

Bin objects into a uniform grid so collision and proximity queries test only same-cell and neighbour-cell pairs instead of all n(n−1)/2 pairs.

Physics

Interactive physics from forces and fields to quanta and curved spacetime, with the equations behind each model.

All Physics →

Mechanics

Interactive visual
core

Balancing Act: Torque and Levers

force times lever arm decides which way it turns

A lever balances when m₁r₁ = m₂r₂. Torque is force times lever arm, and net torque over moment of inertia gives angular acceleration.

Interactive visual
core

Buoyancy

the water pushes up with the weight of what you displace

Archimedes: a body is pushed up by the weight of fluid it displaces, so it floats with ρ_object/ρ_fluid of its volume under. Boats and crates in games.

Interactive visual
common

Damped Pendulum

a sine-shaped pull back to the bottom, minus friction

A swinging weight pulled by sin θ: its period is only 2π√(L/g) for small swings, and damping decays the arc. Grapples, lamps and ropes in games.

Interactive visual
common

Kepler's Laws

ellipses, equal areas, and T² ∝ a³

Orbits are ellipses with the star at one focus, sweep equal areas in equal times, and have T² ∝ a³. Place planets on rails exactly with Kepler's equation.

Interactive visual
common

Projectile Data Lab

small launch errors become a spread of landing spots

Repeat a launch with a little speed error and the landings form a distribution. Mean, spread and why R ∝ v² shifts the average: the maths of weapon spread.

Interactive visual
core

Projectile Motion

constant sideways speed, steadily changing vertical speed

Launch angle, speed and gravity fully determine a ballistic arc: x moves at constant speed while y accelerates downward.

Interactive visual
common

Solar System: Two-Body Orbits

everything orbits the shared centre of mass

Two gravitating bodies circle their shared barycentre: radii split by mass, period set by total mass. Plus a stable n-body integrator for games.

Interactive visual
core

Sound Waves

air molecules shuffle back and forth, the pattern travels

Sound is a longitudinal pressure wave: frequency sets pitch and wavelength, amplitude sets loudness. The physics behind 3D audio, delay and Doppler.

Interactive visual
core

Spring-Mass Oscillator

pull back in proportion, bleed energy, push in rhythm

Hooke's law, damping and a periodic push: the forced oscillator behind springy cameras, wobbly UI and suspension, and why driving at ω₀ explodes.

Electromagnetism

Interactive visual
advanced

Charged Particle Motion

B bends, E pushes, together they drift

The Lorentz force curls a charge around magnetic field lines and crossed E and B make it drift sideways. Integrate it with Boris, not Euler.

Interactive visual
common

Electric Field Lines

add every charge's push, then follow the arrows

Coulomb fields add as vectors; tracing streamlines along the net field draws lines that leave positive charges, end on negative ones and never cross.

Interactive visual
advanced

EM Wave Propagation

leapfrog E and B on a staggered grid

Light is E and B regenerating each other. A 1D Yee grid (FDTD) leapfrogs them in time, slows them in glass and blows up past the Courant limit.

Thermodynamics

Interactive visual
advanced

Boltzmann Energy Distribution

high energy is possible, just exponentially rare

At temperature T a state of energy E is weighted by e^(−E/kT). Metropolis sampling reproduces the distribution with a simple accept/reject rule.

Interactive visual
common

Heat Diffusion

each cell drifts toward the average of its neighbours

Heat flows down temperature gradients at a rate set by the Laplacian. The explicit grid update is four lines of code, and is stable only if αΔt/Δx² ≤ ¼.

Interactive visual
core

Ideal Gas Kinetics

pressure is just particles bouncing off walls

Temperature is average kinetic energy and pressure is momentum delivered to the walls. Bounce point particles in a box and PV = NkT falls out.

Quantum Mechanics

Interactive visual
advanced

2D Schrödinger Wave Packet

a cloud of probability that spreads, scatters and interferes

A Gaussian wave packet in 2D drifts, spreads and splits at a potential bump; brightness shows |ψ|² and colour shows the quantum phase.

Interactive visual
common

Particle in a Box

walls force whole half-waves, so energy comes in steps

A particle trapped between hard walls can only hold standing waves, so its energy is quantized as n² and superpositions slosh at beat frequencies.

Interactive visual
advanced

Quantum Tunneling

a wave leaks through a wall it can't climb

A quantum packet hitting a barrier higher than its energy still partly gets through: transmission falls off exponentially with barrier width.

Relativity

Interactive visual
advanced

Gravitational Waves

orbiting masses shake spacetime at twice their orbit rate

A compact binary radiates gravitational waves at twice its orbital frequency; chirp mass and distance set a strain of around 10⁻²¹ or smaller.

Interactive visual
common

Mass Effect on Spacetime

more mass, deeper well, tighter orbits

Mass curves spacetime: picture a gravity well whose depth follows −GM/r, with the Schwarzschild radius 2GM/c² marking where light can no longer escape.

Interactive visual
advanced

Mercury's Perihelion Precession

relativity keeps the ellipse from quite closing

General relativity adds a small 1/r⁴ pull that makes an orbit's closest point creep forward each lap: about 43 arcseconds per century for Mercury.