playMaker

Author Topic: Photon Integration Beta [NEW beta3]  (Read 72472 times)

Swift_Illusion

  • Playmaker Newbie
  • *
  • Posts: 41
    • Midnight Tinkering
Re: Photon Integration Beta
« Reply #15 on: April 25, 2012, 12:52:25 AM »
Have been working on recreating the demo to try and get a grip on it and I was just wandering,
I'd imagine this is made for games designed to be played in rooms. Will there be a demo in the
future at all that would guide you towards how to create an authoritative server-something designed for MMO's?
I know it's possible with photon, I was just wandering if that's something we might be able to gain a small
demo to display the basics-or whether it's something we will have to design ourselves?
Obviously it's not expected for there to be a demo of everything possible, but it would be nice if alongside this
demo that's designed for more room-multiplayer designs, for there to also be an example of how to create a
server designed for MMO's.

Swift_Illusion

  • Playmaker Newbie
  • *
  • Posts: 41
    • Midnight Tinkering
Re: Photon Integration Beta
« Reply #16 on: May 04, 2012, 12:27:04 AM »
Well not to be a pest, but it's been awhile now, any idea when you will get the revised beta up?
You wrote you submitted it for review, but regrettably nothing has come of it yet and it would be nice
to start playing around with it more and being able to recognize what is caused by that bug and what
is caused by badly setup functions.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Photon Integration Beta
« Reply #17 on: May 04, 2012, 11:21:18 PM »
Sorry, I've been busy with the 1.3.3 update. But now that's out I'll get the next Photon beta up...

Swift_Illusion

  • Playmaker Newbie
  • *
  • Posts: 41
    • Midnight Tinkering
Re: Photon Integration Beta
« Reply #18 on: May 05, 2012, 01:04:39 AM »
Oh really sorry, didn't realize these were being worked on separately like this.
Great job on the playmaker release (really like that the samples are separate now too), and I'll continue waiting and looking forward to the photon beta update when you get to it, keep up the good work :).
« Last Edit: May 05, 2012, 05:40:40 AM by Swift_Illusion »

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Photon Integration Beta
« Reply #19 on: May 07, 2012, 01:13:56 PM »
If anyone out there is familiar with photon and unity networking, i think everyone would be very thankful if they could put together a tutorial for a basic networking setup.  But with an explanation of why things get setup the way they are, instead of simply saying, connect A to B.

Perhaps with a real life game example
eg: how to get the walk animation playing on both players screen, and how to spawn and create a grenade or bullet or something so that it shows up on both players screens in sync.

here's hoping :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Integration Beta
« Reply #20 on: May 08, 2012, 01:06:24 AM »
Hi,

The demo shipped with the beta integration of Photon networking does this, the corresponding documentation is under way and will explain each Fsm and how they work together as well as the general frame of mind fo adopt when building multi players scenes.

 Just to highlight the basic here:

 Playmaker expose a "network sync" option for variables, simply select the variables you want to have synced over the network and add a network view or photon view component observing the Fsm component declaring at least one network synched variable, and you have your connect A to B partly solved. Within your Fsm you will need to know if you "own" this fsm component or not, to check simply use the "networkView Get Is Mine" or "Photon View Get Is mine" action, and if you own it you can set its value and if you don't you simply read it. this is the typical basic approach.

to spawn a network GameObject, it also need to have a network view or photon view component attached and use "Network instantiate" or "Photon Network Instantiate" to create bullets or players etc etc, as you use this in one of your running instance, all other connected instances will spawn that gameObject and get synched against it ( this is the "owner" thing).

I strongly recommend you use Photon network system, there cloud networking is just a no brainer and works amazingly well. The concepts you'll learn with Unity networking or Photon networking are similar anyway, so you can read documentation and tutorials on both solution without problem.

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Integration Beta
« Reply #21 on: May 08, 2012, 04:00:59 AM »
Hi,

 As a started, the documentation is under way:

https://hutonggames.fogbugz.com/default.asp?W852

Bye,

 Jean

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Photon Integration Beta [NEW beta2]
« Reply #22 on: May 08, 2012, 10:51:13 AM »
I've uploaded the latest beta:
http://www.hutonggames.com/playMakerBeta/PlayMakerPhotonDemo_beta2.unitypackage

NOTE: Do not import this demo into an existing project since it can overwrite your assets!

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Photon Integration Beta [NEW beta2]
« Reply #23 on: May 08, 2012, 11:47:50 PM »
Sorry a bit off topic here jean, but i tried out the non photon networking example and tried to expand upon it, by adding a new state after the move state, to chance the cubes material color for example. It will would switch locally but not on the remote instance of the game.

