Spatial Partition. Stop Checking Everything Against Everything.
Introduction
Your game has hundreds of units on a battlefield. Each one needs to know which enemies are nearby. The naive approach: compare every unit to every other unit. That is O(n²). Double the un
tigerabrodi.blog5 min read