This is a general question about which is likely more efficient. I'm building an MMO style ocean based game where individual zones will be quite large. I'm deciding on how to implement detection of hostiles (usually players) by AI controlled NPC ships. For example, when a player gets within say 2,000 units distance from an AI ship the AI will notice the player on the horizon and take an action (for example, steer to attack, ignore, or even run away).
In other games I made long ago (not Unity) I would normally go down the list of players and calculate the distance of each player from the AI controlled ship and then have the AI make it's decision based on that. I want to in theory support several hundred players though, and potentially have that many AI controlled ships in the same zone, which is a lot of calculations to do for every AI ship.
I was thinking though that with Unity I could create a sphere collider with a 2000 unit radius around every AI ship, and then the AI would just act on enemies after they on trigger enter the collider. If multiple hostiles are within the collider's radius I can have the AI ship make decisions on who to attack, but the list of players to act on is now pretty small.
I'm worried though that a fast moving ship with a 4,000 unit wide collider zipping around the game might not be a normal use case for colliders, and they may not be optimized for this. Anyone have any experience with this, or is there an alternative way to handle this I'm not thinking of?
Here's a screen shot of the game if anyone is interested by the way