Hey !
I am currently working on a multiplayer game, and one of our biggest constraint is the ability to handle hundreds of secondary AI entities at one time in some cases, maybe even more than a thousand if that’s even technically possible.
That AI needs to move around the map, find a path to its current target, follow it, attack it when in range. Very simple. For that I figured we’d use a navmesh system (not Unity’s, but our own, not that hard to generate one from what I’ve tested). However, here’s the thing : We need the player to be constrained at basically the same extent the AI is with that navmesh, meaning the players can’t run off a cliff or into a wall / decor for example (he could however get pushed and fall down a cliff, but that should be simple to handle).
The idea is that every time an entity (AI and player controlled) wishes to move in a certain direction, the movement method queries the navmesh for where the player’s position should when the movement is over. Meaning basically that while a player holds down Z (or W for you QWERTY users), the ACTUAL direction would constantly be adjusted to follow the navmesh.
However, the problem is that I suspect it would require quite a lot of calculation, and for an online game, that can’t be good. Do you think it is a good idea to use the navmesh for multiple things like so, or should we use a more “traditionnal” physics system for the players ?
Looking forward to your insight ![]()