playMaker

Author Topic: Sequencing actions  (Read 11193 times)

yannalaplage

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 12
Sequencing actions
« on: April 25, 2011, 05:27:17 PM »
From my lttle experience with PlayMaker, a lot of the fragmentation to an FSM is due to the lack of sequencing btw actions, they all occurs at the same time. if that make sense regarding "state" that also makes lots of spaghetti ;)
One idea: we could just "stack" states one over the other and so having an automatic sequencing of the states, without the spaghetti. We would take for granted that too stacked States are related by a Finished event.
that would be a nice help, at least for me.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Sequencing actions
« Reply #1 on: April 26, 2011, 12:52:17 AM »
Hi Yann ( I assume your family name is not "a la plage", that would be too cool  :) )

 I actually think this is very good to have these spaghetties when doing sequential work. It gives incredible flexibilities. Cause a sequence is meant to be changed moved around and generally abused cause of lack of spec and such...

Also the "FINISHED" event is not the unique Event that exit a state. I use a lot of other custom events like "DONE" for example, when I wait a feedback of some sort. Also check the samples, you'll see that you can exit a State if you add a transition of any events even unrelated to the actions of that State. That's powerful!

it allows you to shunt, bypass, join the sequence from anywhere at any point and add some extra transitions when required.

 What I would welcome tho is a more productive workflow tho, so that building these spaghetti becomes fun and quick. But I don't think it should change its visual appearance. I think Alex is working on some of these improvements like adding transition as you build actions ( when you get warnings within transitions and such).


 Bye,

 Jean

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: Sequencing actions
« Reply #2 on: April 27, 2011, 02:46:47 AM »
Completely agree with Jean. That's the whole point of node based work flow, its flexibility. It's like the difference between After Effects and Nuke/Fusion if you're an artist.

It does need more user customization of the nodes like Jean said, and it seems apparent that Hutong is aware of that. For version 1.1 I think it's actually a very powerful piece of software. I am making a fairly complicated game (2D game, but still lots of things happening) and I need to do very little manual scripting these days. My main concern is performance, but since I am making a 2D game I am not too worried. I'll just have to see. Maybe there will be optimization, or at least optimization guides in the future on how to minimize performance loss because of using Playmaker.

It's funny that there's now 3 different node based solutions for Unity. I'm very happy with Playmaker though as I find it very powerful yet very simple and I want to help make it grow.

jasonlee

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Sequencing actions
« Reply #3 on: May 12, 2011, 12:06:10 PM »
Yann's idea about "state statck" might be better solved by a BT(Behavior Tree) solution instead of FSM. The sequence node of BT will do the stack of actions one by one and make sure each one return a success flag.

Personally I'll avoid using playmaker to make complex AI unless it has HFSM support. And I do hope HFSM will be supported before 2.0 release. :)




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Sequencing actions
« Reply #4 on: May 13, 2011, 01:23:32 AM »
Hi,

 Hierarchical FSM : http://aigamedev.com/open/articles/hfsm-gist/, that's what we were trying to define with these sub fsm and grouping stuff. Thanks for pointing that out!

I currently can achieve quite complex AI because I cut down the problem into several fsm and give them enough info and events so that they know when to act, and yes, If I could have some kind of HFSM, It would improve the flow and power of the behavior and would be a lot easier to develop, maintain and expand.

 HFSM pretty please Alex :)

 Bye,

 Jean

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • FluidPlay Studios
Re: Sequencing actions
« Reply #5 on: May 13, 2011, 09:45:09 AM »
a lot of the fragmentation to an FSM is due to the lack of sequencing btw actions, they all occurs at the same time. if that make sense regarding "state" that also makes lots of spaghetti ;)

Wait a minute here, who said all actions in the action list of a state happen at the same time? I'm quite sure they're executed sequentially, for instance, whenever I stack up actions like "send message" and "destroy", destroy is NEVER called before the message is sent. There's also a mini-highlight (I guess in yellow color) for the specific action being executed during a state.

So if Playmaker has been fooling me all this time, please explain why/how :)
--
Breno "MaDDoX" Azevedo
@brenoazevedo

jasonlee

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Sequencing actions
« Reply #6 on: May 13, 2011, 12:07:20 PM »
MaDDoX is right, the actions are executed sequentially. But, some action could also be executed on every frame, that might brings some confusion in some situation.

Eg, I have 4 actions:

action 1, run once;
action 2, run on every frame;
action 3, run once;
action 4, run on every frame;

Then, on frame 1 after enter the state, the execution flow:

action 1 -> action 2 -> action 3 -> action 4

On frame 2 and after:

action 2 -> action 4

If action 1 and action 2 both access some external variable, and action 2 reading output from action 1, you might wonder why action 2 not behave properly until you realize you also should tick "every frame" on action 1.