Tower Defense Starter Kit

Sorry, I was actually talking about the Artillery tower. Got mixed up with AA tower. But still moving the collision sphere up is a pretty good move. It’s better than what I had in mind. I will probably do it that way when adding an AA tower to the toolkit.

As for the Artillery tower, I decided to make it kind of unique when compared to other offensive towers. So instead of just increasing the damage output per shot with upgrades, it will launch more explosive projectiles with each upgrade. You can adjust the impact location offset range, so that the projectiles don’t all land at the same spot.

The v1.2 update has been submitted to the marketplace team.

Update II (v1.2) has gone live on the Unreal Engine Marketplace. This is a v4.11 exclusive update & can hence be obtained by downloading the v4.11 project files from the Marketplace. Listed below is a brief overview of the code changes in the update:

All changes within the blueprints are marked with the boolean variable ‘Version1.2’ in order to easily identify the workflow changes introduced with this update. Comments are also written to describe the major changes. The new variables as well as functions added to existing blueprints are also marked in the event graph as shown below:

[Image moved to attachment view]


Changes in the Content Browser:

  • New enums: EProjectilePathConstraints.

  • Member name changes/additions in the enum EHUDState.

  • New actor blueprints: BP_Projectiles & BP_ArtilleryProjectiles.

  • New structs: Struct_LevelData.

  • New towers: BP_ArtilleryTower.

  • New default game instance class: BP_GameInstance.

  • Removed BP_PlayerHUD blueprint.

  • New save game class: BP_SaveGame.

  • New widgets: Widget_LevelInformation, Widget_LevelListBox, Widget_LevelSelectionButton, Widget_LevelSelectionMenu, Widget_LoadingScreen & Widget_MainMenu.

Hey doc.f, thanks for your suggestion. The new v1.2 update features a Level Selection menu with persistent player progression across multiple game instances based on backup saves.

The new v1.3 update for Unreal Engine v4.12 has been submitted to the marketplace.

How difficult would it be to make this work on mobile? Any idea? Thanks! Looks great.

I have not yet tried working on mobile projects. But I could try deploying it in my mobile devices & let you know in a couple of days. In any case, I’m assuming that all the core features except perhaps the UI placement should work once you change the input settings to reflect a mobile game. So some parts of the UI, especially the target stats on the upper end of the screen might have to be altered, perhaps using icons instead of complete text, like they do in Kingdom Rush, in order to save space & increase readability.

Apart from that, performance on mobile devices is not something that I’m particularly sure of. You would probably have to add object pooling, if you intend to make a map with a lots of projectile based towers & creeps. While I cannot promise mobile compatibility for the toolkit anytime soon, there are definite plans to add features like pooling in the near future, that would certainly make it easier to do the transition.

Sorry for the delay, I got caught up working on the updates for v4.12 & didn’t get a chance to try it out. I just tried deploying it on my android device & the AI waves seem to be working fine, but it was not possible to interact with the 3D Tower Constructor widget for building towers. I haven’t worked on mobile projects before, so I’m not entirely sure if 3D widgets are supported on mobiles or not, or if it’s something else to do with the way controls & UI interaction are set up. I’ll try going though it again sometime this week, & see if there’s any solution to it.

Edit: Alright, the Tower construction aspect is working when I removed the default on screen joystick from the project input settings.

It’s okay, I’m glad to hear it! Is there anything that still doesn’t work on mobile? Thanks for testing it!

I will have to run a few more tests & see if all the inputs & level selection aspects are working. I’ll let you know how it goes.

After some more changes, the toolkit was running fine on my Moto G3. The controls still need polishing, but there isn’t a lot to change for deploying & running a packaged game in an android device. So I will add those extra bits of logic in the next update so that it will make it easier to test out the product on android devices.

However I’m not officially adding support for mobile devices, as I’m not entirely sure if I can provide satisfactory support with my current level of experience working on Unreal mobile projects. Plus there are a lot of other new features that I want to implement before focusing on mobile support. So I could share the installer file for the packaged android demo with you before submitting the next update to the marketplace. You can try it out & make your decision based on that.

