top of page


Main contribution: AI

By: Moth Pit

Team: 21 people

Duration: 14 weeks

Engine: KAOZ Engine (C++)

The AI system


For the AI system I used a finite state machine with a slightly different set of states for each enemy type. This worked well, but as the project went on and I wanted more and more complex behaviour it got quite hard to follow. At the tail end of the project we had a course in Behaviour Trees and that was a real eye openor for me and I was really excited for the possabilities it presented. Unfortunatle there was no time to rewrite the stystem. If I had done it again I would probably have tried to combine a FSM with BT for more flexability and readability of all behaviours. 

Spite-Reckoning Of Hunger_scr_03.png

Enemy communication


Our main enemy was a small imp that were often encountered in large numbers. To make their behaviours interesting and feel more realistic I decided to add some additional behaviors that they didn't need individually, but would make them appear to work together. The first was a "call for help" system were the first enemy to notice the player would alert other enemies close to it of the players precense and its position. To avoid issies with the player clipping in and out of range and retriggering this effect I added a cooldown. I also added an extra condition to prevent an enemie that had been called from calling new enemies. At first we thought about making an effect above the enemies heads to indicate when they call for help. But after a quick talk with animator Arvid we decided a special animation would be cooler. In the end we added both a calling and a called animation and I think it turned out very nicely.

Flocking behaviour


The second thing I added was an addition to the movement of the imps. In the first iteration they all looked for the closest path to the player and naturally they stacked up quite alot. The solution I used was something I had learned during a assignment with a boids system. I added a seperation force between the enemies in addition to normal movement. It was difficult to find a good balance between avoiding stacking and still making them move nicely and not getting stuck. 

The Boss


Our final boss required som additional tweaking from the normal enemies. First of all we wanted it to have different phases were each one changed or enhanced the abilities and behaviors in some way. I solved this by creating a enum with the phases and checking in the states what phase he was in. Some states had only minimal changes but others had new animations or effects and some had new abilities and transitions to states that only existed in that phase. As I mentioned in the AI system overview it became quite hard to read in the end, but it worked and I think the fight turned out decent despite this. Unfortunatly we never got the effect shaders to work the way we wanted in the engine, so that extra polish that we were hoping for was absent.

bottom of page