Tex-Mechs – Combat Design
Enemy AI
One of my responsibilities on the Combat Design team was to design the three enemy AI and implement their behaviors using Behavior Trees.
The three enemy types are Soldiers, Grunts, and Spitters. Soldiers are the basic, most common enemy. Grunts and Spitters are special enemies whose behaviors are meant to complement the Soldiers.
My primary design goal was to create a composition of enemies that forced players to be constantly moving. At the same time, it was important that the enemies be indiviudally challenging enough so that the player feels powerful after killing them.
Soldiers
When Soldiers see the player, they alert all nearby enemies and begin chasing the player. When close enough, Soldiers will pause briefly before performing their attack. They charge at the player in a straight line, stopping only when they hit the player or reach the end of the attack.
Soldiers are designed to force the player to move laterally. Players must sidestep a charging Soldier if they want to avoid damage. When multiple Soldiers are charging at the player, it creates a high tension moment where the player must try to predict the paths of a group of stampeding Soldiers.
Initial versions of the Soldier enemy had it simply running up to the player and performing a bite attack. However, this made their behavior too simple and predictable. Players would end shooting a vertical line of Soldiers without having to change their aim or position.
Grunts
When they enter combat, Grunts will approach the player by moving in a zig-zag motion. When close enough, Grunts will stop and explode after a brief delay, dealing major damage to everything around them (including enemies). If the player kills a Grunt, it will immediately detonate.
Grunts are designed to move the player backwards. Players naturally want to back away from Grunts because of their explosive nature. On the other hand, a well-placed Grunt kill can be used to take out multiple enemies at once. This creates a high-risk, high-reward decision for players to consider in the middle of combat.
Spitters
Spitters are the game’s ranged enemies. When in combat, they will try to approach the player to perform a attack. When in range, Spitters hold their positions and begin firing globs of acid at the player.
Because Spitters are ranged enemies, players will naturally want to move towards them to kill them more easily. By using Spitters to provide ranged support to Soldiers and Grunts during combat encounters, the enemy AI feels more intelligent overall, and defeating them becomes more rewarding.
If given more time, I would have liked to make the Spitter’s behavior more advanced by having them move around between shots.
Combat Encounters
As a member of the Combat Design team, another one of my tasks was to implement the game’s combat encounters. I designed the encounters in the first three levels of the game: the Tutorial Level, Quarry Level, and Riverbed Level.
To create each combat encounter, I used a combination of Triggers, Data Tables, and Spawn Points (example given below). Data Tables were used to control what type of enemy would be spawned, how many there would be, the Spawn Point they would spawn from, and the time before the next wave spawned. Unfortunately, the team was not able to develop any of the other functionalities listed on the data table (KillsBeforeNextWave, SetThreatLevel, ImmediateDestinationPoint). The only way for me to control when the next wave would spawn was by using time.
Because of this, I had to predict where the player’s focus would in the middle of combat. I wanted to avoid having too many enemies spawn behind the player. When players start getting attacked from behind too often, they begin to feel frustrated. I also used enemy spawns to control the players path throughout each arena. In most cases, player’s tend to move towards enemies in order to shoot them more easily.

Tutorial Level

All of the combat in the Tutorial Level is designed to help introduce and teach the game’s mechanics. To facilitate this, each encounter is designed to be very easy. The player’s objective is to simply reach the end of the level.
Encounter 1: Stomp Tutorial
The purpose of this encounter was to help teach the player the behavior of the Stomp attack, a short range Area-of-Effect melee attack that kills all enemies in a circle around the player. When the player begins the encounter, a small group of Soldiers spawns right in front of the player.
Providing the player an opportunity to use the Stomp immediately after learning about it reinforces their education of the ability. Addtionally, I made sure I had a Soldier spawn just oustide the Stomp’s effect so the player can better ascertain the Stomp’s range.

Encounter 2: Grunt Introduction
This encounter meant to introduce the player to the Grunt enemy. It starts with a small wave of Grunts spawning a safe distance from the player, followed soon by a second wave of Grunts mixed with Soldiers.
When the player sees the Grunts spawn for the first time, their first reaction is to shoot at them. Players will see how killing the Grunts makes them explode and immediately learn their behavior.