Thank you so much for testing it, I would love to try it out before I decide on purchasing it.

The Tower Defense Starter Kit v1.4 update has been submitted to the Marketplace. The primary focus of this update is the introduction of Tower Abilities & Global Abilities. Other changes include structural improvements to code as well as bug fixes. More details will be made available as soon as the update gets published on the marketplace. Meanwhile a gameplay demo of the v1.4 Tower Defense Starter Kit (Windows) can be downloaded from:
https://www.dropbox.com/s/cgw1oqz99486nl6/Tower%20Defense%20Starter%20Kit%20Sample%20Game%20Demo.7z?dl=0

Input Controls for Demo:

  • WASD & Edge Scrolling >> Camera movement
  • Left Mouse button >> Tower/Creep selection, Grid Cell interaction, & Global Ability deployment
  • Mouse Wheel Up/Down >> Zoom In/Out
  • Enter >> Manually triggers new wave
  • F >> Set Full Screen

Cheers for the demo! It convinced me to purchase it. I’m going to test it on mobile now!

Glad to hear that. The demo is a Windows executable file. As for mobiles, I’ve made some changes so that the functionality that previously was implemented for mouse clicks will now allow single touch based input as well. So you should be able to use all the core toolkit functionalities like tower placement, upgrades & tower abilities, unit stats display, global abilities, etc. I’ve not added movement and zoom functionality because I was not satisfied with the smoothness of the logic that I had written. So the map has been zoomed out enough by default thus facilitating tower placements in all three maps. However, if you want the movement controls for the same, just let me know. I’ll mail you a screenshot. It should work, but I think that there is a better way to do it.

Apart from that, there are some features like mouse cursor movement based grid cell highlights and global ability targeting reticule updates which would still function in the background if you are running it on mobiles. It’s not necessary as you only need to react to player touch input. So let me know if you can’t find out how to disable them.

Edit: Oh and btw the update is not published on the marketplace yet. It was only submitted yesterday. So it should be available in a week’s time.

Update 4 (v1.4) has gone live on the Unreal Engine Marketplace. Listed below are the main code changes introduced in this update:

  1. Added a new function library BPFL_GetterFunctions to easily retrieve references to all the core gameplay actors. As a result, getting a reference to the Tower Manager or the Tower Data Array is now as easy as getting the player controller or the game mode.

Preview Screenshot:

For more details about the implementation, check out the dev log at: Tower Defense Starter Kit v1.4 Dev Log #1: Getter Function Library

  1. The Towers now have access to special Tower Abilities which can enhance their capabilities for a short duration of time. The implementation basically expands upon the same system that drives the Tower Upgrade/Recycle functions, but uses a composition based approach to make sure that the abilities remain as independent modules that can be attached to actors. The two new Tower Abilities introduced in this update are Overdrive [amplifies the tower’s output per cycle for a set duration] & Repair [regenerates the tower’s armor over set period of time].

Preview Screenshots:

More abilities will be added in the future updates. For more details about the implementation, check out the dev log at: Tower Defense Starter Kit v1.4 Dev Log #2: Tower Abilities

  1. The toolkit is now equipped with a new Global Ability System, which makes it easy to add new abilities that can be activated anywhere on the map. This update introduces the first of these abilities: Airstrike [unleashes a series of explosive strikes at the targeted location].

Preview Screenshot:

Preview Video: [My video creation/editing abilities are really bad, but I think it will atleast serve to demonstrate the working of Global Abilities. Feel free to check out the free playable demo (download link listed below the features section), if you want to try it out yourself]

More abilities will be added in the future updates. For more details about the implementation, check out the dev log at: Tower Defense Starter Kit v1.4 Dev Log #3: Global Abilities

  1. The BP_PlayerController class now manages all low level HUD requests [updating independent UI elements like tower points, selected actor stats, etc within the In Game HUD] thus acting as a single conduit through which all updates pass through.

  1. Added a new Grid Manager class to handle default grid properties & updates to the Grid Data Array.

  2. The BP_GameMode now handles initialization of all core gameplay actors from a single central location using a well designed workflow instead of the actors having to rely on Begin Play events or initializing each other. This ensures improved code clarity from the get go as shown in the screenshot below:

