Wolf and Ghost


Our game is a cross between Pikmin and Pac-Man for Ludum Dare 41. While I think the Pikmin influence is clear enough (moving a ton of sheep), I wanted to talk more about the Pac-Man influences. The ghosts in Pac-Man follow a few simple rules for seemingly complex behavior, which I tried to replicate with the wolves in Shepherd and Sheep. Some things worked well when I combined it with the real-time strategy genre, and other things not as much.

After 20 seconds, wolves will stop whatever doing and retreat for 5 seconds before resuming their attack.



This was in the original Pac-Man too. Being constantly chased is stressful, so the 5 seconds of safety is to let the player breathe. I chose 20 seconds because that's what Pac-Man used in the first level, but now I think 20 seconds is too long for such a fast-paced game. Shorter but more frequent breaks probably would have felt better.

There are 7 wolf patrols in the game. Every wolf, when it has line of sight to a lone sheep, will stop its patrol and give chase in a straight line. Fences, rocks, the shepherd, the dog, and sheep in a group will block line of sight. If a wolf doesn't have a line of sight, it will resume its patrol.


The first wolf, which I refer to as the alpha wolf, will just chase down a sheep, and is based off of "Blinky" the red ghost.


The alpha wolf ended up being far too aggressive, and will break up the flock of sheep too easily, so the alpha wolf isn't present in most levels.

The second wolf is based on "Pinky" the, uh... pink ghost. This wolf will move in the direction a sheep is moving towards.


Note that I use velocity to determine the direction a sheep is moving, so when the sheep stopped moving (velocity=0) the wolf started moving in. This is actually a problem because most levels are easier if you move your sheep slowly, but this caused this wolf to get too close. I used this wolf more than the alpha wolf, but still not as much. Because Pac-Man used tiles and not velocity, Pinky didn't have the same problem.

The third wolf is based on "Inky" the cyan ghost. Just like Inky, this wolf is a little more complex than the previous wolves, but basically it moves to the opposite side of the alpha wolf, such that the sheep is between it and the alpha wolf. In the following gif, the alpha wolf is on the left side. On the other side is the Inky wolf.


Because I don't use the alpha wolf much, this wolf didn't see much use. However, I made two equivalent wolves that move to the opposite side of the shepherd and the dog using the same approach. I used these two quite a lot.



I think these wolves were the most fun to navigate around, as they aren't too aggressive but still close by.

The sixth wolf just circles around the sheep. It's not explicitly based off any ghost, but this and the next wolf are similar to the final ghost I'll describe later.


Like the previous two wolves, this wolf wasn't too aggressive and was used a lot. Note that this wolf kind of spazzes out when he gets close to the four corners of the circle. This is because the up/down and left/right velocities are the same at these points, which is how I chose which direction sprite to use. I'm sure other programmers have felt this pain.

The last wolf just guards a point. After moving from its spot, it will move back.


This was my most used wolf, as it could be put in choke points and other spots without always following the player.  
The final ghost, "Clyde" the yellow ghost will follow Pac-Man, but once he gets too close, he'll return to his designated spot. Because of how the ghosts behave in Pac-Man, once he arrives, he doesn't stop, but instead will start circling is spot until Pac-Man moves further away. In this regard, Clyde inspired my last two wolves.

There is no pathing whatsoever in this game, but by combining these behaviors, it looks like the wolves are trying to surround you!


If you want to read more about the rules of Pac-Man, this is a great article.

And of course, play and rate our game! Thanks!

https://ldjam.com/events/ludum-dare/41/shepherd-and-dog

Files

Shepherd and Dog (Win64) 701 kB
Apr 25, 2018
Shepherd and Dog (Win32) 599 kB
Apr 25, 2018
Shepherd and Dog (Ubuntu 16.04) 260 kB
Apr 25, 2018
Shepherd and Dog Web Play in browser
Apr 25, 2018

Get Shepherd and Dog

Leave a comment

Log in with itch.io to leave a comment.