Tower Defense Starter Kit Tutorial: How to set up Global Ability Deployment

A Quick Introduction

The Tower Defense Starter Kit comes with an inbuilt Global Ability system that enables the player to deploy powerful abilities that aid in their defense against the enemy waves. Unlike Towers which cost a fixed amount of resources to construct, these abilities automatically recharge themselves after use. As a result, the Global Abilities provide players with an additional arsenal of tools that can essentially be used free of cost, and one that relies more on timing and strategy.

The toolkit provides four Global Abilities out of the box: Airstrike, Tower Guardians, Proximity Mine, & Regen Field. Airstrikes, as the name suggests deploys a series of lethal strikes that deal AoE damage to all targets caught within its blast radius. Tower Guardians, on the other hand, is a defensive ability that spawns in two Guardians to block enemy AI units in their path. Proximity Mine enables you to lay down mines along enemy paths, while Regen Field (added in the new v2.19 update) restores the HP of all Towers within its range.

While each of these abilities differ from a functional standpoint, they also differ in terms of where exactly they can be deployed in the map. Taking the aforementioned Tower Guardians for example, this ability can be activated only on enemy AI paths, thus preventing the player from spawning in reinforcements on parts of the map that do not support AI navigation. This is achieved through a 2-step verification process, and in this tutorial, I'll show you how to set up your own rules for deploying Global Abilities.

[Additional Notes: This tutorial is based on the latest v2.19 edition of Tower Defense Starter Kit].

 

Tutorial

The first step involves setting up our target actor to block the custom trace channel "CustomTargeting", which is used to detect the surface underneath the mouse cursor with respect to the ability targeting system.

Any actor that blocks this trace channel, will show the targeting reticule at the blocked location.

By default, the GlobalAbilityTargeting trace channel is blocked only by instances of BP_AIPath and BP_GridGenerator, plus an invisible volume placed just below them to ensure that the targeting reticule is displayed even when we point the cursor at empty space as seen in the screenshot (if not, the reticule would just disappear, and we wouldn't know where it is).

The second step requires mapping each ability to their own individual target types for deployment. For example, Airstrikes can be deployed only along enemy paths, where as the Regen Field can be activated only on Tower grid cells. This is achieved through the use of a unique "TargetVerificationTag" for each ability in the "DT_GlobalAbilites" data table as shown below:

With the help of these verification tags, we can individually configure each of our Global Abilities for activation only on target actors relevant to them. Once you have specified the verification tags in the data table, just head over to the target blueprints (like BP_AIPath for Tower Guardians ability) and add the aforementioned tag to their list of Actor Tags.

And that's it. You should now see the targeting reticule turn from white to red when pointed at these actors, indicating that the ability can be deployed on the targeted surface.


Conclusion

So, with that we've come to the end of this tutorial. If you have any doubts regarding the workflow, or have run into some issues with the implementation, just let me know in the comments. Or if you're interested in knowing more about the toolkit, you can check it out here: https://www.unrealengine.com/marketplace/en-US/product/tower-defense-starter-kit.

Comments