Tower Defense Starter Kit

Oh alright, I misinterpreted your earlier post as the gameplay not working in a new level.

Ok so if the level is not displaying in the level selection menu, just make sure to first close the project, delete the Saved folder and restart it. This will ensure that any previously saved level data will not override the new information that you added. Usually this turns out to be the problem, but if not could you share a screenshot of the new element that you added in the Level Data Array?

It has been resolved. I did not delete the savegame file before, thank you!!!

Yea, that’s an issue with using save files. Everytime we change some of the data, we have to go back and close the project and delete the old files to make sure that it doesn’t overwrite our new info. Glad to hear that you got it working :slight_smile:

Hi, just wanted to share the status of the v4.26 update. I’m currently working on a major update focused on adding a lot of usability improvements to the way Towers work. Most of the changes are based on feedback I’ve received over the years, with a focus on making the toolkit more accessible to newcomers but without sacrificing any of the existing features.

Due to the extensive modifications involved, I’m introducing these changes as part of the 4.26 compatibility update (and hence the delay). So those of you who are already using the 4.25 edition will always retain access to the base version of toolkit that was available to you at the time of purchase.

Meanwhile, if you’re not interested in the upcoming modifications, you can go ahead and convert your 4.25 projects to UE 4.26. I haven’t come across any 4.26 specific issues so far. So it should work quite fine without the need for any changes.

Changed to a new map, the camera has a problem at the beginning of the game, the camera is not in the middle of my map,may I ask where to set the camera.

Hi, the default camera is part of the BP_PlayerPawn blueprint. Since it gets spawned in at the Player Start actor location, you can move the Player Start around to change the camera view. However, since this wouldn’t give you a clear idea of what you’ll actually see in the game, I’d suggest temporarily adding an instance of “BP_PlayerPawn” to your level in the editor, and moving it around until you have the required view. You can then place the Player Start at this same location and delete the Player Pawn actor.

Apologies for rezzing this from the dark ages, but how would you accomplish this in the current 4.25 version of the kit? Specifically, where exactly do you

What I’m trying to do is break the AI path when building a tower. My test map is just level 1 with 2 lanes added that cross the grid generators:
483f28416b26ce67f7ab189f5d61292b8c8563bc.jpegSo far, nothing I’ve tried works for breaking the navmesh/update the AI pathing at runtime.

Edit: If I set the NavModifierVolume in the BP_TowerParent to block Pawn, the enemies do avoid the tower as expected, but the path preview does not update/recalculate. Not sure if blocking Pawn breaks anything else or is a bad idea for any other reason.
a3f214e3c3c28477775808ae4d5e341fb21d1be2.jpegEdit 2: Figured out that the AI path is a spline belonging to the SpawnPoint, and obviously it has to be re-calculated. Is there a good event I can hook when a tower builds on an empty cell, or perhaps a callback when the navmesh changes for any reason? What’s the best way to handle this?

Hi @Jaegermeiste , well you’re on the right track with Edit 2 and we can use Event Dispatchers to let the spawn points know when they should update the nav path splines.

But before getting to that, first make sure that the Runtime Generation parameter of your **RecastNavMesh **is set to Dynamic Modifiers Only.

This will ensure that the Nav Modifier Volume in our Towers can affect the Nav Mesh at runtime.

The next step is to head over to the **BP_Tower_Parent **blueprint and set the Area Class for its **NavModifierVolume **component to either NavArea_Null or NavArea_Obstacle. The former ensures that no unit will ever traverse through a grid cell containing a Tower while the latter allows for some flexibility when there is no other path to objective. IIRC, this became an issue only when you place a tower on a grid cell which already contains an enemy moving through it.

At that point, if you’re using the Null option, I’d suggest destroying every enemy unit around the Tower when it is spawned so as to prevent the AI getting stuck. On the other hand, with the Obstacle option, I believe it might be able to pass through if going back is not an option.

Finally, just play around with the Box Extent for the component to control how big of a hole is cut into the nav mesh when you spawn in a Tower. And that’s all we have to do with respect to the Tower BP modifications.

Next, we need to set up an Event Dispatcher system that gets called whenever a Tower is created/destroyed. Since this is handled by BP_TowerManager, that would be a good place to have this logic. So open up the blueprint and add a new Event Dispatcher “TowerSpawned/Destroyed”. Then head over to the **SpawnTower **& **DestroyTower **functions, and call the new dispatcher as shown below:

Next, we want to have the Spawn Points listen to this dispatcher, but since our paths are going to change dynamically, we also have to store references to the spline mesh components and have them destroyed before creating a new one. So open up the **DisplayAIPathUsingSplineMeshes **function of BP_SpawnPoint, and add the following logic:

Finally, head over to the **BP_SpawnPoint_NavMeshPathing **blueprint and make the following modifications in its Event Graph:

This will ensure that, everytime a Tower gets created or destroyed, the Spawn Point immediately gets around to updating the nav path splines. The AI movement should be automatically updated by Unreal’s nav mesh system.

And I believe that’s all there is to it. You should now be able to have the Towers influence the nav path display, but let me know if you have any doubts regarding the workflow.

That works great, thank you for the quick response and thorough explanation! Looking forward to the 4.26 update!

