playMaker

Author Topic: How to restore FSM state?  (Read 1128 times)

adbourdages

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
How to restore FSM state?
« on: April 19, 2015, 02:18:19 PM »
Hello,

I'm evaluating PlayMaker for implementing scriptable objects inside a game, where each object would have its state/logic based on a FSM. Something I've been looking all over the docs and forum for however is how to save/restore the state of an FSM?

For instance, let's say there is a light with an FSM attached. It has 3 states:
- off
- animate-on (animate the alpha over 1s)
- on

If I restore the scene state from a save game, how can I set the proper state on this FSM? Further, if the state was animate-on, can the time left to animate be restored as well?

Thanks,
Alain-Daniel

adbourdages

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to restore FSM state?
« Reply #1 on: April 21, 2015, 08:49:47 AM »
Hello,

I'm still looking into this and I'm very puzzled. There are tons of games using Playmaker, how do they create a save point and restore to it?

In our previous framework, we can tell the Fsm to go to a specific state so that can be serialized. In addition, the internal variables of each action can also be accessed and serialized (like a Wait action that would have 0.25s left out of a 1s timer). I just can't find any utilities for that here.

I'll use a simple example: I make a blinking light using playmaker. When I save the game state, the light is either in On or Off state and there is X seconds left on the Wait action to switch to the other state. How do I restore to that?

I have to be missing something here.

Cheers,
Alain-Daniel

haikugames

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: How to restore FSM state?
« Reply #2 on: June 18, 2015, 04:03:40 PM »
I wanted to follow up and ask if you you ever figured this out? We use Playmaker for our game and we do not have constant saving for this reason.  We just save what scene the player has advanced to, but this is obviously not ideal.

emanuel

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: How to restore FSM state?
« Reply #3 on: August 22, 2016, 01:51:46 AM »
Implementation of large finite-state machines (FSMs) as smaller interacting machines, by factorizing them and interconnecting the factored and factoring FSM's in such a way so as to maintain the functionality of the original machine usually leads to an improvement in the performance of the original machine. Feel free to stuf Custom essay writing service for essay paper.