RPG Combat Abilities Design

This is a design question. I’m playing around with an RPG style game and I’m currently working on the combat system. I’m trying to figure out a good design for the combat abilities. What I’m calling an “ability” is something that you can do or use in combat that will either affect you or your target, such as an attack, healing, buffs/debuffs, etc.

Here’s what I’m currently considering. I’d have an Ability class that has a Type (Offensive, Defensive, Healing, Buff, Debuff, …), Cooldown, “Cast” Time (how long it takes between activating the ability and it taking effect), Range, etc. All of these properties determine how the Ability can be used.

Upon using an Ability, it can have one or more Effects on its target(s). These effects can be immediate, such as Damage (reduce HP), Healing (increase HP), or Knockback, or they can have a duration, such as Damage Over Time, Increase Damage Resistance, or Slow.

Only one Ability can be used at a time, but multiple Effects can be in effect on a single character.

Does this sound like a good start? Does anyone have any suggestions or thoughts to add to this, or suggestions for a different approach?

Sounds like a good start! The more component-based you can make it, the more flexible it’ll be. Avoid enums; they require you to hard-code content. By using components, you can change the effect of a skill by replacing, for instance, a fireball effect component with an electricity ball effect component, without having to touch any other code.

Also consider using ScriptableObjects. You can define skills in ScriptableObject assets and then assign them to characters. Jacob Pennock wrote a good tutorial on ScriptableObjects.

Leslie Young did a great job designing a general-purpose ability system in plyGame. (See this tutorial video for an example.) You might get some good ideas skimming the documentation.