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 primary purpose of a texture atlas (sprite sheet) in 2D game optimization?
Answer: To reduce draw calls by batching multiple textures into a single GPU bind
A texture atlas combines multiple sprites into one texture, allowing the GPU to render many sprites in fewer draw calls, which significantly reduces CPU-GPU communication overhead.
Which rendering technique minimizes overdraw in a 2D game scene?
Answer: Drawing opaque sprites front-to-back so the depth buffer rejects hidden pixels early
Drawing opaque objects front-to-back lets the depth test discard pixels that would be hidden, reducing the number of fragments the GPU needs to shade.
What does 'object pooling' solve in 2D game performance?
Answer: It avoids frequent heap allocations and garbage collection spikes by reusing objects
Object pooling pre-allocates a fixed number of objects and recycles them, preventing the garbage collector from running frequently and causing frame rate hitches.
In a 2D game, a 'dirty flag' pattern is most useful for:
Answer: Avoiding redundant transform recalculations on objects that haven't moved
A dirty flag marks a cached value as stale only when the underlying data changes, so transforms are only recalculated when an object has actually moved or rotated.
What is the main advantage of using a quadtree in a 2D game?
Answer: It partitions space to speed up spatial queries like collision broad-phase detection
A quadtree recursively subdivides 2D space, allowing the broad-phase collision system to quickly eliminate pairs of objects that are too far apart to collide.
Which metric most directly measures whether a 2D game is GPU-bound vs. CPU-bound?
Answer: GPU frame time vs. CPU frame time per frame in a profiler
Comparing GPU frame time to CPU frame time in a GPU profiler reveals which processor is the bottleneck; the one with the higher time is the limiting factor.
What is 'frustum culling' adapted to in a 2D game context?
Answer: Skipping rendering of sprites whose bounding rectangles lie entirely outside the camera viewport
In 2D, culling checks whether a sprite's bounding rectangle intersects the camera's viewport rectangle; sprites entirely outside are not submitted for rendering.