Lair of the Beast

Technical Designer

Studio : Carcajou Games

Platforms : PC

Type : Multiplayer combat

Skills : Game, AI, UI programming, C++ and game design

Time spent on the project : 2 months

Engine and tools : Unreal Engine, Perforce and Confluence

My contribution

During my internship, I programmed 4 different types of AI behaviors, designed and documented all their behaviors in Confluence.


Monsters

I had to create 3 different types of monster behaviors to act as obstacles in the game. Some were more strategic (goblins), others more teamed up (spiders) and finally some that would be more independent and would be revived after a certain amount of time when killed (skeletons). I also needed some of the monsters in the game to be able to communicate to each other, so I created a system that would centralize any information necessary to be shared in a team of monsters.


Humains

The last type of AI I had to create were humains. They all had the same behavior, but some had more powerful stats and could advance in specific regions. For that, I used NavigationFilters and assigned some regions for the AIs to start with so the stronger ones could start in more difficult areas.

Their behavior was kept simple for now. The goal was for them to loot until their max capacity was reached, then would deposit what they had. If there was ever a monster in their way, they would either run away or fight depending of the situation. If a bigger threat was present, they would hide and go out from time to time to see if it’s safe and start looting again.


Optimization

As I was creating the AIs, I kept the performance of the game in mind. And as soon as I realized that the game would need hundreds of AIs in a level, I had to find a quick solution because this many behavior trees will downgrade the performance of the game.

I used a plugin called NPCOptimizator in the Unreal Marketplace, but I noticed that it doesn’t work in a multiplayer game. I then started looking in the C++ code with the help of Jakob Bouchard. I had the opportunity to learn more about C++ and was able to have all the players included with the plugin.

With the component added to the AIs, instead of having about 15fps with 324 AIs in a room, I was able to get between 35 and 50 fps already.


Post-Mortem

I’ve learn a lot during my internship. I managed to create a system that could shared information between monsters in a team. I’ve had multiple challenges that I was able to overcome and although my AIs couldn’t be perfect, I’m still proud of how much I was able to accomplish in 2 months.