Sample questions
Game Physics CollisionDifficulty 1
In game engines, what is the basic purpose of collision detection?
- aTo calculate the total memory used by all active objects each frame
- bTo decide which objects should be loaded from disk before a level starts
- cTo render objects with correct lighting and shadows based on their position
- dTo determine when two or more objects overlap or come into contact✓
Explanation:Collision detection's job is purely to determine overlap or contact between objects; what happens afterward (bouncing, taking damage, opening a door) is handled by separate response logic. (a) is memory management, (b) is asset streaming, (c) is rendering — none of these are what collision detection itself does.
Game Physics CollisionDifficulty 2
Checking every object's exact shape against every other object's exact shape every frame is accurate but often too slow at scale. What is the common two-stage strategy engines use to keep this affordable?
- aEliminate non-touching pairs with a cheap test first, then run the precise test only on survivors✓
- bSkip collision checks entirely for any object moving slower than a fixed speed threshold
- cRun the exact-shape check once at level load and reuse the cached result for the rest of the level
- dReduce the frame rate whenever the number of objects on screen increases
Explanation:This is the cheap-then-precise two-stage split: a rough approximate test culls most pairs quickly, and the expensive precise test only runs on the small number of pairs that survive it. (b) is wrong because speed isn't the relevant criterion, proximity is. (c) is wrong since object positions change every frame. (d) degrades the game without solving the underlying cost.
Game Physics CollisionDifficulty 2
A puzzle game has 200 movable objects on a single screen. A programmer implements collision detection by comparing every object against every other object each frame, and performance drops sharply as more objects are added. What is the root cause?
- aThe rendering pipeline redraws every object twice whenever collision detection is enabled
- bEach object's collider is being rebuilt from its mesh from scratch every single frame
- cPairwise comparisons grow roughly with the square of the object count✓
- dThe physics engine is running on a separate thread that is being starved of CPU time by rendering
Explanation:A naive all-pairs check is O(n^2): at n=200 there are about 19,900 pairs; at n=400 there are about 79,800 — roughly 4x the work for 2x the objects. This growth is exactly why spatial partitioning matters. (a), (b), and (d) sound plausible but are not the described cause.
Game Physics CollisionDifficulty 1
What is the basic idea behind dividing the game world into regions (such as a grid) for collision purposes?
- aIt lets the renderer draw distant regions with lower-detail textures
- bIt groups nearby objects so comparisons stay local✓
- cIt automatically merges overlapping objects into a single combined object
- dIt lets the audio engine decide which region's sounds should be muted
Explanation:Spatial partitioning groups objects by location so comparisons are limited to nearby regions instead of the whole object set, directly reducing the pairwise-comparison cost seen in the previous scenario. (a) describes level-of-detail rendering, (c) is not what partitioning does, (d) is audio culling.
Game Physics CollisionDifficulty 2
Two objects sit at opposite corners of a very large open-world map, far enough apart that they can never realistically touch. In a naive collision system they are still compared every frame. How would a grid-based partitioning scheme typically avoid this wasted work?
- aBy deleting one of the two objects from memory once the distance exceeds a threshold
- bBy merging both objects into the same physics body regardless of distance
- cBy placing them in different, non-adjacent cells so they are never compared✓
- dBy disabling collision detection entirely once the map size exceeds a certain limit
Explanation:Objects only get compared to others sharing their cell (or adjacent cells); two far-apart objects land in unrelated cells and are simply never paired for a check. (a), (b), and (d) describe destructive or all-or-nothing approaches that are not how partitioning works.
Game Physics CollisionDifficulty 2
For an object's collider, what is the main trade-off between using a simple shape (like a box or sphere) versus a shape that closely follows the exact visual mesh?
- aSimple shapes always look identical to the visual mesh, so there is no real trade-off
- bMesh-based colliders only work correctly for objects that never move
- cSimple shapes require more memory than exact mesh colliders because they need extra padding data
- dSimple shapes are cheaper to test but less precise; mesh shapes are accurate but costlier✓
Explanation:This is the core collider trade-off: cost versus precision. Simple primitives are cheap to test mathematically but may allow small visual gaps or false contacts near corners; mesh colliders hug the visual shape closely but are far more expensive to test, especially at scale.