Multiple PhotonTransformView's per Player - How to specify SerializationRate per View?

Hi,

I'm curently thinking about, how I can optimize the msg/s, as I'm already going over the limit.

My setup the following:
I'm creating a multiplayer race game. Each player has his car and the car has different child Gameobjects. For example the wheels.
So for each GameObject which can be moved or rotated, I added a PhotonTransformView. This works so far. But with 8 players (+ movable level objects), It is quite a lot of msg/s.
The following is my setup:

PhotonNetwork.SendRate = 20;
PhotonNetwork.SerializationRate = 10;

I would now like to update the not so important objects (wheels, car tiled, ...) just with a SerializationRate of 2 or 3 and the player position (as that one is important and everything else is just eye-candy) with maybe 12.


Any idea how to do it?
I already digged into the PhotonTransformView, PhotonTransformViewClassic and PhotonView. But I was not really sure where I should change this.

Regards
Knob

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Der_Knob,

    Thank you for choosing Photon!

    It's not possible to set serialization rate per PhotonView, it's a global setting.
    You can choose to switch to RPCs, RaiseEvent or even room/actor properties for less frequent updates.
  • Hi JohnTube,

    thanks for that answer.
    I took the last hours to think about my issue and found possible ways to improve (not yet tested). Please correct me if I'm wrong :)

    If I set a PhotonView to send updates on change, it will only send anything if the values of the TransformView changes. But that applies for ALL TransformViews attached to that PhotonView and if one changes - all are send. Is that right?

    If yes, I'm thinking about to split one player into 2 PhotonViews.
    One for the position and rotation of the player - continously updated.
    And a second one for the wheel steering rotation and co. Here we have much less change. So for example if the player drives to the right, the weels will turn to right and stay there, until the player changes the steering.

    Also I will remove the sync of the wheel rotation. This can be easily calculated on every client and is just a visual thing.

    Does that make sense?