top of page

More Combat and starting Evasion

This week I fixed a few bugs and added a shooting function to the combat. I made a test build of the game and discovered that I had some major issues with game not finding the character, so instead it spawned a default character with none of the functionality I had set up. This turned out to be down to the animation starter pack character that I imported so i had to do a lot of re-parenting to fix it. Thankfully I found this now and could deal with it rather than closer to the deadline.

AI Shooting function

to add some functionality to the AI weapon handling I updated the Tasks I previously had set up to just look at the player, with aiming down sights and shooting. The player character which is the parent of my AI, already has events set up for these so I could call them where I needed them in the AI tasks and override them in the AI character blueprint.

Override

Any Function or Event used by the parent class can be overridden by the child, to make it do something different when called. So when I call the shoot function with an AI, I don't need any of the UI elements or ammo counts firing like I do with the player. With this in mind I made a more simplified version for the AI and took out all the ammunition counts except for the standard magazine, giving them unlimited ammo but still requiring a reload.

Starting on evasion

To start on the Evasion game state I have added 2 timers to be triggered after the AI reaches the player's last know location. When the AI reaches the last known location and can't see the player, a 10 second timer will start. During this first 10 seconds I aim to have the player hide while some of the closest AI characters search the immediate area.

When the combat timer is up a second timer will trigger and the Evasion state. During the Evasion state I aim to have different search patterns for different Ai characters. During combat I will spawn in extra characters to attack the player, so I will make the new AI characters move to areas of interest placed around the map, while my original AI's go back to their regular patrol paths to cover a wide range of the area. I will still have certain locations that the AI won't check unless the player is actively seen going there to make it fair for the player.

As of right now I am only testing with 1 AI character so it will go back to its normal patrol by default. I am thinking that I will set up and expose a bool to label the original AI's so I can check this when "switch to search" is called.

Progress Video

There are still quite a few things I need to improve on here. The AI half sticking out of cover and shooting the wall before doing so is definitely on the list. I will be adding a "Move to random location in radius" Node for when the AI reaches the ghost player too, so he wont simply stand on the spot. Other than that I have reached as far as I can go with 1 AI character so I will be working on groups of enemies from now on.


Recent Posts
Archive
bottom of page