Do you only have movement code in ExecuteCommand?

Options
This is how it's done based on the tutorial, and it was working mostly for me. But if the controller stops queuing commands, the player's movement stops. Would it be correct to also do movement in SimulateController with either the last known command or an empty command? Or do you only do input-based movement in ExecuteCommand, and do other movement, like gravity, in SimulateController? The tutorial also doesn't do anything about predicting proxy movement, or is that done automatically with transform interpolation?

Comments

  • stanchion
    Options
    With server auth, your player will not move if you are not sending commands, because the server has no way of knowing you want to move the player.

    If you want to handle missing commands do it this way

    public override void MissingCommand (Bolt.Command previous)
    {
    if(previous == null) { return; }
    ExecuteCommand(previous,true);
    }

    The tutorial does have client side prediction, execute command is called on owner and controller.
  • Jon Bonne
    Options
    Thanks, I didn't know about that method. I'm talking about movement that is not based on player input, like falling from gravity. If the controller stops sending commands, I still need to calculate his movement from gravity and momentum. Is my thinking confused on this? Is it assumed that there will always be a constant stream of commands?
  • stanchion
    Options
    If there are no incoming commands it probably means the client has disconnected and the server should take back control or destroy the entity.