playMaker

Author Topic: Saving FSM  (Read 1644 times)

aare

  • Playmaker Newbie
  • *
  • Posts: 5
Saving FSM
« on: June 20, 2020, 01:40:05 PM »
Hi guys,
Is there a way to serialise, save and then load FSM?

I'm implementing a game where persistent state machine is needed.
Is there a solution for that?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Saving FSM
« Reply #1 on: June 20, 2020, 01:49:11 PM »
Hi.
I don't think there is something 'out of the box' for this.

But you can get the current state and there is also an action to set to a certain state on the Ecosystem
I believe its call 'Go To State By Name'

Then if you need to all the variables, you will probably need save and load them as well (before going to that state)

Also you start states should be empty and have a transition triggered after everything is loaded.

it can become pretty complex.

maybe give some more info on your game, as maybe you need to save/load only certain parts.
then maybe you could use arrays or hash tables.

aare

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Saving FSM
« Reply #2 on: June 20, 2020, 02:04:54 PM »
Yeah, that's what I figured out.
A shame I can only get the current action ID but can't set it.
Serialising / deserialising playmaker variables also looks like a hassle, but since I already store player state in my own classes I guess I would be writing my ownd actions to accese these anyway...

It's just a shame there is no out of the box solution for serialising and deserialising playmaker state machines, being a long time playmaker advocate I never realised how a serious limitation this actually is...