Roaming EnemyAI Progress


I am back with another blog post the last one for this month at least for Team Terror Forge.  The game is still in its early stages but a lot of progress has been made not only networking-wise but AI-wise as well. There are now mirrors in the game that are functional but still a little wonky as well as our first enemy a roaming enemy. For this week my soul time was spent on fixing the enemy Ai and getting it to do its first task which was to roam.

The AI of course was causing me a lot of issues as it usually does the first issue I had was an out-of-range exception error that was really making it hard for me to debug anything besides that error. The error was in my find closest player function which was designed to find the distance of the closest player to the enemy I spent a lot of time debugging and got some help from my teammates. The way I fixed this error was by adding a null check for my GameManger since it seemed that the list of players was null and somehow empty.


The Second issue I ran into was my Roaming Enemy AI not roaming there were a lot of things that were causing this to happen. The first cause was the roaming function I had not been called at all. The second cause was the StartCoroutine not being called and used in the right spot another cause was I was missing a yield return null. Debugging where I was making the calls to my function as well as researching how StartCoroutine works helped fix the issue I was getting. The final issue I was having with my AI was it only roamed to one specific position and did not go anywhere else after and it was also roaming to the edge of the map. The first issue I fixed for this was going to the edge of the map this fix was easy because I had a roaming dist variable which made it how far the AI traveled all I had to do was shorten it. for the AI not constantly roaming fix, I just took the logic for roaming and put it into a loop so that It continuously roamed.

Get Mirrors

Leave a comment

Log in with itch.io to leave a comment.