Godot Version
4.5.1
Question
How do I keep unit paths synchronized across clients for multiple units in a multiplayer RTS game? Specifically, for when paths need to be changed because of obstacles.
Currently, I just mutate my A-star node, turning points off and on again in each units local vicinity. So when a unit gets blocked, it checks for obstacles in it’s local area, adjusts the A-star node accordingly, and then repaths.
This is happening mid-tick and each unit would then mutate their own instructions, which recently I’ve learned is sort of bad to do
.
To fix this, I plan on making units either set a flag or signal that they need a path change and then have each client update these paths on tick, rather than mid tick like they currently do.
However, to avoid obstacles, should I be using this solution of turning nodes on and off for Astar? I’m thinking of maybe making a “gridmanager“ node, that records and refreshes occupied tiles per tick and use that instead?
Below is a gif of the problem in action. The slimes just completely de-sync across my clients, and I’m not really sure if the fix of getting paths recalculated on tick rather than mid tick would actually fix this issue.

The obstacle avoidance works “okay” with less units or with just 2 units bumping into each other, but it’s not really good enough. It will sometimes de-sync in these scenarios as well; see below.

Some context about game I’m making:
- Old-school in terms of it’s grid, 1 tile is the size of 1 unit, and units move only left-right-up-down.
- I don’t intend to support a large number of units on screen, maybe 100+ max.
Another option I’m looking into is something more rule based? “See if tile is occupied”, if yes, move left-right or up-down depending on the direction, and then repath. I imagine this would be much easier to sync in a multiplayer game, but would this sort of logic still work in larger scales like during a battle?
Oh also, I don’t think I would want to do a solution with physics; have units bump and slide past each other. Since this would require syncing physics simulations across clients. I’ve tried to do that a little bit before across clients and it was a total pain, so I want to keep any sort of physics simulation to a minimum in my game.
Any advice on the sort of structure I would need to implement would be much appreciated! ![]()

