Hi,
I'm currently investigating using a custom rpg-style combat engine with Adventure Creator. The idea is to use the ActionList state machines within the combat engine for player abilities and enemy AIs. This would alleviate the need for a separate state machine tech, and allow us to better integrate things like AC dialog and inventory.
The path I was going down was to use custom Actions, ActionListAssets, and some ActionParameter hackery to initialize the state machines for units, but after a bit of coding it seems that ActionListAssets do not clone deeply because they are ScriptableObjects so all my units are sharing the same Actions even if they had different ActionListAssets (or RuntimeActionLists). This causes various issues where an action may be in progress on one unit and another unit doesn't initialize the action properly, etc.
I can solve this issue potentially by using something like BinarySerializer to hack a deep copy of ActionListAsset, but this feels bad. I wonder if I'm either not using the tech right (i'm new to AC) or if its not a good fit for what we want to do, or maybe i'm on the right path with BinarySerializer. But we really want to extend the adventure aspects of the game into the combat system and it feels doable.
Sorry for the long post. If code examples can clarify this a bit, I can see about cooking something up.
Thanks!
Comments
ActionList assets themselves can be duplicated without their being links between the original and new - though embarrasingly I'm struggling to recall just how it's done. Certainly scene-based ActionLists are deep-copied via the ActionList.cs CopyScriptable function, which may shed some light for you.
So far as hacking the ActionList system goes to get FSM behaviour goes - well, I wouldn't recommend it. AC does come with PlayMaker support in the form of the ThirdParty: PlayMaker Action, which you can use for FSMs. Other than that, you can rely on AC's scripting guide for building a bridge to AC (the front page is definitely required reading for anyone wanted to go deep).