I am trying to develop an ability system that allows for complete designing in the editor. Cooldowns, channeling with tiers, animations, states.
Some abilities are automatic
- control movement by changing the state of the move controller.
- Activate self healing after time elapsed after exiting combat.
- Etc
Some abilities are manual:
- Activated by using items/weapons
- Keystroke for jump/crouch/etc
I’m going off of a github I found when googling the topic which appears to be for a turn based game. It uses a scriptable object to design the ability and then it’s converted to the actual Ability class via a shared data class. I’m modifying things to work with a 3d shooter environment.
AbilityData - stores name, description, icon and action and behaviors of the ability.
AbilityTemplate - sealed scriptable object with ability data field.
Ability - sealed class with ability data field and is used to control the actions.
Sort of the structure I’m following. Abilities will be controlled through the profile class where you can assign abilities in the editor or at runtime.
Profile - controller class, optional reference to the following:
- MoveController - state machine, handles and modified input per state needs
- CombatController - controls health
- Inventory
Having trouble in a couple spots. Have to have a way to trigger the events an ability has. This concern is mainly with projectile but I’ll have the ability listen to the object it spawns. Maybe have an AbilityObject monobehavior to subscribe to. I also want to have channel tiers to allow for weaker spells or attacks for how long its held.
Maybe its my way of thinking. I cant figure out how I’m going to make some abilities triggered automatically or triggered by their respective weapon or item. I can have a scriptable object class return true per condition using inheritance but this wouldn’t be good for items or weapons.
So I just need help to wrap my head about this