I thought by observing the playercube prefab that it would do the same on the remote prefab as well.  and that any states/actions would propagate as well.

Is there a piece of the puzzle im missing?


Swift_Illusion

  • Playmaker Newbie
  • *
  • Posts: 41
    • Midnight Tinkering
Re: Photon Integration Beta [NEW beta2]
« Reply #24 on: May 09, 2012, 12:34:02 AM »
Just ran the latest demo.
You guys, rock!
My mind = blown :D
The synch accuracy was by all accounts absolutely perfect. Sure it was a bit slow but this is a local test on my PC and it was hardly anything noteworthy, the actual final positioning and how it tries to keep up with the latest state that the character is in with 3 characters in the scene was amazing :D!

This is truly amazing! I am so happy right now it just can't be expressed :D!
Just hope I'm able to workout how to customize this into a more controlling setup for an MMORPG environment
instead of this room setup, but wow when I saw the accuracy of synch it's just like :O I didn't see that in commercial MMO's I've played. Great job :)! Hope you guys keep moving forward with this cause it's already amazing, I'm so darn impressed, keep up the good work!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Integration Beta [NEW beta2]
« Reply #25 on: May 09, 2012, 01:43:34 AM »
Hi,

 @Swift_Illusion: We tried to port the demoWorker shipped with the Photon as much as possible in playmaker, and we're glad that it works just as well indeed! It's also allow playmaker to shine and demonstrate how flexible and powerful Fsm's are.

@justifun:
not off topic, unity and photon networking are similar, Photon did a great job making sure the vocabulary and concepts are inlines, while adding this cloud server that simply make it all work like charm...

So, to answer your question: If you observe a cube transform, you will effectivly synch the transform, it will not synch everything that make up this gameObject ( mesh, material, components, fsm states and actions etc etc), for this you will need to observe the Fsm component hosting the color variable and make sure you have ticked "network sync" on that color variable, then you need to learn about the "ownership" concepts of a network view.

This may sound as a cumbersome way of dealing with this, but this is a way to optimize network usage, by only passing the information that really changes.

When you observe something with a networkView component, one of the instance running within the network as to be the owner. For this use the following action:

https://hutonggames.fogbugz.com/default.asp?W803

If the network view "is Mine" it means this is the owner and you ought to set the color variable, other instances running on the network will return false to the test, because they are slaved to the owner, and they ought to read, and react to the variable change. That is they should set the material color to reflect the new color, but only the owner is setting the Color variable and slaves simply need to read it.

Having said this, you need to be very careful with synching:

If the variable you want to synch changes all the time, I mean really all the time, like a player movements, or a bullet position, then it's perfectly acceptable to read and write every frame to maintain maximum accuracy within the game.

 IF the variable only changes from time to time, you should not use synching much, because this takes bandwidth and will slow down the game synchronization. Instead use the "sendRemoteEvent" action
https://hutonggames.fogbugz.com/default.asp?W805

This effectively send an event across the network, and it means that you don't take up bandwidth at all. So if you want to change the color only when the user is customizing his character, this is perfect, use remove Events, if the color changes as part of the game dynamics and frequently, then you can use variable synch.

 Hope that makes more sense now.

 Bye,

 Jean

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Photon Integration Beta [NEW beta2]
« Reply #26 on: May 09, 2012, 10:33:04 AM »
Thanks for the explanation jean.

So if i understand correctly.  Player 1 (The player controlling the cube - or the server lets say) would switch to a state that changes a color variable, and updates the color of its own material, but then would send a "send remote action" that would trigger a global event on all other players such as "read the color of all other  players and update those remote players"?  That way it would only update when it happens instead of every frame.

So that on player 2's screen, play one would see his new color?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Integration Beta [NEW beta2]
« Reply #27 on: May 09, 2012, 11:30:27 AM »
Hi,

 Yes, and when you send a remote event, make sure you select "OTHERS", so that the owner doesn't receive this event, no need.

 
Bye,

 Jean

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Photon Integration Beta [NEW beta2]
« Reply #28 on: May 09, 2012, 12:32:17 PM »
Cool Thanks Jean! ill try it out tonight!

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Photon Integration Beta [NEW beta2]
« Reply #29 on: May 18, 2012, 04:28:32 PM »
I tried out the photon playmaker demo scene this morning and ran into one slight problem.

The syncing between the two instances got a bit messy.  Each construction working on the other's screen was spinning or hiccuping every frame, and it seemed as if the person controlling the player would control both instances, but not 100% the same.  The other player's translation would be affected, but not as much as their own player.