Time to get moving!
I think I’ve got movement sorted out. There should be a good balance between client and server workload, so hopefully it won’t be too intensive.
Here’s the gist of it:
- The user sends a “StartMovement” request to the server
- The client animates the player moving
- The server sends out information about the moving player to all nearby players, who animate the player moving
- The movement ends in the client, which sends an “EndMovement” request to the server
- The server checks that the end movement is correct
- The server updates nearby players with the moved players position
If the user sends a new movement while an existing movement is in progress, the server will check that the new movement starts on a point on the previous movement’s line, and if so will set the new target.
Things outstanding are path finding and figuring out what to do if the client doesn’t send the EndMovement request. I Also need to test with lag and more players.
But it’s still a good milestone! :)
(The gif is a bit jittery)