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 does 'profiling' a 2D game mean, and why is it done before optimizing?
Answer: Measuring where CPU/GPU time is actually spent so optimization targets real bottlenecks rather than assumptions
Profiling instruments the running game to measure actual frame time distribution, preventing developers from optimizing code that isn't the real performance bottleneck.
Which technique is typically used to avoid CPU stalls while streaming level assets in a 2D game?
Answer: Asynchronous asset loading on a background thread so the main game loop continues uninterrupted
Asynchronous loading on a worker thread lets the main thread keep updating and rendering while assets load in the background, avoiding frame freezes during level streaming.
What is 'draw call batching' limited by when sprites use different blend modes?
Answer: Sprites with different blend modes cannot share a batch because the GPU state must change between them
Batching requires identical GPU state; changing blend modes flushes the current batch and starts a new one, so mixing blend modes across sprites breaks batch efficiency.
In a 2D game, a 'spatial hash' is preferable to a quadtree when:
Answer: Objects are distributed relatively uniformly and you need O(1) average-case cell lookup
A spatial hash divides the world into a grid of cells accessed by a hash function, giving O(1) average insertion and lookup when objects are spread relatively evenly across the space.
What problem does 'texture compression' (e.g., using ETC2 or BC formats) solve on mobile 2D games?
Answer: It reduces VRAM usage and texture bandwidth, allowing larger or more textures within hardware limits
GPU-native compressed texture formats remain compressed in VRAM and can be sampled directly, cutting memory usage by 4–8× and improving texture cache performance.
Which practice best reduces garbage collection pressure in a C#-based 2D game engine like Unity?
Answer: Caching component references in Start() and avoiding GetComponent calls in Update()
Caching references obtained once in Start() prevents repeated GetComponent allocations and avoids triggering the garbage collector with short-lived heap objects during Update.
What is the purpose of a 'frame budget' in 2D game performance planning?
Answer: A target time limit (e.g., 16.67 ms for 60 FPS) that all systems must collectively fit within each frame
A frame budget defines how many milliseconds are available per frame to achieve a target frame rate; each system (physics, AI, rendering) is allocated a slice of that budget.