The previous post covered the Agent Profile system and how towers and battle units are initialized at runtime. This one is about the Global Abilities system, which handles the player activated special abilities available in the toolkit.
Global abilities are fire and forget. They execute once or over a set duration and are done, which makes them fundamentally different from towers and battle units that persist in the world and maintain ongoing state. There is no StatContainer component involved. Stats are passed in at spawn time, applied once, and the ability takes it from there.
There are four global abilities in v3.0: Airstrike, Proximity Mine, Regen Field, and Tower Guardians. Each one is a self contained actor that derives from a shared base class, BP_GlobalAbilityTarget_Parent.
The base class receives the ability's stats at spawn as a map of gameplay tags and float values pulled directly from DT_GlobalAbilities, along with an init context that carries any stat modifiers to apply at that point. The construction script on the base class then applies these modifiers to the base stats before the ability does anything.
The Airstrike calls in a burst of strikes at the target location. The Proximity Mine places a mine that detonates when an enemy enters its trigger radius. The Regen Field spawns a field actor that heals towers within range periodically for a set duration. Tower Guardians deploys a squad of friendly battle units that fight alongside the player's towers for a limited time before despawning.
The main change to the Global Abilities system in v3.0 is how stats are defined. Previously, stat values were stored as primitive variables directly inside each ability blueprint, which meant they were isolated to that blueprint and had no consistent way to be read or modified across other systems. In v3.0 all ability stats are defined in DT_GlobalAbilities as gameplay tags, the same tags used across towers, battle units, and every other stat driven system in the toolkit.
The Global Abilities Manager handles deployment, reading the relevant data table row for the requested ability, building the init context, spawning the ability actor at the target location, and starting the cooldown timer once the ability is live.
That wraps up the Global Abilities system for v3.0 of Tower Defense Starter Kit. The next post will cover the Hitpoints and XP systems and how they integrate with the new stats system.


Comments
Post a Comment