Rumba Enemy Only Moving Between Two Points


Author: Ethan Ortega

Problem: While I was reworking our rumba enemy, Madeline the Maid, I was changing the task that would control her movement. Through the first implementation, I realized there was a big issue with her movement. Through the first implementation, after a couple of seconds of her movement, she would eventually move only between two points and sometimes she would stop moving. I realized the problem was the whole implementation since at first, I was removing points that the enemy could go to and then choosing from the points I made available. The problem with this is the references for those points were being lost and not chosen as an option to move to.

Solution: I went back to her movement task and reworked the whole thing. I started by making the movement more randomized and not allowing her to backtrack. Next, I kept another array that would be a copy of the main patrol points where those patrol points would be removed if she had visited it. After a certain amount of visits, that spot would become available again. After these reworks and fixes, she now moves randomly around the room and feels like more of a threat to the player.


Leave a comment

Log in with itch.io to leave a comment.