I have a grid of 100 by 100 tiles.
each tile has a list of units that are currently standing ontop of it.
in this grid 500 units of team 1 and 500 units of team 2 are randomly walking around.
while they are walking around they place themselves in the unitlist of each tile they are on.
problem: Each unit has to check lets say a square of 6 by 6 tiles around the tile he is on, to check if there is an enemy nearby.
my solution. each unit checks on top of what tile he is and only when it changes tiles it will check the 36 tiles around its current tile and check all their unitlist to check for nearby enemies…
- isn’t there a better way to do this? Because when I need my units to have a bigger line of sight of lets say 15tiles it needs to check 1000units * 15tiles *15tiles = a gazillion…
- Does there exist a very inexpensive way of using somekind of a basic circle collider in unity without the need for rigid bodies etc…?