Sync Players and puck position.

Hello,
I am working on Ice hockey game like,miniclip.com/games/hockey-stars-multiplayer/en/
My question is:
How to manage our players and opponent players position sync in mirror effect and how to manage puck hit and physics affect in both the players.

At this time,I am instantiate players and puck ,after assign photon view for sync position and rotation and use OnPhotonSerializeView method to sync position.Photonview owner is current player which have turn.and hit puck but not smooth position movement like refrence game.

Any help would be much appreciate. Thank you in advance

Comments

  • KekoraKekora
    edited October 2016
    hi :)
    You asked multiple questions but this may be what you are looking for to solve the smooth update issue, I was able to get smooth movement, instead of observing transform in the Photon View script, attach a NetworkPlayer script to the object then in the Inspector drag the NetworkPlayer script that is on the object to the Observed Components of the Photon View script.

    To create the network player script you can look at video 9 below which will replace your movement watching, somewhere in video 10 he will show how to lerp between the movements to smooth it out.

    https://www.youtube.com/watch?v=NHBsKcjiVwg vid9
    https://www.youtube.com/watch?v=re_13oxnlw4 vid10

    https://www.youtube.com/watch?v=lrk7GJUpKns vid1 if you are interested in the whole series

  • Thanks kekora...
    i have already watch those videos..
    Please see my reference game Hockey Star in mini clip..In the game,one Puck(Center object) hit one by one player and move its opposite direction in opponent and also apply collision properly to all objects like opponent players,puck in both side.

    In my game,current player hit the puck-everything is fine,movement and physics because puck ownership is in current player but in opponent player just puck move but real physics not apply.

    Thanks in advance
  • Hi,

    You could be better of with the masterClient doing all the physics simulation and all clients having simply to send input. Synchronizing Physics otherwise over the network is very tricky in your case.

    Also, you may want to start looking at TrueSync, it's improving by the day, it's still in beta and so it's not yet ready for production or else.

    http://blog.photonengine.com/2016/07/photon-news-july-16/

    Bye,

    Jean
  • Thanks Jean,
    I am already sync positions and rotation smoothly using master client.
    At this time my problem is master update position A to B to C,sometimes Client not moving A to B but directly move A to C. I am using interpolation for sync positions.
  • Hi,

    what do you mean by them letters? Player A, or Position A?

    Bye,

    Jean
  • Hi
    Position A to B.
  • Hi,

    yes, that should be expected, because the position isn't synched as a list of position, that other instances have to go through, it's trying to reach the current position, not trying to follow a path basically.

    Does that make sense? If you want pucks to follow the exact same path without skipping it, you'll need a waypoint system of some sort.


    Bye,

    Jean
Sign In or Register to comment.