Encounter 3: First Major Fight
This encounter is meant to be the player’s first taste of the game’s typical combat experience. Several high-volume waves of Soldiers and Grunts spawn, each with a different composition of enemies.
Additionally, this is the player’s first encounter after picking up the Flamethrowers. To reiforce the player’s learning of the Flamethrowers, I had the encounter start with a group of Soldiers spawning right in front of the player.

Quarry Level

The Quarry Level is the second level of the game. As the first non-tutorial level of the game, its combat is designed to reinforce the mechanics the player learned in the tutorial. Because of this, the overall difficulty of the level is meant to be on the easier side. The Quarry Level’s exit is blocked by a locked gate. To unlock the gate, the player must activate a generator next to it. Once activated, the generator begins powering up slowly. When the generator reaches full charge, the gate unlocks.
Encounter 1: Entry Trigger
Immediately after the player drops into the arena, a large group Soldiers spawn right underneath the player. This is an ideal scenario for the Stomp attack. When the player uses it, it reinforces their player’s knowledge of the mechanic.
Several more waves spawn around the arena after awhile. However, players tend to miss these enemies because of how quickly they clear the first wave. This makes the level feel empty. If I were to go back and reiterate this encounter, I would have the next waves spawn much sooner.

Encounter 2: Generator Fight
The encounter begins right after the player activates the generator. Because of the generator’s position, players start the encounter backed into a corner. I utilized this positioning to create a “final stand” encounter. Giving the players nowhere to run created a intense, claustraphobic combat experience.

Riverbed Level

The Riverbed Level is the third level of the game, the halfway point of the game. Combat difficulty is meant to increase dramatically in this level. It is also the first time the player encounters the Spitter enemies. The player’s objective is to destroy three bug mounds. Every time a player destroys a mound, several waves of enemies spawn in retaliation. Additionally, a couple waves of enemies spawn naturally as the player traverses the level.
Encounter 1: Mound A
When the player destroys the first mount, a couple of huge waves enemies spawn close by. The intensity of the encounter highlights the significance of these objectives to the bugs, making them feel more like real beings. It also lets the player know what to expect when they destroy the other two mounds.
Additionally, I placed several Spitters on the ridge above the mound. By having the Spitters continuously fire projectiles at the player from above, the player better understands that they are ranged enemies.

Encounter 2: Trigger 1
Originally, the combat in the Riverbed Level was came only from destroying the three mounds. However, having zero combat between each mound encounter made the instensity of combat rise and fall too jarringingly. I added a couple of trigger-based encounters to maintain the flow of the combat experience.

Encounter 3: Trigger 2
Like Trigger 1, this encounter is simply meant to fill in the down time between destroying each mound. When the player crosses the trigger, a medium-sized group of Soldiers spawn at the end of the level.

Encounter 4: Mound B
The second mound is located in the lower half of the Riverbed Level. I placed the mound here because I wanted players to have to choose between the two different paths in the level.
Significantly more enemies spawn from this mound than mound A. I wanted the difficulty of combat to steadily ramp up as the player progresses through the level.

Encounter 5: Mound C
The final mound encounter is meant to be the climax of the Riverbed Level. When the player destroys the mound, they are quickly surrounded by a huge number of enemies. I wanted players to feel like they were being overwhelmed in order to make the encounter feel as dramatic as possible.

Postmortem
What went well...
- Using data tables to control spawns made it easy to playtest and reiterate encounters.
- Using Behavior Trees and Blackboards to create enemy AI behavior worked much better than just using Blueprint only.
- Spawning many small groups of enemies instead of a few large groups made combat flow much more smoothly.
- Collaborating with Software Engineers on a daily basis allowed for smooth implementation of all three enemy AI
What went wrong...
- Not having additional tools to control wave spawning (such as KillsBeforeNextWave) made it much harder to balance combat.
- Having to redo all three enemy AI in the middle of development left no time to polish the behaviors of all three enemies.
- Spitters tend to stand still during entire combat encounter made them feel boring and unintelligent.
Even better if...
- Having enemies be aware of other enemies (such as Soldiers staying away from Grunts) would make them seem more intelligent.
- Using Boid’s to create flocking behaviors would have made enemies feel more intelligent and organized.
- Using EQS would have reduced the overall number of pathing bugs the team encountered during development.