Project Mercury
Project Description and Goals
Project Mercury is a fast paced first person shooter that takes placed in the ruins of a futuristic city. It is set in the year 2093 and tasks the player with fighting their way through a high-paced action filled level to collect the data and defeat all the robots. The goal of this project was to create a exciting game in unreal engine 5 and showcase the skills of everyone on the team.
My Role
I worked as an enemy AI programmer. I was in charge of programming the behavior for the slam, missile and shield drone enemies along with testing, balancing and bug fixing for those enemies.
My Contributions
Missile Enemy
The missile enemy is a far ranged flying enemy that fires a varied number of missiles at the player before running away to a random location and then trying again.
Shield Drone Enemy
The shield drone enemy is a flying enemy that doesn't attack. Instead it shields a nearby enemy, making it immune to damage until the shield drone is destroyed.
Slam Enemy
The slam enemy is a close ranged melee enemy that charges and leaps at the player, damaging them and knocking them back. Depending upon how close you are to it, it might just run at you and punch you without a leap as well.
Early Implementation
Implementation of Missile Enemy
The missile enemy had a unique early challenge in that it was a flying enemy and needing to be able to path find through 3-D space. This is something which unreal's pathfinding system does not support and I did not have the time to actually create a system from scratch for 3-D pathfinding. So instead I used a plugin called CPathVolume that could create a 3-D space of voxels. I then wrote my own pathfinding algorithm that used those voxels to allow the flying enemy to navigate correctly.
Behavior Tree of Missile Enemy
Created a behavior tree for the missile enemy that supports different behavior depending upon if the enemy can see the player or only hear them.
Implementation of Shield Drone Enemy
The shield drone enemy being a flying enemy uses the same pathfinding system as the missile enemy. Additionaly the shield drone scans for any enemies within a specific range, finds the one it is closest to and then navigates over to it and protects it from all damage until it is destroyed.
Behavior Tree of Shield Drone Enemy
The behavior tree for the shield drone enemy is extremely simple as all it needs to do is find the nearest enemy to protect.
Implementation of Slam Enemy
The slam enemy is a melee based enemy that is focused at running and leaping at the player. When it lands it checks if there is a nearby player. If there is they take damage and are knocked back.
Behavior Tree of Slam Enemy
The behavior tree of the slam enemy manages 3 separate behavior options. What to do if it sees the player, what to do if it hears the player and what to do if it can't do either.
Challenges
The most significant challenge I faced was Unreal's lack of support for pathfinding in the air. I had to use a plugin and write my own pathfinding algorithim to get it to work. Additionally as the project went on and sound stimuli was attached to more of the players actions, sometimes sound produced would overwhelm the enemies and cause bugs. This was just fixed with some small changes to some behaviours.
Final Implementation
After working on implementing several different enemies for the first part of the project, 2 of those enemies were chosen to be polished. Those were the missile enemy and the slam enemy. There were no real changes needed to the structure of the behavior tree, instead there were changes made to specific tasks within the tree and to code attached to the enemies themselves.
Implementation of Missile Enemy
The missile enemy got updated to fly away from the player, after a couple shots to make it harder to kill.
Implementation of Slam Enemy
The slam enemy received some significant changes on the difference in it's behavior when it hears the player versus when it sees the player. When the smash enemy first hears or sees the player different behavior is triggered depending upon which sense was triggered. If it hears the player it will just run to that location, although if it sees the player during that time it will interrupt itself and leap at the player instead. If however it instead sees the player it will check the distance between itself and the player and depending upon the distance either run at and punch the player or leap at and knock back the player.
Cut Content
Slam Enemy
The slam enemy used to disable the players advanced movement for a couple seconds if they got hit by the attack. This was removed because it did not end up being very enjoyable for the player.
Boss
Originally there had been plans to create a boss including creating a behavior tree and some of the tasks. The boss was cut because the team did not have enough time to finish the boss by the deadline.
What I learned and Future Goals
Throughout this project I learned how to work with Unreal Engine and got a more in depth experience working with and designing enemy AI's. I got firsthand experience on how to use blackboards, Unreal's Visual Scripting language and how to create behavior trees. I also gained a lot of experience working with a larger team along with working directly with another programmer, as there was one other programmer working on enemy AI. My goals after this project are to continue working with enemy AI and hopefully learn to develop more and more advanced enemy AI.