playMaker

Author Topic: support Control flow node  (Read 6085 times)

aliessmael

  • Playmaker Newbie
  • *
  • Posts: 26
support Control flow node
« on: February 16, 2012, 12:04:36 PM »
I was doing behavior on trigger , the behavior is responsible to get any object enter on trigger and save it in array, then control of all these objects , by make them do some behaviors.

first thing it hard to make looping, to do some stuff.
when some object enter trigger i have to break my FSM to handle adding.

what i think is , it will be very good to support control flow node,which is nodes,you can add it to the FSM
and these nodes control some states.
the type of these control node is for example
1- parallel node : which make more than one state run same time( so i don't break my running state to handle another event )
2- loop node : which will repeat the running when states finish running
3- switch node : which check condition and run one state
4-..
5-..

actually , it will be very good if playMaker support some strong feature from AI Behavior Trees.

aliessmael

  • Playmaker Newbie
  • *
  • Posts: 26
Re: support Control flow node
« Reply #1 on: February 17, 2012, 01:29:38 AM »
Actually the most important thing right now is to support running of more than one state same time.
you got me right?.

what i mean is to make one state running to make some handling , and another state to handle some events.

for example, i can show some GUI on screen in one state , and another state is responsible for dealing with events. so my GUI does not disappear if some events happened.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: support Control flow node
« Reply #2 on: February 17, 2012, 07:24:55 AM »
Right now you can do this with 2 FSMs. Use the Set Event Target action on the GUI FSM to send all GUI events to the other FSM (without changing state in the GUI FSM).

In the longer term the plan is to have a hierarchical FSM, which will keep this all nicely organized in one FSM.

aliessmael

  • Playmaker Newbie
  • *
  • Posts: 26
Re: support Control flow node
« Reply #3 on: February 17, 2012, 01:54:34 PM »
may I suggest one change to playMaker system.
Instead of having one FSM in one Component, to have many FSM in one component.
no nead to create another component to assign new FSM.

in this way you can easily share date between them , like variables and events.

Thanks

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: support Control flow node
« Reply #4 on: February 17, 2012, 02:55:42 PM »
I like the way you think! That's essentially the first step in implementing hierarchical FSMs where all FSMs can share variables and events.

An approach I'm considering: Each FSM in the hierarchy can either have 1 state active, or ALL states active. You set the behavior with a checkbox on each FSM.

E.g., the root FSM has AllStatesActive checked, running a few FSMs in parallel. But any FSM in the hierarchy can easily activate/deactivate a set of related FSMs with this design.

I've implemented hierarchical FSMs with this design in the past, and it offers a nice balance between flexibility and simplicity. Unlike graphs where any node can be active at any time, which can quickly become quite confusing...


aliessmael

  • Playmaker Newbie
  • *
  • Posts: 26
Re: support Control flow node
« Reply #5 on: February 21, 2012, 10:41:23 AM »