playMaker

Author Topic: Photon sync FSM variable optimization  (Read 3094 times)

whendricso

  • Playmaker Newbie
  • *
  • Posts: 3
Photon sync FSM variable optimization
« on: March 11, 2013, 04:31:19 PM »
Hello  :)

I have set up a multiplayer game with PlayMaker/Photon and as I am prototyping inventory solutions, I am starting to think about optimization.

Most importantly, I need to know how the variable sync functionality works, as far as how much bandwidth it will use. Ideally we could have 30+ players in a room, but if a string or int is sent over Photon every frame (for 2-3 weapons per player), people are going to start losing their connection.

But, if it is optimized and only sends values when something changes, I could work with that.

So, does anyone know if variable sync is optimized in this way?
« Last Edit: March 12, 2013, 04:45:22 PM by whendricso »

whendricso

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Photon sync FSM
« Reply #1 on: March 12, 2013, 04:44:59 PM »
No answers after a day?

Is my question clear? I need to know how often messages are sent over the network when using Photon synchronized variables.

If anyone knows, it would be a great help  :)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Photon sync FSM variable optimization
« Reply #2 on: March 13, 2013, 11:03:00 PM »
Jean Fabre worked on the Photon integration with Tobias at Exit Games, so you could try asking about the internals on the Exit Games forum:
http://forum.exitgames.com/viewforum.php?f=17

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon sync FSM variable optimization
« Reply #3 on: March 15, 2013, 09:13:22 AM »
Hi,

 I have been away for several days, my apologies :)

Synching variables for an inventory seems the wrong way to approach this indeed.

 When values are changing some time, but NOT "always", do not use synched variables IF you are concerned about performances.

Instead prefer RPC, which is basically a discrete call. This way you will never have any issues with performances.

synched variables are using a "stream" of data, this is totally different than sending a message, so it's important that you learn the difference between RPC and data streaming ( which is used by synched variables inside playmaker)

 Only use synched variables when the values is know to be always changing, or example and typically player position, rotation. Also, within that, prefer using ints and floats rather than string, string will kill your bandwidth.

Bye,

 Jean


bye,

 Jean