Introduction:
I’ve extended the zombie game’s codebase further by implementing two new additional enemy types in the form of an agile zombie, which moves and attacks faster but has less hit points and a grunt marine unit with a large health pool and prolonged attack animation. These two new enemies introduce an additional state to the FSM model I had previously developed for the original zombie enemy and is exclusive to their AI behavior. Additional features include a performance boost, new models & animations and an updated stats system with health regen.
Summary:
Retreat State: When the agent’s health drops below a specified custom threshold, the AI will compute the furthest waypoint from the last known position where the threat (player) was encountered and use it as a target to move towards. Upon reaching close enough to the retreat waypoint, the agent will restore its current health to the maximum value which it spawned with. If the agent encounters the player along its path while retreating, it will compute a new furthest waypoint to travel to based on the updated player position it encountered.
Health Regen: The original slower zombie’s health system has been updated due to its simpler FSM model and it now regenerates health over time during the wandering phase if it’s current health is lower than the maximum value which it spawned with.
New Model & Animations: The agile zombie enemy has been implemented with a new model obtain from Adobe Mixamo and features different animations to distinguish it from the original. The grunt enemy unit uses the same model which the player character has but with a darker shade material to be easily distinguishable. It also features different animations which are used to reinforce the distinction of its AI behavior.
Performance Updates: Performance has been improved across throughout the project due to how coroutines were previously used for the FSM model. Now they are timed and managed correctly using a dedicated set of variables that ensure the correct coroutine is called at right time for its associated state.