I'm currently doing a pretty huge refacto on all of our entity system (mobs, npcs, players) to split everything to work with a client/server style.
The first version will feature a pretty heavy/greedy system that mimic the 0.0.3 milestone, it will be laggy but it will give us a first implementation to work on.
To differentiate the client and server side entity I renamed this last in "Agent".
The client will send player movement (both click events and input vector) at each frame to the server.
The server will then manage all of the move logic and create a velocity vector based on the computed navigation path or collision avoidance for both movement cases.
This velocity vector is then sent back along all other surrounding agents to each client.
The mock-up currently looks like this:
Navigation by mouse:
Service Action: Click
Service Client: SetClickPos to Server
Service Server: SetClickPos through the navigation agent
Service Server: Apply NavigationPath to Agent
Service Agent: Update along the NavigationPath with the navigation server
Service Agent: Receive _velocity_computed() apply and forward to Client
Service Client: Receive _velocity_computed(), forward to Entity
Service Entity: Receive _velocity_computed() and (lerp a) set_position(new_pos)
Navigation by sticks/keys:
Service Action: Move input
Service Client: SetMovePos to Server
Service Server: SetMovePos to the Agent
Service Agent: Call direction_to() on (pos + velocity)
Service Agent: Trigger manually the _velocity_computed()
Service Agent: Receive _velocity_computed() apply and forward to Client
Service Client: Receive _velocity_computed(), forward to Entity
Service Entity: Receive _velocity_computed() and (lerp a) set_position(new_pos)
Surrounding Agents (npcs, mobs, other players):
Service Agent: Randomly apply a new NavigationPath to Agent
Service Agent: Update along the NavigationPath with the navigation server
Service Agent: Receive _velocity_computed() apply and forward to Client
Service Client: Receive _velocity_computed(), forward to Entity
Service Entity: Receive _velocity_computed() and (lerp a) set_position(new_pos)
All of this is being worked on this branch: https://gitlab.com/sourceofmana/sourceo ... ic_network
More info about the on-going network integration: viewtopic.php?t=21582