top of page

CUSTOM ENEMIES

BlueBack.png
BlueBack.png

DESCRIPTION

Custom enemies is a personal project where I took a deep dive into enemy behavior to give myself an even greater understanding of Behavior Trees.

The challenges I set for myself at the start of the project where the following: Make a flying enemy that can navigate through a 3D level. Make a ground enemy that can navigate a 3D level (using jumps). Add an extra movement mechanic to the ground enemy to navigate the 3D level.

ROLES

Enemy Behavior
Enemy Blueprints

SKILLS LEARNED

- Animation Blueprints
- Animation Blending and Blendspaces
- Animation Montages with slots
- Custom Behavior Tree Tasks
- Custom Behavior Tree Services

- Custom Behavior Tree Decorators
- Making clean behavior trees

YEAR

2023

PLATFORM

PC 

Team Size

1

GENRE

Third-Person Action

Flying Enemy  Navigation

Flying Enemy
Attack

Natural Flying

Flying Enemy Passive State

Enemy Manager

End Result

Surrounding Movement

Gamepad Aiming Prototype

Gamepad Aiming Prototype

Gamepad Aiming Prototype

Burrow Logic

Burrow Visuals

End Result

Flying Enemy

My goal for the flying enemy in this personal project was to have a flying enemy that could navigate a 3D level (including height differences and walls blocking of vision to a player). I also wanted to add an extra movement mechanic to the enemy.

​

To complete the goal I did research and concepting. I eventually came up with a system to make flying navigation and for the other mechanics I was going to add a dash and dive that the flying enemy would be able to perform.

​

Working on this enemy has taught me lots about working with custom enemies.

The first thing worked on was the navigation of the flying enemy. After testing multiple plugins I opted for a custom system made by myself that would be comprehensive and easy to use. The enemy uses line traces to see and when there is collision blocking them they can generate naviagtion on the ground using a navmesh.

FlyingPathfinding.gif
FlyingFiring.gif

Next step was to add attack logic on the enemy. I made it so the enemy hangs stationary in the air while targeting the player. After X seconds the enemy shoots a projectile.

FlyingMovement.gif

Now I added logic to have the enemy fly in a more up and down matter to make flying look and feel more natural. Tweaking logic so the enemy would never reach the ground while pathing.

FlyingPassiveState.gif

Using a line trace to detect the player and a delay I added the logic for an enemy to go into a passive state once they lose the player out of their sight. Allowing for enemies to stay in their spawn location without needing boxes to keep them in.

EnemyManagerAttacks.gif

Next I solve the issue of having too many enemies attack the player at the same time. I introduce an enemy manager that communicates with the enemies to ensure there is a maximum of X enemies attacking at the same time.

DivingEffect.gif

Lastly I added a model, animations and VFX to the enemy to complete the enemies implementation. All of these things are bound to variables and can be easily changed.

Ground Enemy

My goal for the ground enemy was to make an enemy that could traverse a 3D level. Including height and walls blocking vision. To do this I implemented movement and spline jumping for the enemy to allow them to follow the player when they jumped away.

I also added an extra movement mechanic in the form of burrowing. Here the enemy goes into a burrow and moves to a burrow in line of sight of the player if possible and performs an attack. This has taught me about how to further improve ground enemies and add custom behavior to them.

BurrowLunge.gif

First thing I did after creating the base enemy was add a burrow actor and create logic for the enemy to 'use' it and burrow to another one of the actors.

BurrowVisuals.gif

Next I added visual feedback to the enemy using these burrows in order for it to make sense to players. This really helped with making the mechanic understandable and fair.

BurrowIndicator.gif

Lastly I finished the enemy by adding a model, animations and visual effects. All are bound to variables and easily changed. They also help a lot with clarity of gameplay.

Custom Nodes

Node1.png
Node2.png
Node3.png
Node4.png
Node5.png
Node7.png
Node8.png
Node9.png
Node10.png
Node11.png
Node12.png
Node16.png
Node17.png
Node18.png
Node19.png
Node20.png
Node22.png

 

This node is used to set a bool variable to true or false to enable/disable logic at certain points in a behavior tree.

 

This node is used before attack logic to see if the enemy is allowed to attack. Whether the enemy can attack or not is decided in the logic of the BP_EnemyManager.

 

This node is used after an attack is successfully completed to signal to the BP_EnemyManager that the enemy is done attacking and a new spot opens up for another enemy to attack.

 

This node sets the velocity of the enemy actor to 0, stopping all current movement.

 

This decorator is used to put a cooldown on a node. Using the deviation variable, the cooldown will be randomly adjusted every time it is triggered to a value in range.

 

This service is used to line trace to an actor and return whether the actor can be seen or not.

 

This service is used to line trace only horizontally to an actor and return whether the actor can be seen or not.

 

This node is used to find the nearest actor of a specified class in range. It uses the navmesh to accurately decide what is closest.

 

This node is used to smoothly move to a point. It will instantly return logic as it can constantly adjust walk paths instead of the built in ‘Move to’, which consumes the input until the enemy reaches the destination.

 

This node is used to find a point around another point in radius, allowing for enemies to walk around that actor when standing idle or not attacking. The node also takes into account that the enemy should not try to walk through the player and only picks point that do not go through the player.

 

This node is used to communicate to an enemy that has BPI_GroundAttack implemented to perform the attack with the specified ID.

 

This service is used to project a given point onto the ground to use it for something like ground movement pathing. (This fixes issues like the player jumping and therefore not being able to be followed by enemies).

 

This node is used to set the velocity of an actor towards a point. Specifically used to propel a flying enemy towards the correct points to path in the air.

 

This node is used to rotate an actor towards another actor in all 3 directions. Specifically useful for rotating a flying enemy towards a specified actor.

 

This node makes it so the enemy picks a point at an angle and flies around that point for specified duration.

 

This node is used to get the first path point to a point for the enemy to path to. The point will be generated on the ground so navigation can be used.

 

This node is used to perform a charged beam attack that charges up and after the charge time performs attack logic.

bottom of page