# Game Development Cheat Sheet (GDCS) > Visual, AI-ready cheat sheets for game development and physics. Every concept has an interactive Three.js visual, formulas, code and a copy-ready prompt. Each sheet has an HTML page and a Markdown twin at the same URL plus `.md`. The full corpus is at https://gdcs.coody.app/llms-full.txt. ## Three.js & Rendering How a 3D scene becomes pixels: rays, normals, culling, shaders and the standard ways to draw less. - [Billboarding](https://gdcs.coody.app/threejs/rendering/billboarding.md): Rendering. 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. - [Fragment Shaders](https://gdcs.coody.app/threejs/rendering/fragment-shader.md): Rendering. A fragment shader computes the colour of each pixel a triangle covers. Feed it UVs, normals and a time uniform and it paints anything. - [Frustum Culling](https://gdcs.coody.app/threejs/rendering/frustum-culling.md): Rendering. Frustum culling skips objects whose bounding volume lies fully outside the camera's six view planes, before any draw call is made. - [Level of Detail (LOD)](https://gdcs.coody.app/threejs/rendering/level-of-detail.md): Rendering. 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. - [Raycasting](https://gdcs.coody.app/threejs/rendering/raycasting.md): Rendering. A ray is an origin plus a direction. Raycasting returns the nearest surface it crosses, with hit point, distance and surface normal. - [Surface Normals](https://gdcs.coody.app/threejs/rendering/normals.md): Rendering. 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. - [Z-Fighting](https://gdcs.coody.app/threejs/rendering/z-fighting.md): Rendering. 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. - [Quaternions](https://gdcs.coody.app/mathematics/rotations/quaternions.md): Rotations. 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. - [Easing Functions](https://gdcs.coody.app/mathematics/interpolation/easing.md): Interpolation. An easing function remaps progress t from 0..1 so motion accelerates, decelerates, overshoots or bounces instead of moving at a robotic constant speed. - [Seeded Noise](https://gdcs.coody.app/mathematics/procedural/seeded-noise.md): Procedural. 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. - [Coyote Time](https://gdcs.coody.app/game-feel/timing/coyote-time.md): Timing. 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. - [Delta Time](https://gdcs.coody.app/game-feel/timing/delta-time.md): Timing. 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. - [Hit Stop](https://gdcs.coody.app/game-feel/timing/hit-stop.md): Timing. 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. - [Input Buffering](https://gdcs.coody.app/game-feel/timing/input-buffering.md): Timing. 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. - [Invincibility Frames](https://gdcs.coody.app/game-feel/timing/invincibility-frames.md): Timing. 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. - [Acceleration and Friction](https://gdcs.coody.app/game-feel/motion/acceleration-and-friction.md): Motion. Ramp velocity toward input × max speed with an acceleration, and back to zero with a separate deceleration, to give movement weight. - [Squash and Stretch](https://gdcs.coody.app/game-feel/motion/squash-and-stretch.md): Motion. 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 Deadzone](https://gdcs.coody.app/game-feel/camera/camera-deadzone.md): Camera. 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. - [Screen Shake](https://gdcs.coody.app/game-feel/camera/screen-shake.md): Camera. 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. - [Object Pooling](https://gdcs.coody.app/systems/patterns/object-pooling.md): Patterns. 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. - [Particle System](https://gdcs.coody.app/systems/patterns/particle-system.md): Patterns. 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. - [Fixed Timestep](https://gdcs.coody.app/systems/simulation/fixed-timestep.md): Simulation. Run physics in constant dt slices from an accumulator, clamp long frames, and interpolate between the last two states for smooth, repeatable motion. - [Hitboxes & Hurtboxes](https://gdcs.coody.app/systems/collision/hitbox-hurtbox.md): Collision. Attacks own hitboxes that exist only during active frames; characters own hurtboxes. An overlap is a hit, registered once per swing per target. - [Tunneling & Continuous Collision](https://gdcs.coody.app/systems/collision/tunneling.md): Collision. 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. - [A* Pathfinding](https://gdcs.coody.app/ai/navigation/a-star-pathfinding.md): Navigation. 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 Behaviors](https://gdcs.coody.app/ai/steering/steering-behaviors.md): Steering. Seek, arrive and separation each compute a desired velocity; steering is desired minus current velocity, capped and summed. Simple rules, lifelike motion. - [Finite State Machine](https://gdcs.coody.app/ai/decision/finite-state-machine.md): Decision making. 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. - [Frame Budget](https://gdcs.coody.app/performance/cpu/frame-budget.md): CPU. 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. - [Time Slicing](https://gdcs.coody.app/performance/cpu/time-slicing.md): CPU. 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. - [Draw Calls](https://gdcs.coody.app/performance/gpu/draw-calls.md): GPU. 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. - [Overdraw](https://gdcs.coody.app/performance/gpu/overdraw.md): GPU. Overdraw is shading the same pixel more than once. Stacked transparent particles and big quads multiply fill cost; trim sprites and limit layers. - [Texture Atlas](https://gdcs.coody.app/performance/gpu/texture-atlas.md): GPU. 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. - [Chunk Streaming](https://gdcs.coody.app/performance/world/chunk-streaming.md): World. 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. - [Spatial Partitioning](https://gdcs.coody.app/performance/world/spatial-partitioning.md): World. 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. - [Balancing Act: Torque and Levers](https://gdcs.coody.app/physics/mechanics/balancing-torque.md): Mechanics. A lever balances when m₁r₁ = m₂r₂. Torque is force times lever arm, and net torque over moment of inertia gives angular acceleration. - [Buoyancy](https://gdcs.coody.app/physics/mechanics/buoyancy.md): Mechanics. 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. - [Damped Pendulum](https://gdcs.coody.app/physics/mechanics/damped-pendulum.md): Mechanics. 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. - [Kepler's Laws](https://gdcs.coody.app/physics/mechanics/keplers-laws.md): Mechanics. 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. - [Projectile Data Lab](https://gdcs.coody.app/physics/mechanics/projectile-data-lab.md): Mechanics. 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. - [Projectile Motion](https://gdcs.coody.app/physics/mechanics/projectile-motion.md): Mechanics. Launch angle, speed and gravity fully determine a ballistic arc: x moves at constant speed while y accelerates downward. - [Solar System: Two-Body Orbits](https://gdcs.coody.app/physics/mechanics/solar-system.md): Mechanics. Two gravitating bodies circle their shared barycentre: radii split by mass, period set by total mass. Plus a stable n-body integrator for games. - [Sound Waves](https://gdcs.coody.app/physics/mechanics/sound-waves.md): Mechanics. Sound is a longitudinal pressure wave: frequency sets pitch and wavelength, amplitude sets loudness. The physics behind 3D audio, delay and Doppler. - [Spring-Mass Oscillator](https://gdcs.coody.app/physics/mechanics/spring-mass-oscillator.md): Mechanics. Hooke's law, damping and a periodic push: the forced oscillator behind springy cameras, wobbly UI and suspension, and why driving at ω₀ explodes. - [Charged Particle Motion](https://gdcs.coody.app/physics/electromagnetism/charged-particle-motion.md): Electromagnetism. 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. - [Electric Field Lines](https://gdcs.coody.app/physics/electromagnetism/electric-field-lines.md): Electromagnetism. Coulomb fields add as vectors; tracing streamlines along the net field draws lines that leave positive charges, end on negative ones and never cross. - [EM Wave Propagation](https://gdcs.coody.app/physics/electromagnetism/em-wave-propagation.md): Electromagnetism. 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. - [Boltzmann Energy Distribution](https://gdcs.coody.app/physics/thermodynamics/boltzmann-distribution.md): Thermodynamics. 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. - [Heat Diffusion](https://gdcs.coody.app/physics/thermodynamics/heat-diffusion.md): Thermodynamics. 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² ≤ ¼. - [Ideal Gas Kinetics](https://gdcs.coody.app/physics/thermodynamics/ideal-gas.md): Thermodynamics. Temperature is average kinetic energy and pressure is momentum delivered to the walls. Bounce point particles in a box and PV = NkT falls out. - [2D Schrödinger Wave Packet](https://gdcs.coody.app/physics/quantum-mechanics/schrodinger-2d.md): Quantum Mechanics. A Gaussian wave packet in 2D drifts, spreads and splits at a potential bump; brightness shows |ψ|² and colour shows the quantum phase. - [Particle in a Box](https://gdcs.coody.app/physics/quantum-mechanics/particle-in-box.md): Quantum Mechanics. A particle trapped between hard walls can only hold standing waves, so its energy is quantized as n² and superpositions slosh at beat frequencies. - [Quantum Tunneling](https://gdcs.coody.app/physics/quantum-mechanics/quantum-tunneling.md): Quantum Mechanics. A quantum packet hitting a barrier higher than its energy still partly gets through: transmission falls off exponentially with barrier width. - [Gravitational Waves](https://gdcs.coody.app/physics/relativity/gravitational-waves.md): Relativity. A compact binary radiates gravitational waves at twice its orbital frequency; chirp mass and distance set a strain of around 10⁻²¹ or smaller. - [Mass Effect on Spacetime](https://gdcs.coody.app/physics/relativity/mass-effect.md): Relativity. 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. - [Mercury's Perihelion Precession](https://gdcs.coody.app/physics/relativity/mercury-precession.md): Relativity. 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. ## Optional - [Sitemap](https://gdcs.coody.app/sitemap.xml) - [About](https://gdcs.coody.app/about)