playMaker

Author Topic: Global Game State FSM  (Read 1275 times)

jasonmirk

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Global Game State FSM
« on: April 07, 2014, 04:26:18 PM »
Hi,
I have been using playmaker for a while and was wondering if it should be used for game scope states. I don't see examples of people using it for this just for FSM attached to objects to perform simple things. I was wondering if it would be good for a game scope FSM that would survive load levels and would load menus, play states, win states, lost states etc.

thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15370
  • Official Playmaker Support
    • View Profile
Re: Global Game State FSM
« Reply #1 on: April 08, 2014, 04:50:57 AM »
Hi,

 Of course. I do that ALL the time :) It's actually a very important pattern to master to get anywhere in large projects.

 I even use xml as the data back end, so in your typically cut the rope game, all the user data, progress, score etc etc is stored in an xml in the app resources. and access at runtime when needed. and I write back to the xml when the user data has changed ( new score, new progress, new unlocks etc etc).

and that is ALL done via gameobject that persists throughout level loading and the user navigation.

the main reason is to prevent redundant data access, once you have your user data, it's not cool to get it again ang again on each level load isn't it...

the second very important reason is that you can better edit and work on your games and levels, coupled with "singleton" approach, you can have a prefab sitting on EACH level, but at runtime, only one will be there at any time and on each level load, redundant prefabs are destroyed.


bye,

 Jean

jasonmirk

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Global Game State FSM
« Reply #2 on: April 09, 2014, 03:11:39 PM »
Thanks Jean. Will look further into this. Was afraid that people didn't use it for performance issues or something like that.