playMaker

Author Topic: Photon server tutorial  (Read 26665 times)

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Photon server tutorial
« on: January 25, 2013, 07:56:55 PM »
Hi everyone.

I have been trying to figure out how to get photonserver working in playmaker. I know it's doable because i saw the thread on here and downloaded the package. Unfortunately I just cant figure out what to do once I've gone through the wizard and everything is green. I click play and nothing shows up. Are there any walk throughs or tutorials out there that can help me?

all the best

will

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon server tutorial
« Reply #1 on: January 28, 2013, 01:12:14 AM »
Hi,

What scene are you playing?

 the best approach right now is to try to play the photon scene itself, not the playmaker one, then you'll know if this is a problem with playmaker or else.


bye,

 Jean

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Re: Photon server tutorial
« Reply #2 on: February 01, 2013, 02:24:34 PM »
Hi Jean,

thanks for replying.

I've got photon working now and I must say its much easier with playmaker than without.

I would still love to see some form of networking tutorial with playmaker though, similar to those on the playmaker site.

Cheers

WB

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon server tutorial
« Reply #3 on: February 02, 2013, 03:38:24 PM »
Hi,

 Yes, that would be great indeed.

the best I recommand right now, is to start small. Don't start with what you want to achieve ideally. Start with a basic cube, make it rotate simply, and have it working via the photon system. Once you will pick up the way it's working, how to create and manage rooms, and deals with network views, then you can tackle your real purpose.

 I have made extensive documentation on the demo, have you had a look? if yes, maybe you have suggestions as to where to improve or add more details.

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


bye,

 Jean

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Re: Photon server tutorial
« Reply #4 on: February 02, 2013, 03:47:41 PM »
Hello Jean,

I have read your document and it's great, obviously a huge amount of work has gone into this. The only thing i have trouble with is there is so much information that I instantly felt overwhelmed. Using the document and the demo I have now built my own Chat room similar to the demo but without the demo worker and much simpler. Currently working on the GUI.

The next part Im trying to figure out is how to send items to other players so that it appears on their screen but not the player that sent it.

Thank you for your help

WB

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon server tutorial
« Reply #5 on: February 08, 2013, 02:24:36 AM »
Hi,

 Indeed, it's a stuggle to give a consise explanation of photon, playmaker and the concepts in generals. So you need to really keep up and study it over and over again, reading as much as you can from various sources until it starts to mentaly make sense, and YES, doing your own version and implementations is the best way to gain experience, so this is good you are getting down with making your own simple tests.

items/players is the same really, it's a gameObject you instantiate over the network. So if your player is for example creating a sphere, the sphere gameObject must obey the same rules as the player prefab, that is it has to have a photonView component at the very least so that all players see that sphere.

then if the sphere has to implement features, add a fsm to it and start adding feature using the same patterns as the player prefab ( that is if it has to behave in certain way, only the "is mine" version of the sphere should implement actions, and all the "is not mine" sphere should simply catch up with it.

Does that make sense? the player prefab is nothing special in it implementation over the network, it can be anything really.

bye,

 Jean

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #6 on: June 04, 2013, 03:19:57 AM »
You guys make great tutorials... you should just put a few of them together to help us quickly figure out the Photon stuff.  So much can be done in video that a pdf just can't.

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #7 on: June 07, 2013, 01:19:58 PM »
Is there a trick to getting the DemoWorker scene to work?

I get the following error when opening the scene.

Assets/Scripts/GameManager.cs(13,14): error CS0101: The namespace `global::' already contains a definition for `GameManager'

and

Assets/Scripts/ThirdPersonCamera.cs(4,14): error CS0101: The namespace `global::' already contains a definition for `ThirdPersonCamera'

And there doesn't seem to be any FSMs attached to any of the objects in the demoworker scene.  I'm certain I'm missing some step.


Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #8 on: June 07, 2013, 03:43:08 PM »
Okay... I must be doing something wrong.  I've got the Demoworker scene to work and am connected, running around with multiple people.  But all that is being done with the scene that comes with Demoworker.

So I want to use Playmaker to do all this same stuff.  So I import the Playmaker package and without even touching anything, I'm getting errors thrown.  Is there some step I'm missing that is suppose to clear these errors?

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #9 on: June 07, 2013, 04:07:44 PM »
Seems to me it would have made it a lot more simple if the Playmaker version of the Demoworker was available for download somewhere.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon server tutorial
« Reply #10 on: June 07, 2013, 05:25:39 PM »
Hi,

PlayMaker package doesn't come with the demos. So I guess you are importing the photon package from the asset store right?

PlayMaker is shipping Photon, so you don't need to actually import Photon separatly.

 Is it the case? else can you describe what package you are importing?

I personnaly as a rule of thumb never mix my projects with demos, because they take more resources, so it's always a good idea to have special projects ti run just the demos. in them projects, you then delete any duplicated scripts in your case "GameManager" and "ThirdPersonCamera" which are used by the photon demos, but clash with unity own standard scripts and maybe another package in the case of "GameManager" which is a common name.


 Bye,

 Jean
 

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #11 on: June 07, 2013, 06:02:11 PM »
Okay... I've almost got this thing working but it's been a complete pain.  Looked at the start like it was going to be simple.

I'm now connecting through the Playmaker FSMs to the Photon cloud.  I can even instantiate but I'm getting errors with the chat FSM.  Here are my errors:

Could Not Create Action: Chat: chat: adds it to the current text: StringAddNewLine (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)
PlayMakerFSM:Init()
PlayMakerFSM:Awake()

and

Could Not Create Action: Chat: chat: trim: StringDeleteLine (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)
PlayMakerFSM:Init()
PlayMakerFSM:Awake()


and


Could Not Create Action: Chat: chat: is number of line maxed out: StringGetLineCount (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)
PlayMakerFSM:Init()
PlayMakerFSM:Awake()



Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #12 on: June 07, 2013, 10:47:20 PM »
I can see that somehow the Chat script has been completely erased.  Not sure how to get it back or where it goes.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon server tutorial
« Reply #13 on: June 08, 2013, 12:06:45 AM »
Hi,

I am not making sense of this, it seems that you are missing scripts here and there...

 Can you confirm you have done the following:

1: create a new project
2: import playmaker from the asset store
3: went to the sample download page: http://www.hutonggames.com/samples.php ( available from the welcome window of playmaker
4: downloaded the photon demos and installed it

what do you get then?

bye,

 Jean

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Photon server tutorial
« Reply #14 on: June 08, 2013, 11:56:10 AM »
Okay, I did a clean reinstall of Unity just to be sure I wasn't screwing something up somewhere.

I followed each step in your instructions and I fire up the playmakerTestGame scene and this is the error I get.


Assets/Photon Unity Networking/PlayMaker/Actions/PhotonViewGetID.cs(49,56): error CS1061: Type `int' does not contain a definition for `ID' and no extension method `ID' of type `int' could be found (are you missing a using directive or an assembly reference?)

What am I doing wrong?