Skip to main content

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

Enemy State Machine Update

Hello again this is my second blog post for this month for Team Terror Forge  This week I worked on updating the enemy state machine and getting it ready for next week.  I made some changes to make the state machines able to transition back and forth with each other. At first, they were only able to enter the state and then that would be it they wouldn't be able to exit but now with the implementation I did, they can transition in and out of their state depending on certain conditions


So when implementing this the first issue I ran into was how the states would exit. My solution to this was quite simple I implemented an enter and exit trigger logic to my states and some bool checks as well as an exit state. The issue I was running into was that the triggers weren't ever being activated I found this out after debugging a little. I didnt understand why they weren't being called for a while but I came to a conclusion which was that the problem was because the triggers weren't the original and did not have ownership so I  took the logic of the triggers into my state machine and had it pass the logic to my other triggers in my different states. 



The second issue I encountered was significant, but the first challenge involved transitioning states. Despite having triggers set up correctly for exiting states, the logic was not being executed. This was a simple fix; I just needed to pass the logic into my update state.   The second issue was more complex: implementing the chase and attack state logic. I couldn't complete this task due to several code-related roadblocks and the structure of my state machine. I have a few ideas for implementing the chase and attack functionalities, but it will require considerable effort and time. This includes giving the AI a vision system to detect and pursue the player, among other things. The implementation will need careful planning and problem-solving.

Support this post

Did you like this post? Tell us

Leave a comment

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