playMaker

Author Topic: Turn Based Multiplayer, Photon, Offline Mode....  (Read 13272 times)

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Turn Based Multiplayer, Photon, Offline Mode....
« on: April 01, 2014, 06:24:53 AM »
Hi,
I am considering to do some kind of match 3 game in multiplayer, where 2 players would play one after another.
Would that be hard to do ? I have almost finished the basic match 3 engine but I have no idea where to start with networking.
For example is possible to share an arraymaker list array accross the network ?

I have unity free, and I'd like to publish to desktop + ios + android.
Please share some tracks to follow.
Thank you,
Yaniv
« Last Edit: April 16, 2014, 04:04:44 AM by Yanifska »
Visit my portfolio: http://www.yanivcahoua.com/

Derphouse

  • Playmaker Newbie
  • *
  • Posts: 17
Re: How to start networking ?
« Reply #1 on: April 02, 2014, 06:12:30 AM »
If you don't have experience with networking in Unity, I'd suggest you read about it on the Unity site.

I think the easiest approach is to look at some of the guides with Photon Networking for Photon Cloud. You can find a lot of resources on their own site: Exitgames.com, as well as here on Playmaker forums there's a lot on Photon as well.

Honestly, if you don't make sure you have a good foundation of what you're getting into, you'll end up in a world of pain :D

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #2 on: April 02, 2014, 06:46:49 AM »
Thanks, I have been reading through Unity's documentation and plamaker's manual yesterday, and I start to get a general idea of the process.

I still don't get how I can share a table between to player/devices, maybe by using easy save2 ?

Also is Photon much easier than standard unity network features ?
I believe what I have to do is quite easy, but yet it is hard when yo just begin... hehe.

Yaniv
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to start networking ?
« Reply #3 on: April 02, 2014, 07:07:19 AM »
Hi,

 Photon networking will be a bit overwhelming for this, as what you want is a turned based system ,which doesn't imply real time data synchronization, only "state" synchronization.

https://www.exitgames.com/en/Turnbased

Signup for an early access, it's likely exactly what you are looking for.

Now, if you want to use Photon as is, then I would simply use RPC calls, but that's only solving one aspect, indeed you need to save the game state for async play, which can be done with any server side system ( Parse or your own php/mysql server)

Bye,

 Jean

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #4 on: April 02, 2014, 07:23:56 AM »
Hi Jean,

Does the Playmakers actions will work with photon turn based ?
Does Photon works with arraymaker / How to sync array lists between devices?

Thank you Yaniv
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to start networking ?
« Reply #5 on: April 02, 2014, 07:27:07 AM »
Hi,

 I really would like to support Photon Turn based indeed. It's currently not planned tho.

ArrayMaker does not support syncing between devices no. that's way too big and potentially a show stopper, synching shoudl always be very very granular, so instead implement the necessary variables to synch within an fsm, that's much more likely to perform as expected as your project grows.


Bye,

 Jean

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #6 on: April 02, 2014, 08:38:34 AM »
ok thanks
can easy save2 or xml maker helps me here to save the state of my arrays ?
would that be an option?
Yaniv
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to start networking ?
« Reply #7 on: April 03, 2014, 01:06:55 AM »
Hi,

 Indeed, it's one way out for sure.

bye,

 Jean

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #8 on: April 05, 2014, 03:18:17 PM »
So I have been playing with photon these last 3 days and I am to the point where I successfuly instantiate my chip array on both client.
What worries me now, is that when I try to play previous scenes, that doesn't involve photon I get the following error message :

Working with photon network require that you add a 'PlayMaker Photon Proxy' component to the gameObject. You can do so from the menu 'PlayMaker Photon/components/Add photon proxy to scene'.

The Create Object action seems to be the troublemaker. I double checked I wasnt trying to instantiate photon related prefabs.

Do you have an idea why that would happend, and how to have both single player and multiplayer scenes cohabit in a same project.
Thanks,
Yaniv
« Last Edit: April 05, 2014, 03:22:56 PM by Yanifska »
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to start networking ?
« Reply #9 on: April 07, 2014, 06:55:18 AM »
Hi,

 Interesting. Photon has an offline mode so that it's compatible. I haven't investigate that aspect. I will do this week. Please bump me towards the end of the week if I haven't replied before.

bye,

 Jean

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #10 on: April 10, 2014, 03:40:39 PM »
Hi Jean,

When I instance (multiple) object(s) across the Photon Network, how can I store the newly instanced GameObject in a variable on the other player side as well (so I can add it to an array on the second player side as well ) ?


Btw did you find a solution to have offline mode ?
Thanks for your help
Yaniv
 
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to start networking ?
« Reply #11 on: April 11, 2014, 02:17:13 PM »
Hi,

 You are missing a key concept with your question:

 the object you create on one side, is the SAME prefab as the one that is instantiated on other running instances.

So, you can have an Fsm on that prefab that when starting, ask the question "is mine", using the action of the same name, and if false, then you know you need to add yourself to an arraylist.

 Do you understand the concept of ownership within a networking system? the "PhotonViewGetIsMine" action is critical to understand here. Have you studied the sample provided to see how Photon is integrated in PLayMaker?

I haven't had a look yet at offline mode, but it's on my shortlist, so coming very very soon.

bye,

 Jean

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #12 on: April 12, 2014, 03:24:53 AM »
I did look at the demo, and I understand the IsMine action , but somehow I didn't see how it would apply to my project because my objects can be instantiated at different moment and has to be treated differently each time, but I guess I can pass a string to help trigger a different set of actions on the object.

I think I have an idea how to work it out now.
Thanks for your help
Yaniv
Visit my portfolio: http://www.yanivcahoua.com/

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: How to start networking ?
« Reply #13 on: April 16, 2014, 04:03:43 AM »
The offline mode is discussed in this topic.

http://forum.exitgames.com/viewtopic.php?f=17&t=2486

I believe we just need an action to set the offline mode to true, don't we ?
Yaniv
Visit my portfolio: http://www.yanivcahoua.com/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Turn Based Multiplayer, Photon, Offline Mode....
« Reply #14 on: April 17, 2014, 02:29:55 PM »
Hi,

 if that's just it... then simply use "set property" action and you are done.

bye,

 Jean