Preview Screenshot:

  1. The Tower Data Array & Tower Functions Array have been moved from the Tower Manager class to the BP_GameInstance class. This ensures that implementing tower unlocks & any other sort of modifications to the Tower/Tower Function attributes will be as easy as editing this single instance of the Tower Data Array without having to worry about the instances of the Tower Managers within every single level.

  2. Fixed a bug that causes creeps to switch lanes immediately upon spawn [creating a flicker effect for less than a second] when using multi lane spline paths.

  3. Removed unnecessary collision/trace channel checks for Towers & Creeps.

  4. Removed Grid Snapping for towers when placed in the editor as the logic had conflicts with the new more data driven approach to Tower management. May be added back as an actor component in the future, if there are feature requests for the same.

  5. Fixed a bug introduced in the last update which caused creeps destroyed at Exit Point to add Tower Points.

  6. Other changes include improvements in code structure & modularity across most blueprints in the toolkit.

Gameplay demo of the v1.4 Tower Defense Starter Kit (Windows): https://www.dropbox.com/s/dch4utn15ek80i3/Tower%20Defense%20Starter%20Kit%20Sample%20Game%20Demo.7z?dl=0

All changes within the blueprints are marked with the boolean variable ‘Version1.4’ in order to easily identify the workflow changes introduced with this update. Comments are also written to describe the major changes. The new variables as well as functions added to existing blueprints are also marked in the event graph as shown below:


Changes in the Content Browser:

  • SoundWave asset FirstPerson_WeaponFire renamed to SW_Explosion.

  • Added new SoundWave asset: SW_BulletFire.

  • Added new HUD blueprint: BP_PlayerHUD.

  • Enum EFocusedActorType renamed to ESelectedActorType.

  • Overdrive & Repair entries added to enum ETowerFunctions.

  • Removed enum: EHUDStatsType.

  • Added new enums: EDynamicHUDStats, EGlobalAbilities, & EStaticHUDStats.

  • Added new actor blueprints: BP_GlobalAbilityDeployer, BP_GridManager, & BP_TargetingReticule.

  • Removed Interface: BPI_TowerFunctions.

  • Added new Interface: BPI_TowerAbilities.

  • Added new projectile: BP_AirstrikeProjectile.

  • Added new Struct: Struct_GlobalAbilityData.

  • Added new members AbilityComponentClass & AbilityCost to Struct_TowerFunctions.

  • Added new material: M_TargetingReticule.

  • Added new static meshes: SM_AbilityTargetingReticule, SM_FoundationMesh, & SM_Projectile.

  • Added new texture: T_TargetingReticule.

  • Widgets Widget_HealthBar, Widget_TowerListBox & WidgetBP_EndGameHUD renamed to Widget_3DStatsBar, Widget_HorizontalSelectionList, & Widget_MissionSummary respectively.

  • Added new widgets: Widget_StatusEffect & Widget_GlobalAbilitesButton.

The v1.4.1 update is now live on the Marketplace. This is a v4.12 exclusive update & fixes a bug that arises due to event access conflict, when multiple groups of the same creep class are spawned from different enemy spawn points within the same time frame.

I haven’t yet released the v4.13 update because of a new engine bug that interrupts the wave generator workflow under certain conditions. I’m assuming that it’s caused by the registered bug ‘UE-35609’, which should be fixed in the v4.13.1 engine release. So once that’s taken care of, the toolkit will receive the official v4.13 update.

The v1.4.2 update is now live on the Unreal Engine Marketplace. This update officially adds support for v4.13 of the Unreal Engine & introduces the following changes to the product:

  • The Camera Zoom workflow which previously relied upon a step zoom system implemented within the player pawn class, has been replaced with a modular component based system that supports both Smooth Zoom as well as Step Zoom functionality. Adding a zoom system to a custom pawn or changing the existing system type is now as easy as adding the Smooth Zoom or Step Zoom component to the pawn blueprint, alongside the required Camera Zoom interface & it’s functions.
  • Fixed a bug that caused the Mining Tower to display incorrect ‘MiningRate’ stats when hovering over the upgrade button.

