Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Enemy AI &Restructure

I am back with another Dev log this is going to be my second log for team Terror Forge. Still in the early stages of our game and a lot has been done. The networking of our game has gotten better and there's now a map with room randomization. What I worked on this week currently was creating a hagiarchy for the components we will need for our game such as a Game Manager, Base Character class, Base Enemy class, and our first enemy.

The hagiarchy components took some time but what I was really focusing on was our first enemy Its purpose was to roam around with random positions until it saw a player and then it would attack but that's a lot of things to get done with the amount of time we had so we cut it to just the enemy being able to roam around and chase the player. The first issue I was running into trying to implement this was the enemy could not see the player though the player tagged its line of sight wasn't deciphering what was the right target the enemy had sight of the ground and any objects in its way including itself. The fix for this was creating a distance from the enemy and the player a hit container to see what the enemy was seeing, and a line ray cast that helps see if the enemy was looking at was what it was supposed to.  I also added an if check that checked if what the enemy was seeing was what it was supposed to as well as if the distance was close enough to the enemy for it to start doing its action.

The second issue I was running into was the enemy moving towards the target. This issue was fixed when I added the if check that checked if what the enemy was seeing was supposed to be its target and not itself as well before it did its action. I was currently looking at the process, code, and time it took to just get this functionality to work and realized I might be attacking this implementation all wrong I have an idea of what would be a better and improved way of getting our AI to do what we actually want and plan of discussing further steps with the team about it and get started once more on AI again.

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.