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.
Where the 16.67 ms of a frame go, and the standard ways to spend less of them.
7 cheat sheets · 3 subcategories
Budgeting and spreading work across frames.
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.
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.
Fewer draw calls, fewer overdrawn pixels.
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.
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.
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.
Organising large worlds in space and memory.
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.
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.