This week was about AI decision making. There is a lot of ways of going about decision making, between decision trees and different types of finite state machines.
The first task was creating our own decision tree for a bot with a few different behaviours, such as attacking, fleeing, wandering and healing.
Next was creating a finite state machine for a guard with a few behaviours such as patrolling, searching for enemies, and attacking – all with different ways to pass between them.
And after that, that finite state machine had to be adapted to a hierarchical state machine, expanding the search state and the attack state.
The second lab session was all about the portfolio feedback, so in the background we got asked to research some open problems in the game Ai, something we mostly talked about without writing anything down.
On the Zombie game front, we added a new state to our state machine, chasing – the enemy can now check whether the player it’s within its cone of vision, and if so will chase the player until it no longer sees them. We also added the ability to change between states, so this can be actually done. Additionally, we want the zombie to be able to die – to do that first we have to do the red section from last week which describes how to make the character able to punch – we are adding a new animation to the animator, as well as a check that makes it able for the character to punch – it came out kind of wonky, but you can see that it’s supposed to be an animation of a punch. Once we have that set up we can continue with killing the zombie. We first create a ragdoll using the unity ragdoll wizard, this way we can make the enemy flop once it dies, and make sure we activate it in-code. Then we create a trigger collider on the player’s right hand and create a script that checks whether we’re pressing the attack button, and if so turn the collider on – and then check if it’s hitting a zombie, and if so invoking their kill function. Additionally, as an extra thing we were told to texture the walls at our own leisure.