-
Notifications
You must be signed in to change notification settings - Fork 0
Enemies
The Enemies system manages spawning, enemy types, textures, damage, pathing logic, and wave mechanics, with enemy waves threatening the player base and being countered by heroes and towers. Enemies follow map checkpoints via a chase task to simulate path-following, and on death they drop in‑game currency and score points. All enemy textures and animations were created using generative AI models with free‑copyright access.
A component that defines the combat-related stats of an enemy, such as health, damage, resistance, and weakness. These can be all changed using the getters and setters provided.
- Field
health: The total health of the enemy. - Field
damage: The damage dealt by the enemy. - Field
resistance: The damage type the enemy is resistant to. - Field
weakness: The damage type the enemy is weak against.
A component that manages the movement of an enemy along a series of waypoints. It tracks the current waypoint and updates the enemy's target as it progresses.
-
Field
waypoints: A list of waypoints the enemy follows. -
Field
currentWaypointIndex: The index of the current waypoint. -
Field
speed: The movement speed of the enemy. -
Method
setCurrentWaypointIndex: Updates the current waypoint index. -
Method
getNextWaypoint: Retrieves the next waypoint in the list. -
Method
hasMoreWaypoints: Returns true if there are more waypoints to follow.
A component that makes the enemy interactable by the player. It defines the clickable area around the enemy.
- Field
clickRadius: The radius within which the enemy can be clicked.
This component serves as a counter to tower projectiles and can only be shot by tank enemies. They are tagged with an InterceptorTagComponent to differentiate themselves from tower projectiles (and avoid interception by other antiprojectiles). When a tower projectile is intercepted, both the projectile and antiprojectile are destroyed and disposed of.
- Field
range: The radius within which tower projectiles can be detected and shot at. - Field
cooldown: The amount of time a tank enemy must wait before it can shoot another antiprojectile. - Field
speed: The speed in which the antiprojectile can travel across the map. - Field
lifetime: The maximum amount of time the antiprojectile can exist before being automatically disposed.
An example of one of the enemy factory classes. It is used for easy and consistent enemy creation.
- Method
createDroneEnemy: Creates a drone enemy with the specified waypoints, player reference, and difficulty level. - Method
updateChaseTarget: Updates the target entity the drone is chasing. - Method
updateSpeed: Updates the movement speed of the drone. - Method
destroyEnemy: Handles the destruction of the drone, including dropping currency and awarding points.
The Difficulty enum is used to scale enemy stats (e.g., health and damage) based on the selected difficulty level (EASY, MEDIUM, HARD).
Enemies come in a variety of different speeds, damage levels, and health values. Some enemies have special abilities, weaknesses and/or resistances.
The grunt is the most common enemy unit in the cyberpunk wastelands. Medium weight and balanced, they speed up as they are attacked. Their sheer numbers make them a constant threat. Do not underestimate them—when ignored, they can swarm defences and drain your resources.
- Health: Moderate
- Damage: Low
- Speed: Medium
- Special Traits: Movement speed increases as their health decreases.
- Tactical Role: Fodder unit, designed to soak up early firepower and overwhelm with numbers.
Lore: Grunts are mass-produced cyber-soldiers, outfitted with low-cost exosuits and energy rifles. They are often deployed in waves by crime syndicates or rogue AI's to test your defences.
- Currency: Low
- Points: Low
- Weakness: None
- Resistance: None
The tank is a slow-moving heavyweight unit, armoured to withstand enormous amounts of punishment. While sluggish, its heavy cannon can devastate defences with antiprojectiles if in range. Defeating a tank often requires concentrated firepower or high-damage towers.
- Health: Very High
- Damage: High
- Speed: Very Slow
- Special Traits: Can intercept tower projectiles with antiprojectiles.
- Tactical Role: Siege unit, designed to break strongholds, soak tower fire and cover other enemies by intercepting projectiles.
Lore: Built from salvaged military hardware, tanks are often repurposed by warlords or hacked AI systems. Their glowing energy cores hint at unstable but devastating power supplies.
- Currency: High
- Points: High
- Weakness: None
- Resistance: None
Special Attack: The tank enemy features the unique ability to shoot tower projectiles mid-air, protecting itself from some amount of incoming damage!
The drone is a lightweight, fast-moving aerial enemy. Agile and difficult to hit, drones dart across the battlefield, bypassing ground-based obstacles and exploiting weak anti-air defences. While fragile, their speed makes them a dangerous distraction.
- Health: Low
- Damage: Low to Medium
- Speed: Very Fast
- Special Traits: Flying unit, ignores ground traps and walls.
- Tactical Role: Harassment unit, designed to force the player to build anti-air towers and split defences.
Lore: Drones are automated hunter-killers, originally designed for surveillance in neon-lit megacities. Their repurposed plasma cutters make them lethal in swarms, overwhelming unprepared defences.
- Currency: Low
- Points: Low
- Weakness: Vulnerable to focused anti‑air fire, burst damage and specialised anti-air towers.
- Resistance: None
The boss bot is a huge mechanical beast, capable of inflicting severe damage in short bursts. Its armour provides a significant health boost, so be sure to target this enemy early!
- Health: Very High
- Damage: Very High
- Speed: Very Slow
- Special Traits: Huge health bar makes this one tough to defeat.
- Tactical Role: Designed to be a primary target that allows faster, weaker enemies to pass.
Lore: Designed by the US Department of Defence, the boss bot once fought alongside humans against the robot horde. With an AI virus infecting the robot's neural core, this beast is now corrupted and seeks only to annihilate humanity!
- Currency: Very High
- Points: Very High
- Weakness: None
- Resistance: None
The Divider enemy is a formidable foe, with its tankier than usual health and slightly lower damage and speed it might seem like an easy target, but don't be fooled. Once killed, the Divider releases its children Dividers who are faster in speed and pack more damage. One mistake and this one will surely pass all your defences.
- Health: Very High, then Very Low
- Damage: Very Low, then Very High
- Speed: Very Slow, then Very Fast
- Special Traits: Spawns little children Dividers upon death.
- Tactical Role: Designed to be able to catch people off guard who focus too much on weaker enemies.
Lore: The works of a mad scientist gone crazy by AI, the concept of the Divider was initially made to be used in medicine as a way to target patient's illnesses at a microscopic level. At least that was until the military took over the project...
- Currency: Moderate, then Very Low
- Points: Moderate, then Very Low
- Weakness: Area‑of‑effect attacks and high burst damage when splitting eliminate both the parent and its spawned children quickly.
- Resistance: None
The Speeder is a boss-tier assault unit that begins sluggish but builds unstoppable momentum over time. Its acceleration is gradual, but once it gains speed, few defences can react fast enough to stop it. Early in its approach, it’s vulnerable — but if ignored, it becomes a deadly force capable of overwhelming even fortified bases.
- Health: Very High
- Damage: Very High
- Speed: Starts Very Slow → Accelerates to Very Fast
- Special Traits: Gradual acceleration; becomes harder to target or slow down once at top speed.
- Tactical Role: Endurance boss — tests players’ ability to neutralize threats before they gain momentum. Prioritize burst or slowing effects early to prevent a devastating charge.
Lore: Engineered from experimental hover technology, Speeders are remnants of high-speed transport drones corrupted by rogue AI warlords. Their propulsion cores hum with unstable plasma, growing hotter and faster as they move. Many defenders have learned the hard way — what starts as a lumbering hulk can end as a blinding missile of destruction.
- Currency: Very High
- Points: Very High
- Weakness: Early-phase attacks, slowing or freezing effects, high burst damage before acceleration.
- Resistance: Sustained damage over time, weak crowd control once fully accelerated.
Enemies rarely attack alone. Expect mixed-unit waves combining these types:
- Grunt + Tank combo: Grunts shield the tank by overwhelming defenses while the tank delivers crushing blows.
- Drone swarms: Fast-moving air units that distract towers, letting ground forces advance unopposed.
- Staggered assault: Waves arrive in timed intervals, forcing players to spread resources thin.
Pathing: Enemies use a ChaseTask to traverse a series of map checkpoints, providing path‑following behaviour along designed lanes.
Death and drops: On death, enemies award in‑game currency and score points that feed progression and ranking systems.
Assets: Enemy textures and animations are provided by generative AI sources with free‑copyright usage.
Tinting: Enemies will slowly turn to more intense shades of red as they lose health indicating to the player how much health the enemies still have remaining.
Advanced Mechanics: To increase the variability and difficulty of the game, some enemy types will speed up as they lose health; their speed stats are dynamically increased, making them more threatening when wounded. Additionally, some maps will have variable path types which will impact enemies differently; causing them to slow down or speed up depending on the interaction of the enemy type and the ground type.
Enemy factories are responsible for instantiating the different enemy archetypes, their textures, and linking behaviours, aligning with the engine’s configuration. Refer to the UML graph and factory definitions to add or modify enemy types consistently with project conventions.
These factories implement a common factory interface that defines methods such as createEnemy, updateChaseTarget, updateSpeed, and destroyEnemy. Concrete factories like GruntEnemyFactory, TankEnemyFactory, DroneEnemyFactory, DividerEnemyFactory and SpeederEnemyFactory extend this interface. Each factory is responsible for wiring together the appropriate components—such as CombatStatsComponent for health and damage, WaypointComponent for pathing, Clickable for player interaction, and AntiProjectileComponent for tanks—ensuring each enemy type spawns with the correct stats, textures, and behaviours. The UML illustrates these relationships, showing how factories create instances of the base enemy class and attach components based on difficulty and map context. By following the diagram, developers can add new enemy types consistently while reusing existing behaviours and configuration structures.
All enemy types have a simple "spawn" method that allows them to be added to the map, see the example for the grunt enemy:
Developers can simply call this method when developing new maps, ensuring to specify the number of each type of enemy they would like to spawn:
To create waves, developers simply need to set a rule similar to how the win condition is set that will trigger the next wave of enemies to spawn once the current wave has been defeated. Varying rest periods can be implemented in as the map designer desires. For parallel waves, the logic needs to be repeated and a separate spawn point specified with its relative coordinates.
All enemy types are developed from a base enemy class, for any class wide changes to how enemies work, this is where they should be made:
To create a new enemy type, simply create a new factory for them, extending the base enemy class type:
In extension, any enemy specific changes should be made in their respective factories.
All configurable properties of enemies can be simply made within their config files:
Additional functionality is explained later in this wiki, any changes to them would require modifications to other features to ensure the game still operates properly as they are closely connected methods.
When enemies die, they drop both in game currency as well as points towards a players score. The amount/type of points and currency that they drop scale depending on the enemy type and the difficulty selected for the round.
For example, on "Medium" difficulty a grunt enemy may drop 2 points and 5 scrap metal and a tank enemy may drop 3 points and 8 scrap metal. If the difficulty were to be changed to "Hard", then the grunt enemies may now drop 4 points but only 3 scrap and the tank enemy 5 points and 4 scrap. These amounts are for example and not reflective of in game amounts.
Each enemy texture was created by generative AI models with free copyright access, sprite sheets were then created manually using the textures and animated. The explosions were made by marcovector and the dustclouds by Freepik. Both were sourced from Freepik.
Enemies feature unique sound effects that are appropriate to the current game state they are in (e.g., walking, attacking, dying). These are triggered under precise conditions with certain weights determining its probability.
Enemy Spritesheets:
Tanks are capable of intercepting tower projectiles by shooting antiprojectiles. They are designed with a flame-like appearance, coloured pink to fit the game theme/maps.
The sound effects were sourced from pixabay, OpenGameArt and incompetech. The lazer sound effects were made by dklon. Some movement sounds were made by Little Robot Sound Factory found at www.littlerobotsoundfactory.com. The Boss music is "Final Battle of the Dark Wizards" Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 4.0 License http://creativecommons.org/licenses/by/4.0/.
Boss: [Boss_lazer.wav] [Boss_Walk_1.wav] [Boss_Walk_2.wav] [Boss Music.mp3] [Boss_Death.wav]
Divider: [Divider_Death.mp3] [Divider_Random_Noise.mp3] [Divider_Walk.mp3] [Divider_Attack.mp3]
Drone: [Drone_Death.mp3] [Drone_Random_Noise.mp3] [Drone_Walk.mp3] [Drone_Attack.wav]
Grunt: [Grunt_Death.mp3] [Grunt_Random_Noise.mp3] [Grunt_Walk.mp3] [Grunt_Attack.wav]
Speedster: [Speedster_Death.mp3] [Speedster_Random_NOise.mp3] [Speedster_Walk.mp3] [Speedster_Attack.mp3]
Tank: [Tank_Death.mp3] [Tank_Random_Noise.mp3] [Tank_Walk.mp3] [Tank_Attack.mp3]
Enemies use the inbuilt chase task logic to target a series of checkpoints on a map to give the illusion of the enemies following a path. These checkpoints are iterated through as the enemy reaches each one, until the enemy reaches the players base (or is killed), at this point the enemy deals a single damage amount to the players health and is despawned. This technique relies on paths being created with 90 degree angle bends (no curves), in theory it could work with curves but would require many more checkpoints to make the illusion convincing.
See the Enemies Test Plan for scenarios covering loading, animations, AI pathing, death/drops, and integration with currency and scoring systems. Testing should validate wave compositions, special split/spawn behaviors, and air/ground interactions to prevent regressions in tower targeting and balance. https://github.com/UQcsse3200/2025-studio-4/wiki/Enemies-Test-Plan