Enemy AI Improvements
Author: Gabriel Alvarez
Issue-
Previously, I added an enemy AI that would patrol an area, search for a player, run towards them and attack them. While the enemy AI worked, it did not do a great job at what it was supposed to do. Due to this, some improvements had to be made to the enemy AI.
Fixes-
While I maintained the same basic functionality of the enemy AI, a lot of the code had to be changed. The enemy still uses Root motion in order to blend its animations with its movement, but the way it knows where to move was completely changed. Furthermore, their animations were also fixed and some of the major bugs, such as rapidly spinning in place or patrolling to an area that they could not move to were also changed. Finally, since the enemy AI base was finally functional, I decided to start making the AI for another one for another one of the enemies. This enemy is called a Seeker, which unlike the regular enemy does not target the player when the player enters their field of vision, instead it will target the player if it "hears" them. To simulate the player's sound, the player emits a sphere whenever they move. This sphere is based on their velocity and if the sphere enters the enemy's hearing radius, the enemy will target the player until the player exits the hearing radius for some period of time.
Added/Updated items below-
- Enemy AI
- Attack State
- Controls what the enemy will do once they get close enough to attack the player. The enemy will deal damage to the player if their collider actually collides with the player's collider instead of dealing damage whenever they play the attack animation.
- Pursue State
- Controls what the enemy will do once they see the player.
- The Enemy will stop pursuing the player if they exit their line of sight.
- Patrol State
- Controls what the enemy will do once they exit their idle state and start roaming around their designated area. The enemy will no longer get stuck trying to go to areas that they cannot reach.
- Attack State
- Seeker AI
- Attack State
- Same as the Enemy AI
- Pursue State
- Same as the Enemy AI.
- The Seeker will stop pursuing the player if they exit their hearing radius for a period of time.
- Patrol State
- Same as the Enemy AI.
- Idle State
- Same as the Enemy AI.
- Attack State
Later updates will add -
- More types of enemies.
- More attacks for each type of enemy.
- The Seeker will have a melee and ranged attack based on their distance from the player.
Files
Get 731
731
Status | In development |
Author | OctothorpeFSU |
Genre | Shooter |
Tags | Horror, Singleplayer |
Languages | English |
More posts
- Cutscene Fixes, player breakable glass and Knife SparksJun 23, 2023
- managers, props, and hazardsJun 22, 2023
- Cutscenes, Breakable Glass and Shooting FixesJun 17, 2023
- menus, sound, and notesJun 16, 2023
- Managers/HUD/particle/and splash screen updateJun 09, 2023
- Amaterasu and Map UpdatesJun 02, 2023
- crosshair colors and hit marker added plus two new notesJun 02, 2023
- Enemy and Map Menu UpdatesMay 27, 2023
- hazard update, splash screen, objectives, and modelsMay 26, 2023
- Expanding the EnvironmentMay 23, 2023
Leave a comment
Log in with itch.io to leave a comment.