PlayMaker News > General Discussion

Why (and when) would you use Multiple FSMs on a GameObject.

(1/3) > >>

brendang:
I'm trying to digest more complex concepts in PlayMaker recently but this still eludes me.  When might you use a second (or third), FSM on an object.  Could someone suggest a relatively simple example of when this would be useful?

thanks,
B.

Uttpd:
In any situation you want the Game Object to perform more than one thing at the same time, independently.





brendang:
Appreciate the input, but that is a bit broad.

A single FSM could trigger an object to move, while changing GUI Text, while updating the texture on a specified game object and playing a sound. Granted in sequence. 

Under what circumstances would two (or more), FSMs bet better than one?

Uttpd:
ok;
Lets say you have a cube that moves from A --> B--> C
And you want the cube to change color depending on Time.

you could make it all in one FSM, but then you would have to make a Time Check/ color change in every sate the cube could be in a given time (A, B, C) and for every color
Instead you use a second FSM to take care of the Color/Time in one simple state.

Now you want the cube to jump x meters when its on B and the color is yellow and y meters when is blue
So make another FSM that checks the other ones states...

Now imagine doing it on a single FSM!. Every state on that FSM would have to check move time color jump..

PS: In your example as you say all the actions are in sequence and that works perfectly in on single FSM. Is when you add interactivity that a single FSM wont do.

brendang:
Terrific reply.  Makes perfect sense now.  I appreciate you going a bit deeper to clear this up. Hopefully it will be equally helpful to some other artsy type like myself.


Have a great weekend

B>

Navigation

[0] Message Index

[#] Next page

Go to full version