Spatial grids are used in games to divide a map into smaller cells, allowing efficient collision detection. Recently, the author refactored their spatial grid to a quad tree, which partitions objects more efficiently in 2D space. A quad tree splits a region into four quadrants once a capacity limit is reached, improving performance by only checking relevant cells for collisions. This data structure is particularly useful for efficiently querying large sets of objects in games, databases, and more.

12m watch time

Sort: