Wiki

Case Status
Log In

Wiki

 
Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWorker Game Manager…
Index
Navigation
Community Wiki

Photon DemoWorker Game Manager Fsm

Instanciate player if connected and also set message queue running to true.

This is a critical Fsm.

 This Fsm relies on the fact that every time the multi player environment context changed the scene reloads, AND it also relies on the fact that this Fsm will not exists unless we are in a room. It is responsible for instantiating the player, and properly enable network communication.

So when we START, we ask the question: Are we connected?, if we are, we enable message queueing and instantiate our player.

A very important feature TO NEVER FORGET turning on message queueing. If you don't turn that ON when you start the multi player environment, the network communication will fail and messages will not be distributed properly, and the scene will simply not working properly. It is equally important to turn that OFF when we reload the scene when we join a room ( in Menu : connection Fsm )

This example obviously is very simple and to the point, but the concept applied here is very important to grasp so that you can extrapolate on using this for a real projects, where you will need to instantiate ennemies and props. So it's not much of a "game" but really is the fundament for it.

NOTE:

It is important to grasp the concepts of instantiation over networks. When you instantiate an object over the network, the object it automatically created on all running instances that are in the same room, You do not need to manually create the same object in every running applications, this is done for you. The magic of network synchronization happens because of the PhotonView component attached to the instantiated objects, this  is the enabler for that instante to have a chance to behave identically on all running applications. 

Photon Actions used:

Tags:

Last modified on 5/18/2012 2:59 AM by User.

  • RSS Feed