This is a weird and somewhat esoteric one:
Is it possible to abstract away a series of notify tracks relative to an underlying animation asset? Or are notifies/notify tracks intrinsically tied with the asset itself?
Here’s the use case: I have player-character-specific notifies that are tied to certain animations, because those notifies need to make call-backs to the player character for gameplay logic reasons. For example, I have an Input Buffer NotifyState, which allows me to specify a range of frames during which inputs I am listening for should be consumed and used to queue some behavior when the NotifyState ends. This structure is robust, complicated as hell, and absolutely essential to the project, but it also requires hard reference/cast to the player character actor.
Now, some of these animations I would like to reuse on enemies as well, in some contexts. For performance reasons, it’d be preferable to not make a duplicate of the exact same animation data, store it twice on disk and load it twice at runtime. The problem is, if I just point to the same data, it means I’ve tangled up hard refs to the player in every single enemy attack animation. I realize that contextually that’s probably not the worst thing (how many contexts are there where the player character doesn’t need to be loaded, but an enemy does?) but it’s generally not considered a good practice and I’d like to avoid it. I could sit down and try to create an extremely complicated Interface system that abstracts away the player from the input buffer, but it’s sort of a waste of effort. Tons of refactor work (this system is complicated), and it accomplishes very little, because the only time the system matters is in reference to the player. Any enemy will just quietly fail and ignore all input buffer stuff because the enemy AI has no inputs.
And honestly, how many contexts would there be where I created an abstraction layer via Interface whose only job is to “implement the logic when this anim is played by Class A, and fail every other time”, or “implement the logic when this anim is played by Class B, and fail every other time”? Quite a few by my count. So what I’m wondering is, is there some way I can point to an “animation” struct of some kind which is composed of
-just notify data
-an underlying animation
as two separate entities? So that I could point to an anim like Combo_L1_Drawn via 2 routes, one which loads the player-relevant notify data, and another which loads enemy-relevant notify data? And a third which loads specific-boss-relevant notify data? Etc.
Obviously I could specify the struct myself but as far as I can tell, a Notify or NotifyState instance cannot exist outside of the context of an AnimSequence object. There is no way to say “Inputbuffer, frame 0, duration 0.96” and have that exist independent of a specific underlying Anim Sequence. Or am I wrong?