playMaker

Author Topic: Photon Cloud workflow? [SOLVED]  (Read 3305 times)

cmy

  • Playmaker Newbie
  • *
  • Posts: 40
Photon Cloud workflow? [SOLVED]
« on: March 09, 2014, 05:06:01 AM »
This could be a question better suited for the Photon forums but I have an easier time understanding this stuff from a Playmaker perspective.

I've started networking my project recently. I originally started with Unity's functions via Playmaker with moderate success but before I got too far into that I decided to switch over to Photon as it will better suit my needs in the future.

I created a Photon account, everything is set up nicely, I've been able to create a room, join the room, instantiate my game objects all fine which also sync nicely as far as position/rotation (synced transform, not Vector3 variables)

My question is what exactly is the relationship between the Master Client and the other clients? For the life of me I can only get fsm variables to sync one way Master>Client, not vice versa. And yes, I have a Photon View observing the FSM. I even used the "Add Network Ready FSM" wizard to ensure it is setup properly.

The game I'm making is turn based with board game style mechanics. The players turn is decided by a sync'd Int variable. When the variable matches the players own value, their gui is activated allowing them to complete their actions. At the end of the turn, the INT get's added +1 and the next player is up. At the end of a full turn cycle, reset Int back to 1, rinse and repeat. There's a bit more going on but that's the basics of it, doesn't get much more simple.

I had this working perfectly using Unity's networking, the players were exchanging turns smoothly back and forth but for the life of me I can't sync the variables of the clients to the "master client", it's only a one way relationship. Clearly I am missing something about Photon.

Do I need to send RPC events to the master, have it update the variable which in turn syncs to the clients? Seems like a pointless extra step and this logic would give me fits through out the rest of the game.

Any insight would be appreciated.
« Last Edit: March 10, 2014, 10:27:19 PM by cmy »

cmy

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Photon Cloud workflow?
« Reply #1 on: March 09, 2014, 05:33:18 PM »
I'll add a bit more info onto this and if it goes nowhere I'll post over at exitgames.



In the image I'm running 3 clients, all connected to Photon Cloud. The game pieces all instantiate and sync perfectly, but I'm having a problem with everything else. It seems that only the clients which connected most recently have information from the other clients. 1 is oblivious, 2 doesn't acknowledge 3, and 3 is aware of everything. This make syncing variables impossible.

Edit: For clarity, the "Players in Game" should all read 3.

What am I doing wrong? I'm sure I'm missing a crucial piece of information.
« Last Edit: March 09, 2014, 05:42:47 PM by cmy »

cmy

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Photon Cloud workflow?
« Reply #2 on: March 10, 2014, 10:26:44 PM »
So after much grinding of teeth and pulling of hair I learned that Photon requires all syncing to go through the master client meaning that your project needs to be set up for RPC calls to the master client. It works very well and is pretty simple once you understand what needs to happen but you definitely have to plan your project ahead if you plan on using Photon for multiplayer.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Cloud workflow? [SOLVED]
« Reply #3 on: March 11, 2014, 06:43:38 AM »
Hi,

 Thanks for your insights, indeed Photon requires careful planning.

bye,

 Jean