Hi !
We are using RVOControllers in our project to move entities, and we have an important delay for the players movements.
Here is the global process : The client sends the target point to the server, the server computes the path, starts moving the entity and then the client gets the velocity and starts to move.
Positions & velocities are updated 15 times per sec, and AI simulation is updated at 20 FPS.
I wanted to send the new velocity as soon as the paths computation ends, but there is an important delay before the RVOController gets and applies the new velocity.
I have founded an “ugly” workaround, but i’d like to know if there is a better way to handle this.
I’ve added the following functions :
Agent :
public void UpdateVelocity()
{
Velocity = velocity = newVelocity;
}
RVOController :
public void ForceVelocityUpdate()
{
Agent agent = rvoAgent as Agent;
if (agent != null)
{
agent.BufferSwitch();
agent.CalculateNeighbours();
agent.CalculateVelocity();
agent.UpdateVelocity();
}
}
And i call :
RVOController.Update();
RVOController.ForceVelocityUpdate();
once path is computed.
With these modifications, i have reduced the delay between the client request and the result of his entity’s moving of about 100-150 ms ( from 250-300ms to 100-150ms ).
Do you have any ideas or suggestions about this ?
Thanks,
Colin