I'm trying to build a little MOBA game (max 10 players) in Unity and i'm really stuck with the pathfinding / local avoidance.
Here is what i'm doing when user click to move on the map:
- Client send a MovementPacket containing the target position to the server
- The server will calculate a path using a pathfinding library
- The server will send back this packet with a list of points to all the clients
- Clients will use the same library to follow the points
This is basic and working pretty well.
But problems appears if I want obstacle avoidance between the players (like in League of Legends for example, you can't walk on other players).
Let's say the pathfinding library i'm using (Aron Granberg lib) handle local avoidance, the only "easy" solution I see is to use it on both the server and client side.
But I'm afraid it won't be in sync (for example the RVOSimulator of this library is running at a specific tick in the Update function of unity, but what happens if I have FPS drop on client side?).
Do you know a better way to handle it? It seems to be pretty complex, how do they handle it so well in other mobas ?