TOWER DEFENSE TEMPLATE

system / technical desigN
UNREAL ENGINE 
GITHUB

OVERVIEW

THIS WAS A 1 WEEK PROJECT DONE FOR THE VISUAL SCRIPTING COURSE AT FUTUREGAMES.

 

THIS IS AN ENDLESS TOWER DEFENSE TEMPLATE WITH MODULAR ENEMY TYPES, ROUNDS, TOWER TYPES ETC.

 

GAMEPLAY LOOP

Game starts with the spawning of the enemies running along a predefined path.
Goal of the game is to destroy the enemies before they reach the end point.

CUSTOM TOP DOWN CAMERA

Created a custom top down camera controller specially for the tower defense game mode.

 

It uses a pawn class attached with a camera with collision checks and a basic movements using WASD.

 

Also includes a zoom in zoom out functionality.

TOWER LOGIC

A complete modular set of towers with replaceable models.

The towers use raycasting to search in an AOE for enemies passing through.
The tower then detects the closest enemy and fires at it. (Closest enemy is always preferred over any other enemy, this is also customizable)
Each tower has a variable to set its fire rate & cooldown period.

A variable also lets you set the damage that can be dealt.
 

ENEMY AI LOGIC

Enemy AI has majority of the code for taking damage on contact with the ray trace projectile.

Each enemy has a custom health variable that can be set.

Each enemy adds gold to the player economy on death.

A simple trigger box acts as the enemy despawner.
A custom navmesh helps the enemy detect the target point of the despawner creating a pathway for them.