playMaker

Author Topic: Playmaker networking workflow?  (Read 7077 times)

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Playmaker networking workflow?
« on: February 16, 2012, 02:01:43 AM »
I am wondering if anyone could give me insight as to recommended workflow for use with a networking system like Photon.  I'm looking to run a non-authoritative server.

My idea is that I'll have game scripts like 'PlayerNetworkController', 'RemoteNetworkController', and 'AINetworkController'.  In my character factory I'll pass a parameter that determines what kind of controller is attached to the character object.

But, then I need to get into some c# to actually code up the way the networking is handled.  

Does anyone have any insight as to how to think about implementing networking while using playMaker for behavior?  I'd like to use playMaker for absolutely as much as I can since I feel it provides an optimal experience for a single-developer project.

I have no problem coding custom actions or putting in my dues in any capacity.  I'm just hoping for some perspective from someone who has experience so that hopefully I'll save multiple development / refactor iterations.
« Last Edit: February 16, 2012, 02:06:02 AM by ShawnMcCool »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14055
  • Official Playmaker Support
    • View Profile
Re: Playmaker networking workflow?
« Reply #1 on: February 16, 2012, 10:31:19 AM »
Hi,

 If you can wait few days, Photon network will be supported via an separate addon to playmaker. I am currently porting the demo from photon fully in Playmaker, I am left with rpc handling and chat, but the rest is already totally playmaker driven ( connections, player management, instanciation, rooms management, etc).

 I went for a proxy approach ( a prefab with a pre made fsm, very much like PlayMakerGUI), where all messages coming from photon, are then broadcasted as global events. For rpc, it is a bit more tricky, but feasible, basically, having a rpc method with a fixed signature that will then inject the values into the right fsmvariable using the playmaker api.

 So stay tuned, it's coming up!

Bye,

 Jean

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Playmaker networking workflow?
« Reply #2 on: February 16, 2012, 11:13:53 AM »
That's exciting news.  I think that the proxy approach makes sense.  Thanks for your work.  Like I said, I am not afraid of C#.  But, having as much of the system in FSMs is --to me-- part of a more ideal workflow. 

I'm eager to get the perspectives of experienced users so that I can avoid a few pitfalls.

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
Re: Playmaker networking workflow?
« Reply #3 on: February 16, 2012, 07:20:21 PM »
Oh my god.  Are you serious? 

Can you clarify this for me - - You're giving PlayMaker users the ability to script a networked environment?  What kind of limitations are there?  Can I seriously toss together a simple game that supports multiple players across the net?  What kind of server setup is required?

Jesus you just blew my effin' mind.  That's like winning the lottery for me, seriously.  Actually, I would take that ability over winning the lottery.  That's just so enabling for future projects.  Jeebus I could seriously kiss you.  Fuuuuuuu.....





Hi,

 If you can wait few days, Photon network will be supported via an separate addon to playmaker. I am currently porting the demo from photon fully in Playmaker, I am left with rpc handling and chat, but the rest is already totally playmaker driven ( connections, player management, instanciation, rooms management, etc).

 I went for a proxy approach ( a prefab with a pre made fsm, very much like PlayMakerGUI), where all messages coming from photon, are then broadcasted as global events. For rpc, it is a bit more tricky, but feasible, basically, having a rpc method with a fixed signature that will then inject the values into the right fsmvariable using the playmaker api.

 So stay tuned, it's coming up!

Bye,

 Jean

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Playmaker networking workflow?
« Reply #4 on: February 17, 2012, 01:03:30 AM »
To be fair, I'm sure that you can still expect to have to understand exactly how the networking is functioning and to be doing a fair amount of coding specifically around your networking model.  After all of my research it's become apparent that there is no single plug-in and go solution to networking. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14055
  • Official Playmaker Support
    • View Profile
Re: Playmaker networking workflow?
« Reply #5 on: February 17, 2012, 03:44:55 AM »
Hi,

Well, Playmaker will ease at least several aspect of network integration: rpc, data synching and serialization over the network. You'll only need to check a fsm variable to be synched, add a networkview and observed the fsm component with that fsm variable to synch... and done! that is definitly a major improvement over implement OnSerializeNetworkView

