Note: I was a bit confused as to where this thread should go, and realized after I posted it that this may indeed the wrong forum section to be posting it in. That said, I see no options for moving or deleting it, so I’ll have to rely on a mod to do that, if necessary. My apologies if that’s the case.
I’m finding myself caught in one of those situations where the number of options available to me is a bit overwhelming, so I thought perhaps I’d consult with the advice of the veterans here.
I purchased the Action RPG Kit from the AssetStore a few weeks back and while I find the majority of the scripts useful (at least as an example, if not for any sort of practical application), I was a bit disappointed with the “combat skill” system. It’s just a simple class collection of an attack prefab (which is collider used for the hit area along with damage details and such), a mana cost, and a legacy animation reference on top of a few details that really don’t effect the mechanics at all. That’s fine if “spells” and simple hits are really the full extent of your skill system, but for wanting to chain together different animations, hits, and effects into one object, it doesn’t help at all. That’s fine- this post is not a review or criticism of the package (which I found well worth its value as a basic “guide”), but in needing to implement my own solution from scratch I’m hitting a brick wall of indecision (or perhaps just lack of confidence, or lack of social interaction…).
My requirements are as follows:
- It must utilize Mecanim, not the legacy system.
- It must be able to handle a variable number of sequenced animations, hits, and visual effects spread throughout the life of the skill (start animation, show effect at .4 seconds after start, another effect at .6 seconds after start, “hit” enemies at .6 seconds after start, for example).
- I can chain together animations in Mecanim in a SubStateMachine easily enough to form the animation sequence for a single “skill”, but the skill system itself has be aware of those states, able to control the state changes (or at least respond to the changes), and do so in a generic way that does not require different coroutines for different skills.
- Skills do not necessarily have to be universally usable on any PC, NPC, or Enemy in the game, but the skill system should be the same for each even though the skill database is not.
After careful consideration, I’ve come to the conclusion that I should use a class that holds data for the skill as a whole (like the data you’d see on a “skill details” screen), like the mana cost, the attack type (physical or magical), the element (if any), the name and description of the skill, etc…
There should also be a “Skill Stage” class, which has settings for each individual stage in a stage-queue, each with data on whether the effect (if there is an effect for that stage) should be fired at the beginning or end of the stage, the same for a “hit” (if a “hit” for that stage exists), and whether there should be a pause at the end (looped animation or frozen?) for X number of seconds until the next stage fires. There should be a list of these stages for every skill.
The final piece of the puzzle lies in the StateBehaviour scripts for the skills. I could have it so that the progress through a skill’s SubStateMachine is tracked and reported to the skill manager script, that each animation “stage” uses the same NextStage trigger to progress (triggered by the skill manager), or some such thing. My experience using Mecanim is limited, so I’m really uncertain about this aspect.
So, on to my question at last- I’m really hoping you veterans out there with a better grasp of RPG mechanics will know if there’s some unseen factor I’m missing here, whether this solution seems like a solid approach or flawed, am I reinventing the wheel when an identical system already exists out there that maybe I just haven’t happened upon yet, etc…
Really any thoughts or advice would be greatly appreciated, even not relating directly to the question at hand. I’ve been coding for months now on one project or another with almost no interaction with others in regards to my projects, and I’m honestly feeling like maybe I just need a little bit of encouragement, if any can be had, or maybe just some basic human contact (it’s dark down in this hole, and they only feed me once a day).