Forum rules - please read before posting.

ActionListAsset usage among multiple units/extending AC

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

  • Interesting problem, @pushxtonotdie.  The ScriptableObject nature of Actions / ActionList assets is complex, and the only way that I know of to get a system of Actions saving in both scene objects and assets, so kind of a necessity.

    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).
  • Hey Chris, thanks for the reply!

    I did not see the CopyScriptable function, and so I shall look at that. Nor did I realize until after writing that Actions *themselves* are also ScriptableObjects! Having noodled on this further I have learned more about the setup and created an enemy AI system with ActionLists and realized the limitations of using it as such (but it does work!). I think you are correct in setting up Playmaker as the FSM is the way to go. I was just trying to keep moving parts to a minimum, less code, less problems. :)

    Thanks again,
    Chris

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.