2D Game Optimization and Performance Flashcards
7 cards from real 2D Game Development practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 2D Game Optimization and Performance flashcards as text
What is the benefit of using a fixed-timestep update loop in a 2D game?
Answer: It makes physics and game logic deterministic and independent of rendering frame rate
A fixed timestep ensures physics and game logic always advance by the same delta time, making simulations reproducible and preventing instability caused by variable frame times.
Which approach best reduces CPU overhead when updating hundreds of similar game entities each frame?
Answer: Using a Data-Oriented Design (DOD) approach with structs-of-arrays for cache-friendly iteration
Structs-of-arrays layout keeps the same field type for all entities contiguous in memory, maximizing CPU cache utilization and SIMD vectorization opportunities during mass updates.
In 2D games, 'batching' render calls means:
Answer: Combining multiple sprite draw operations into a single GPU draw call when they share a texture and shader
Batching merges sprites that share the same texture and material into one draw call, dramatically reducing CPU-to-GPU command overhead.
What problem does mipmapping solve in 2D games that use camera zoom-out?
Answer: It reduces aliasing and texture cache misses when sprites are rendered smaller than their native resolution
Mipmaps are pre-downscaled versions of a texture; the GPU samples the appropriately sized mip level when a sprite appears small on screen, reducing aliasing and improving texture cache efficiency.
Which memory layout concern is most relevant to 2D particle system performance?
Answer: Keeping particle data in contiguous arrays (SOA) to enable SIMD processing and reduce cache misses
Struct-of-Arrays layout for particle positions, velocities, and lifetimes enables vectorized (SIMD) updates and keeps accessed data contiguous in the CPU cache.
What is the purpose of 'level-of-detail' (LOD) for sprites in a 2D game with zoom?
Answer: Switching to lower-resolution sprite variants when they appear small on screen to save texture bandwidth
Sprite LOD swaps in smaller, lower-resolution versions when a sprite is rendered at a small size, reducing texture memory bandwidth and maintaining visual quality at the appropriate detail level.
In a 2D tile-based game, why is it common to pre-bake static tilemaps into a single large mesh or render texture?
Answer: It eliminates per-tile draw calls, reducing CPU overhead to a single draw call for the entire static layer
Baking a static tilemap into one mesh or texture means the entire layer is drawn in a single GPU command, removing the overhead of issuing thousands of individual sprite draw calls each frame.