Enemy AI and other minor fixes


Author: Gabriel Alvarez

Issue-

Previously, our game didn't have any adversaries that the player could harm or be harmed by. There was also a major flaw with the weapon wheel. Since our player started with all the weapons from the start, they did not have to keep some kind of storage for their weapons. This meant that when we switched our weapon system to one where the player starts with nothing and picks up the weapons as the game progresses, the weapon wheel wouldn't work correctly.

Fixes-

I added an enemy that patrols a designated area and locks on to the player when they enter their line of sight within a specified radius. The enemy then runs towards the player and attacks them when they get close enough. If the player shoots them, their HP will decrease until it reaches zero, at which point the enemy dies. I fixed the way the weapon wheel works after one of our team members made it so that the player has an internal weapon storage that keeps track of the weapons they have picked up. This way, the weapon wheel will only display the weapons that the player has picked up as opposed to every single weapon in the game.


Added/Updated items below-

  • Enemy AI
    • Attack State
      • Controls what the enemy will do once they get close enough to attack the player.
    • Pursue State
      • Controls what the enemy will do once they see the player.
    • Patrol State
      • Controls what the enemy will do once they exit their idle state and start roaming around their designated area.
    • Idle State
      • Controls what the enemy does right when the game starts.
  • Weapon Wheel
    • Updated the way the weapon wheel chooses which weapons to display.
    • The weapon wheel disappears when the player shoots or reloads.


Later updates will add -

  • Ability to lose enemies once the player gets outside of their line of sight and sight radius.
  • Overall improvements to the enemy AI


Known Issues-

  • I disabled the ability for enemies to lose the player by exiting their line of sight, as not doing so would cause them to act irrationally. Currently, I am working on fixing this in order to give the player a fair chance to fight. 
  • The enemies might also spin around uncontrollably until the player enters their line of sight.

Files

731 installer + level 1.zip 30 MB
Mar 24, 2023

Get 731

Leave a comment

Log in with itch.io to leave a comment.