Known Issues:

  • If the Global Ability Button is used, the editor might display a warning once that instance of the game is closed. This can be fixed by opening up the ‘Widget_GlobalAbilitesButton’ class & then setting the ‘Is Focusable’ parameter to true within the detail panel as shown below: [The issue will be rectified in the next update]

The v1.5 update has been submitted to the Marketplace team. The update primarily focuses on introducing two new changes to the toolkit:

  • The existing Enemy AI design has been revamped with a focus on component based design.
  • A new Global Ability that allows the player to summon Tower Guardians along the enemy path to block enemy units & engage them in combat.

A more detailed account will be made available once the update officially hits the marketplace.

Update 5 (v1.5) has gone live on the Unreal Engine Marketplace. This is a v4.13 exclusive update & listed below are the main changes introduced in this update:

  1. Implemented a new & improved component based Threat Detection system for the Creep AI. The two new components - Visual Perception & Threat Response together form a modular system that enables creation of new AI as well as extending features of existing AI with ease. Here is a brief overview of the components:

Visual Perception component: This component uses a combination of distance, angular, & line trace based checks to relay information about the highest priority target to the owning actor.

Threat Response component: This component comes into play once the owning actor has acquired an active target. It determines whether to move to/attack the active target based on the distance to it. The final decision is then relayed back to the parent actor for execution. For example, an attack order to melee parent actor would be executed in a different manner when compared to the execution by a ranged parent actor.

The components act independently & are not aware of the existence of other components. They are only aware of their own existence as well as that of the owning actor. Any information that is being relayed between these components happen through the parent class & interface functions. This facilitates creation of new creep types with different combination of components [along with their associated interfaces]. For example, all creep classes are now equipped with the Threat Response component by default, while the Ranged creep class will use the Visual Perception component as well, thus enabling it to attack towers along it’s path.

  1. Added a new Global Ability - ‘Tower Guardians’ than allows the player to summon Tower Guardians along the enemy path to block enemy units & engage them in combat. Each Tower Guardian can be used to lock down one enemy unit in combat, thus providing the nearby towers with an opportunity to take down the locked target. This is especially useful against fast moving or tanky creeps as the Tower Guardians can block them long enough for the Towers to inflict massive damage. The ability works on a cooldown & hence can be used multiple times similar to the Airstrike. However in order to prevent the player from spawning an endless supply of Tower Guardians between the waves, the Tower Guardians are set to have a definite lifespan, which causes them to die after a certain period of time has elapsed.

The Tower Guardians also use the aforementioned Visual Perception & Threat Response components to acquire & attack their targets. A Tower Guardian will always try to lock on to a creep that is not locked into combat with another Tower Guardian. But if there are no other non-locked creeps in the vicinity, it will lock on to another locked creep. However as soon as it detects a non locked creep, it will perceive this new target as the highest priority threat & move in to attack it.

Any creep that is locked in to combat by a Tower Guardian will stop all movement until the lock has been lifted, which happens only if the Tower Guardian is destroyed. The Tower Guardian, on the other hand will move towards it’s target until it’s within the attack range. The locked creep will keep evaluating it’s distance to the Tower Guardian & commence assault once the Tower Guardian is within it’s attack range.

**Preview Video (Tower Guardians): **

https://www.youtube.com/watch?v=epeyBRs8mTw

Gameplay demo of the v1.5 Tower Defense Starter Kit (Windows): https://www.dropbox.com/s/epyjcj9y1fvh0ca/Tower%20Defense%20Starter%20Kit%20Sample%20Game%20Demo.7z?dl=0

All changes within the blueprints are marked with the boolean variable ‘Version1.5’ in order to easily identify the workflow changes introduced with this update. Comments are also written to describe the major changes. The new variables as well as functions added to existing blueprints are also marked in the event graph as shown below:


Changes in the Content Browser:

  • Added new actor components: BPC_ThreatResponse, BPC_VisualPerception, & BPC_TowerGuardiansAbility.

  • Added new character blueprint: BP_FriendlyAI_TowerGuardian.

  • New item added to enum ‘EGlobalAbilities’.