Problem about Movement Synchronization

Options
erre
erre
Hi,

I'm Andrea. I'm developing a Top-Down Multiplayer game (like The Binding of Isaac for example - http://it.wikipedia.org/wiki/The_Binding_of_Isaac) using PUN+ as Network Library.

I followed all tutorials and now I have a problem with character movement synchronization.

My character movement is very simple: there's a PlayerController.cs script that every frame set character's rigidbody speed to

inputAxis * maxSpeed

Rigidbody2D has fixedAngle, 0 drag and 0 gravity applied.

Can you suggest a reliable method for character synchronization? I tried to follow this tutorial:

http://doc.exitgames.com/en/pun/current ... mp-and-run

but in that example the position interpolation is disabled and when you continuously change direction the result isn't smooth.

Is there a better way to resolve properly this problem?
I've tried to use Interpolation methods such as FixedSpeed, EstimateSpeed, Lerp, Synchronize Values. The best result I have obtained comes from Lerp method, but I'm not sure that this is the best solution.

Thanks for your attention.

Bye,
Andrea.

Comments

  • vadim
    Options
    Hi,

    For simple movements we suggest observation of transform or interpolating script by PhotonView as implemented in DemoSynchronization.
    You can change interpolation algorithms and position updates send rate to achieve best results.
  • erre
    Options
    Hi,

    thanks you very much!

    In order to understand well how it works, I have another question: my character moves with fixed velocity. I tried with Lerp method (as I wrote in the previous post), and the result was pretty good. When i tried to set "Interpolation Method" to "Fixed Speed" I saw that movement on client was absolutely not smooth. Why? If I use "Fixed Speed" with the same speed value of my character's movement, I should see a clean result...or not?

    Thanks a lot!

    Andrea