Honours Project Blog 3 - Combat

Blog 3: 20/10/2021

I spent this week developing the game's combat system by scripting some basic enemy AI and a simple cover system.

For now, I have included 3 enemy attack types: Guns, Magic, and Sword attacks, as well as aggressive and defensive variations.

When an enemy is spawned, they automatically spawn an empty Defence Point actor at their spawn point. This actor represents the area the NPC is set to defend.

The NPC constantly checks to see whether the player character is within a certain distance to the defence point. This distance varies depending on the NPC's behaviour, with the aggressive enemies having a larger range than the defensive ones.

If the player is within this range, the enemy will run at the player, otherwise they will stay in their position, shooting from a distance if they have a ranged weapon. If the player has left the range, they will return to their defence point.

Example Script (Magic, Defensive):

The different variations of enemy are all child actors of the main BP_EnemyAI class, which provides all the scripts for the different behaviours, which are triggered by setting Enum values.

Each child actor selects the appropriate values when spawned, activating the corresponding attack type and behaviour.

Example child actor script (Gun, defensive):

In the future I would like to add smarter behaviour such as taking cover, but since the AI is functional I will move on to getting the rest of the gameplay working and return to the AI if there is time.

The cover system was made by using trigger volumes which prompt the player to take cover. Upon doing so, Unreal Engine's default "Crouch" function is activated, halving the height of the player's collision component. At the same time, the Movement Type enum is set to "Cover". The animation blueprint is constantly checking the value of this enum, activating the crouch animation when it is set to Cover.

An opposite sequence of events is triggered upon leaving the cover trigger or aiming a weapon, resulting in the player character returning to it's default state.

My next objective will be to complete the 1st iteration of the combat system by scripting some more abilities and spells, including:

  • An ability inspired by "Charge" from the Mass Effect games, where the player can charge from a long distance into an enemy to deal large amounts of damage.

  • A barrier which can be applied to the player for a limited time, reducing all damage taken.

  • A Jetpack which enables the player to double jump. This will be unlocked later in the game, allowing the player to reach areas which were previously inaccessible.

  • (Stretch goal) The ability to temporarily summon an AI companion to help the player in combat.

Once implemented I will put all of these mechanics into practice by building a playable test level which will be used to gain feedback.

Aside from scripting, I also spent some more time thinking about the setting for the game and made a moodboard for the architectural styles. As mentioned in my 1st blog post, the game will take place on an alien world inspired by fantasy settings, particularly The Elder Scrolls III: Morrowind, where magic is a normal part of everyday life. The main source of conflict will be between the magic users native to the planet and a group of technologically advanced aliens attempting to colonise the planet, creating a contrasting aesthetic between the high fantasy and futuristic science fiction genres.

Moodboard demonstrating the two major aesthetics in the game's architecture:

Moodboard Image Sources:

Tardis Data Core. (no date) Bowie Base One. Available at: https://tardis.fandom.com/wiki/Bowie_Base_One

The Elder Scrolls Wiki. (no date) Tel Branora. Available at: https://elderscrolls.fandom.com/wiki/Tel_Branora_(Morrowind)

Vernay-Kim, O. (no date) Mass Effect 2 – Human Colony. Available at: https://www.artstation.com/artwork/6o5Zn

Wallpaperflare (2018) MorrowindBalmora town illustration. Available at: https://www.wallpaperflare.com/morrowind-balmora-town-illustration-the-elder-scrolls-iii-morrowind-video-games-the-elder-scrolls-wallpaper-303439

Lo, B. (no date) Mass Effect Andromeda – Human palette outposts. Available at: https://www.artstation.com/artwork/qA2JAL

Wallpaperflare (no date) HD wallpaper: house, mountains, mushroom, fantasy art. Available at:


Aum, M. (no date) Alien Hut. Available at: https://www.artstation.com/artwork/5Xz19A