top of page

Mech Arena Fighter

Engine: Unity 5.6

Language: C# / PandaBT (Behavior Tree)

Primary Role: Programmer (A.I.)

​

A.I Assignment (University - Solo)

Mech Arena Fighter: Text
AI_Assignment3_01.JPG

Overview

The aim for this assignment was to create a "Human-Like"A.I that controlled a mech in a arena shooter game. The A.I. did not need to replicate good human-like behavior, but rather needed to emulate good and/or bad qualities that any type of player could show (meaning we could create an A.I that camped a single point as this is a behavior that some players could display). Once again the project base was provided by the uni (including the mech models, main menu and maps, as well as a extremely basic A.I. that used a simple FSM).

Mech Arena Fighter: Image

Details

The decisions that the A.I makes are all controlled by behavior trees. These behavior trees were created using code from a unity plug-in asset called PandaBT. This plug-in simplified the creation of behavior trees using their own custom scripting language. However, we were very limited on what we could manipute on the A.I. Actions such as the movement of the mech and where it could look. This was limited to feeding a game objects position into the respective functions. So it was quite difficult to create human-like behaviors within these limitations and the timeframe.

​

The tree that I implemented involved two sets of trees. The root tree was responsible for the movement of the mech, deciding when to attack and when to flee etc. The other tree was responsible for the decisions around which weapons to fire. The tree would be called from the root tree in the attack or fleeing states whenever ther was a target LOS established. The firing tree used distance and ammo checks to determine which weapon(s) was/where the best choice for the current situation.

Mech Arena Fighter: Image
Mech Arena Fighter: Gallery

Contribution

Along with making the two custom behavior trees, I made a lot of changes to the original code. In the attack function i made the A.I move towards the enemy at an angle and once it got within close range, the A.I would strafe around. If the A.I decided to flee, it would find a healing point that was far away from the enemies position. If the A.I isn't currently fleeing, yet wasn't fully healed, it would target the closest non-recently visited healing point until it reached fully heal and energy. I also programmed in some indecision with the A.I, where by if it was not currently in a fight and it suddenly was being shot at, it wouldn't suddenly turn and aim at the incoming attack. However, if the A.I is already fighting an enemy while being shot at and the new enemy is around the same distance from the A.I. it would hesitate before picking randomly between the two enemies to shot at.

Mech Arena Fighter: Text
Mech Arena Fighter: Gallery
Mech Arena Fighter: Text
bottom of page