Hi,
ok, here's the basics ( attached to this post).
- your ennemy has two fsm, one that holds the pattern, on that can be turned into a template executing the patterns
- patterns are expressed in FsmArray, quite simply.
- each pattern has a dedicated Global event, so that it's simple to call them, yet doesn't require them to be featured where unecessary ( not all your ennemies need to have a pattern they won't use
- event are built as string and sent as string, so the combinations are endless and the sequencer is agnostic to the content of the patterns and the event to set, no hardcoding on the sequencer, which is critical for productivity.
- the ennemy has children, each children is an pattern or attack ( and so they can use templates, or be added at runtime, etc etc). This is not mandatory, one gameobject could hold several patterns, could be template, could be anything.
- the pattern execution is controlled by the ennemy and each pattern is responsible to tell the fsm who initialize the execution that it's done, then the sequencer can execute the next pattern.
Let me know how it works for you. I'll beef this up over the next few days as I think this kind of problematic is interesting to study and understand where the complexity can be reduce for better workflow and productivity ( and avoid duplicates).
bye,
Jean