Toyland Tales - Enemy Behavior


Date: 6/17/2024

Hello! My name is Joel Hill, and I'm the lead (and only!) programmer for our project Toyland Tales! This week I'll be talking about my side of the project, more specifically I will be talking about the enemies in our game: Dust Bunnies. Since we don't have a dedicated rigging/animator on our team the main challenge was ensuring the dust bunnies felt engaging enough for the players.

How They Work

Patrolling

Dust bunny patrolling the scene

The dust bunnies have 3 states: patrolling, chasing, and attacking. While patrolling, the dust bunny chooses a random spot in a 5-meter radius of it and begins pathfinding towards it. To make it feel more natural, right before the dust bunny reaches its destination and stops, it chooses a new spot to pathfind towards so that it looks like it is constantly moving 'patrolling'.

Chasing

Dust bunny chasing the player

When the player comes within sight range the dust bunny will immediately pivot and start heading directly for the player. The dust bunny will be about the same speed as the player, so they have a simple choice: run or fight.  If you keep running it will eventually catch up with you if you stop, unless you can outmaneuver it. 


Attacking

Dusty bunny getting ready to attack


Dust bunny attacking the player

If you choose to fight, the dust bunny will also attack back when in range. The dusty bunny only has a melee attack, so it has to get pretty close to the player to damage them. When in range, the dust bunny will play a simple animation of it stepping back like it winding up a punch, and quickly stepping forward and hitting you. If the player attacks the dust bunny, it will stumble back and interrupt its attack as well. This gives the player a variety of ways to 'dodge' the dust bunnies' attack if they so choose. 


That wraps up the devlog for this week! Stay tuned for even more features and mechanics to come!

Get Toyland Tales : A Quest for a Mended Heart

Leave a comment

Log in with itch.io to leave a comment.