Devlog #4 - AI and Sound
This week I started work on AI using Unity's new Behaviour Graphs. Behaviour graphs allow for quick and easy creation of NPCs with advanced capabilities. I wanted to create a squad system, where having a squad leader will give buffs to the enemies stats (accuracy, reload speed, burst size).
If a squad member has no squad leader for a significant period, they will become “rogue”, unable to join a squad and have default stats. A squad member can find a new squad leader, and reaching them will trigger them joining.
This week I was only able to work on the rogue. They are able to search for the player, attack and retreat when on low health. While searching the map, if you shoot the enemy, they will target you.
I also added and synced sounds this week. I created a sound manager that sends a oneshot over the network for all the players, the volume being adjusted based on the distance from the source. I might revisit this solution later however since it feels off. I also implemented aiming for the player, which heavily reduces recoil, and gun reaction to firing.