same with events (rpc). It's still under construction for a built behavior ( but I made a script proxy that works just fine, nothing but an action within playmaker for users to use events across networks). Basically, you will have simple actions to broadcast an event across the nework, no rpc implementation needed there too. Major improvement here as well.

 Then, you are left with the actual connection workflow. Playmaker will also help here somehow, because you simply need to reuse the fsm responsible for connection and you will have a very good base to expand on your specific needs.

Also: Photon integration that is currently undergoing for playmaker will certainly prove you wrong :) With its cloud based network system, it's just incredibly simple and powerful! mind blowingly easy...

Networking is nonetheless an advanced process, and it's true that it requires at least reading the documentation at least once. I never do it... and for learning networking... I actually had too :)

 Bye,

 Jean


artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
Re: Playmaker networking workflow?
« Reply #6 on: February 17, 2012, 05:15:53 AM »
It still excites me and will probably be the next thing I play with.  :)

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Playmaker networking workflow?
« Reply #7 on: February 21, 2012, 10:50:24 AM »
stuff


Is there an ETA on the release?  Could I become a beta tester somehow?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3576
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Playmaker networking workflow?
« Reply #8 on: February 21, 2012, 11:05:00 AM »
You can play with Unity networking in 1.3.2 now! There are a few samples to get you started.

Network RPC commands will be out soon.

The Photon integration is coming along nicely. Not sure if we'll do a beta for that, or just release it...

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Playmaker networking workflow?
« Reply #9 on: February 21, 2012, 11:41:56 AM »
You can play with Unity networking in 1.3.2 now! There are a few samples to get you started.

Great news.  Well, if you ever need a beta tester for features that I am going to be using then let me know.  I'm an active developer, experienced with game dev concepts, and becoming increasingly familiar with Unity3D and playMaker.

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Playmaker networking workflow?
« Reply #10 on: February 22, 2012, 05:28:01 AM »
Network RPC commands will be out soon.

I am very excited about the consistent progress of playMaker development.  Cheers to your team for improving what is already a very polished feeling product.

I would love to see updated documentation for the network actions.  I sat down to read through it all today to find that it was empty.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14055
  • Official Playmaker Support
    • View Profile
Re: Playmaker networking workflow?
« Reply #11 on: February 22, 2012, 05:42:50 AM »
Hi,

Yes, this needs doing indeed.

 I assumed you have read the Unity documentation about networking right? this is your first and major source of info for networking

then the playmaker set is really a port of all the api into actions, with some goodies and convenient features here and there.

 the main thing is the ability to sync data across the network without implementing ANYTHING from your part, simply tick the "Network sync" on variables, attached a network view on that gameObject and observe the fsm with that variable you want to sync, and done. no need to implement data stream serialization.

Rpc is still a work in progress to be implemented as a built in feature ( if I am correct). tho if you desperatly need a rpc system working, I can give you a proxy I built when I started on this, that basically allow you to send and Fsmevent across the network.

apart from that, the connection, and management of the network system is really identical to how Unity handles it with scripts. Of course all the yielding and message handling is different, you only need to implement global events with system.network fsm events.

Have you played with the scene provided? If there is one aspect in particular you are struggling with, don't hesitate to ask on the forum and we will help.

Bye,

 Jean

ShawnMcCool

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Playmaker networking workflow?
« Reply #12 on: February 22, 2012, 05:51:38 AM »
I have played with all of the sample scenes and found them very helpful.  By doing so, I actually learned a bit more about formatting my FSMs as well.

My game is completely turn-based.  At this point I'm trying to decide on how I'm going to handle the networking.  I have 4-5 characters on each team, one team is local and one remote.  I expected to have a networking manager running on each side with RPCs bouncing back and forth to update the states.  Think networked chess with special moves. 

When I think of state-synchronization I get an image of characters moving around in a 3D world.  However, I'm starting to think that I could potentially synchronize the state of an FSM and manage the game that way.  I'm reading books and looking up code examples.  I'm still very much in a discovery period since networking is the aspect of game development that I have no previous experience with. 

Do you have any high-level recommendations for approaches?  By no means do I intend to query you until you've coded my game for me.  I'm just looking for your opinion on the most elegant solution.  Elegance is everything to me.