Glad to hear that you got it working. :slight_smile: Yea I’m hoping to publish it by the start of next week.

The game starts to choose tower defense and global capabilities. How do I choose all by default !!!

In the case of Towers, you can do that by setting the EnableTowerSelectionAtLevelStart? variable in **BP_GameMode_TowerDefense **to False. If you want the same for Global Abilities as well, the following modifications should do the trick.

Also, make sure to update the **BaseTowerModels **array in **BP_TowerManager **and **AvailableGlobalAbilities **array in **BP_GlobalAbilitiesManager **when you add or remove new Towers/Abilities.

Ok i’ll try it thanks

How’s the update coming along?

Hey, I don’t have an exact timeframe for the release since this is the first major update for the Tower blueprints in a long time and I have to make sure that it can handle future updates without having to be modified each time. Hopefully, a week or two, but if you just want to use it in 4.26, converting the 4.25 project to the new version should do quite fine.

The v2.18 update has gone live on the Marketplace. This is one of the biggest updates in quite some time, focusing primarily on improving the Tower side logic. As a result, I’ve released it only on 4.26 (and hence the long delay for 4.26 compatibility) and the previous version of the toolkit is still intact & available if you download the 4.25 edition of the toolkit

Change Log:

  • Added a new Team ID system that streamlines the threat detection and damage application logic. Instead of checking through a list of enemy classes, you can now directly call the IsTargetAnEnemy? global function to determine if a target actor is an enemy or friendly.

  • Revamped the Projectile blueprints to make it easier to create child variants with different Hit Response logic. Also integrated the new Team ID system to prevent friendly fire damage.

  • Moved the overlap based Target Detection logic for Towers to the parent class. This makes it easier to create new types of Towers without having to implement the same logic again. Works for both offensive towers and support towers (like Boost) alike.

  • Revamped the Tower Functions to greatly reduce the amount of scripts to be added to the Tower parent class when adding a new ability. Also added a new parent blueprint class (BPC_TowerFunction_Parent) to act as a template for creating new Tower Functions in the future.

    For reference, here are the functions that were added to implement the Overdrive & Repair Tower Functions in v2.17:

    And here is the implementation for the same in the new v2.18 version of the toolkit:

  • Added new Getter & Setter functions in the Tower parent blueprint for accessing both default and active values of all major Tower attributes.

  • Created a new component-driven design for handling the Tower firing systems. This includes both offensive modules like Laser, Machine Gun, etc and support modules like Boost (Mining Tower not included). As a result, creating new Towers will involve very little in the way of making changes to existing logic in the Tower blueprints.

    Again for reference, here is the blueprint for the Laser Tower from v2.17.1:

    And here is the same blueprint from v2.18:

    As you can see, the child Tower only needs to notify the component about a particular event. And you implement the firing system logic through dedicated components (*which can be inherited from **BPC_TOM_Parent *for offensive modules) and activating/deactivating them as required.

  • The Lock On System has also been revamped to make it far easier to understand. Dealing with various support tickets over the years, I’ve generally gotten the idea that this was an area that was difficult to understand for a lot of new users. So I went ahead and completely rebuilt it from scratch. Gone are the endless series of functions and in its place, you get to see the flow of logic directly when you open up the **BPC_LockOnSystem **blueprint.

    Again this is easier to explain with comparison screenshots. And here is the 2.17 version:

    Here is the new improved blueprint in v2.18:

  • Finally, added Unreal Engine v4.26 compatibility to the toolkit.

And with that, we’ve come to the end of change log for v2.18 edition of Tower Defense Starter Kit. I’ll be soon posting a more detailed account on some of the new changes in my blog. So stay tuned for that! And feel free to share your feedback on the new changes.

Really excited to see the new update. The changes you’ve made definitely make things cleaner and easier. I downloaded a clean 4.26 project and ran through the test levels, and I saw a few instances of the laser tower getting stuck firing, or not appearing to fire when I would expect them to. 4.26.1, clean project from marketplace, no modifications, no plugins enabled (other than the default stuff).

Hey, thanks for pointing that out. I believe that is happening in some instances when the Tower is deactivated by a nearby Tower Disabler. I’ll be releasing a hot fix update along with some minor changes to the Global Abilities later today.

The v2.18.1 hotfix update has been submitted to the marketplace.

Change Log:

  • Added fixes to prevent Laser Beam Emitter from getting stuck in place when the Tower gets disabled.

  • Added support for Global Abilities to be deployed on Landscapes. Previously deployment of Global Abilities relied on checking if the target surface implemented a specific interface. Since this workflow didn’t support non-blueprintable actors like Landscape, it was not possible to use Global Abilities on the same.
    Now the interface check has been replaced with an Actor Tag (default = GATarget) check specified through the Global Abilities Manager as shown below:

    So in order to make an actor targetable for Global Abilities, just make sure that it blocks the **GlobalAbilityTargeting **trace channel and add the **GATarget **actor tag to it.

Additional Notes:

  • Search for Version2_18_1 in the blueprint editor to identify the new changes in this update.

Hello and thank you very much for your project. I’m currently taking my first steps on Unreal Engine and I’m using your project to learn. I wanted to know if you would have the possibility to integrate the coop functions