RPG Skill system

I’m working on a small Action-RPG similar to a bad clone of Diablo and I’ve now started to think about how I want the skill system implemented. I have some ideas on how I could do it, but I also think it could be good to hear how other people implemented a skill system.

My plan:
Skills are GameObjects which when Instantiated perform their scripted behaviour.
These GameObjects are build from different components which makes up the entire skill.
Hierarchy:

  • Skill (Required in all skills, in charge of updating the components)

  • Effect (What happends when the skill hits something. For example, damage, heal, buff, etc.)

  • Projectile type (How the skill is deployed and how it hits the targets. For example, projectile, ground target, AoE projectile etc.)

  • Example: Fireball

  • Effect: Damage & Debuff (burning)

  • Projectile type: Projectile (Maybe AoE projectile)

The benefit of this system which I can see is that is that it’s easy to create a skill when the entire system is in place, even for someone not super into programming.
But I’ve sketched up a small foundation of this method, and it get messy quick.

Another way of implementing skills that I can see is that every skill is it’s own separate class/script just derived from a base skill class. It is less elegant, but might be easier to implement but harder to maintain as the system expands.

Question:
Is my plan a valid way of implementing skills or am I thinking to big?
How have you implemented skill systems in the past (If you wish to share)?

Thanks in advance!

1 Like

I used something very similar to your plan. I stored skill data in a scriptable object database which I added to and edited using an editor interface I wrote. The skills each had the following:

  • unique ID
  • name
  • description
  • sprite icon
  • stamina cost
  • mana cost
  • element type (physical, magical, fire, ice, etc…)
  • target type (self, allies, enemies, or everyone)
  • target position (self, forward, select, or channel)
  • aim range (1-10, could be “forward range”, “aoe range”, etc…)

It also had lists for prefabs- one for “hit” prefabs which determine the area and effect of the damage/buffs/whatever, which was modified by the last members above automatically, and a list of “effect” prefabs which were purely graphical. Now, for magic spells, you use a single animation sequence for the character (get into stance, charge up, throw hands up, trigger hits/effects, then just wait for all of them to end), so most of the effort goes into the prefabs and the details you put into the database there, but when talking about “attack skills” things get complicated.

In my game, attack skills were built in mecanim using sequences of combat animations. As an example, a triple-thrust spear attack (thrust, thrust, charge up, thrust, pause). Sometimes I’d have a “charge up” effect at the beginning of the skill, sometimes just before the final hit, and sometimes none at all- some of the skills would be single hits, some would be “combos”, some even utilized changing weapons mid-combo just for the hell of it. You can imagine how complicated the animations could get, and I built some behaviour scripts that could handle self-looping (charge for as long as I set a timer for), self-triggering (moving into the next animation when and how you choose in the inspector), slightly randomizing follow-ups, etc…

Anyways, a lot of work went into the mecanim portion for these kinds of skills, so all the database-entry stuff was primarily used just for the prefab lists- the mecanim behaviour scripts would say “use the hit skill in slot 1 and effect skill in slot 2 here. Hit skill 2 here, here, and here”, so it would actually have to interact back and forth a bit with the skill data. That means that I could do things like changing the effect radius and graphical look of skills without actually going into mecanim, which was the point, and I could change the timings of my animations and when the hits and effects were triggered in mecanim without having to worry specifically about the hits and effects themselves.

Some pics to show what I’m talking about: