Jump to content
  • Advertisement
Sign in to follow this  
barbaari

Ideas for zombie movement

This topic is 2538 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

I am about to start programming a rather big zombie survival horror shooter / RPG. Right now I'm trying to come up with the movement system for the zombies. At first I was planning to make them move completely randomly but this would be too simple. Basically I'm trying to come up with some way to make the zombies actually scary and an actual threat without making them move fast, since that would be way too cheap. Movement-wise this would mean that the zombies would have to form groups. Another way to get this done is of course to design my maps so that it supports the threat of zombies: narrow corridors and closed yards etc. Another point is that the player will have a very limited number of ammunition at his disposal. As for the movement, here's something I've been thinking about:

Let's say a map has 50 zombies walking around. During the day time I was thinking that the zombies would be walking around more or less randomly, unless of course they encounter the player or if the player manages to draw their attention by loud shooting etc.; then the zombies would start approaching the player. But basically during the day the zombies would have a random direction into which they're heading, and every once in a while a new direction would be randomized for them. And of course they could also stand still.

But at night the movement system would change. The result I'd like to get is that at night the zombies would somehow start forming groups (angry mobs). One way to make this happen might be that let's say 5 of the 50 zombies on the map would be "master zombies". At night they would approach the player all the time thanks to their hyper senses (heh!) and whenever an ordinary zombie encounters one of the master zombies, it would start following the master zombie. This way the masters would sort of "collect" all the normal zombies on their way and they would form a dangerous group. Again in the morning the zombies would go on their own ways.




One point I should make is that when you kill a zombie, it will respawn in another area of the map. The actual number of the zombies cannot thus be reduced in any given map, but of course smaller areas of the map can be cleared of zombies and then barricaded.Another idea would be to give some kind of an overall hierarchy to all the zombies. Let's say that every zombie would have a hierarchy number between 1-50. When at night a zombie encounters another zombie, the one with the lower hierarchy number would start following the one with the higher number. This might work even better, it's hard to say.


What do these ideas sound like? Any tips or ideas for improvement would be appreciated!

Share this post


Link to post
Share on other sites
Advertisement
the master zombie part can be dangerous because at some point if you are barricaded into a room.. those 5 masters will have pathed outside your door along with all their groupies and you will have an epic fight on your hands.. kill em and then what.. the masters respawn aways and start heading right back at you picking up more groupies.

What is your intention for the night time? for it to be you being assaulted by a big group of zmbies every couple minutes all night or with the second option, for the player to go roaming around and perhaps, encountering zombie packs.. maybe even getting to stealth around them since there isn't a master constantly aiming at the player?

Share this post


Link to post
Share on other sites
I should've probably mentioned that in the game the player is also required to eat, drink and sleep. Generally the idea is that moving around during the night should be MUCH more dangerous than during the day. The player might even be better off staying indoors (sleeping) at night, but of course in many instances it won't be possible (for example there will be missions with some kind of a time limit etc.).

The maps will be rather big though, so as the master zombies respawn, it would certainly take them a while to get back to you. In this case you'd be better off staying in your shelter until it's morning. Then the normal day time movement system would kick in and the zombies would start to scatter again, maybe just enough to give you a chance to move past them without an epic battle. Of course barricading yourself inside a room with just one exit might be a bad idea in the first place.

Maybe the master zombies would be a big enough threat even when they didn't approach the player all the time. If they would just roam around, collecting other zombies to stroll about with them, it would still be dangerous to walk around at night, but then again it would be perfectly safe (too safe?) for the player to just stay indoors in his shelter.

One idea to prevent that would be to just improve the zombies "smell" sense at night. For example if a zombie would wander to closer than 50 meters away from the player, it would smell him and start approaching the players. During the day this area and thus the risk could be smaller, say 25 meters.

Share this post


Link to post
Share on other sites

I should've probably mentioned that in the game the player is also required to eat, drink and sleep. Generally the idea is that moving around during the night should be MUCH more dangerous than during the day. The player might even be better off staying indoors (sleeping) at night, but of course in many instances it won't be possible (for example there will be missions with some kind of a time limit etc.).

The maps will be rather big though, so as the master zombies respawn, it would certainly take them a while to get back to you. In this case you'd be better off staying in your shelter until it's morning. Then the normal day time movement system would kick in and the zombies would start to scatter again, maybe just enough to give you a chance to move past them without an epic battle. Of course barricading yourself inside a room with just one exit might be a bad idea in the first place.

Maybe the master zombies would be a big enough threat even when they didn't approach the player all the time. If they would just roam around, collecting other zombies to stroll about with them, it would still be dangerous to walk around at night, but then again it would be perfectly safe (too safe?) for the player to just stay indoors in his shelter.

One idea to prevent that would be to just improve the zombies "smell" sense at night. For example if a zombie would wander to closer than 50 meters away from the player, it would smell him and start approaching the players. During the day this area and thus the risk could be smaller, say 25 meters.




Have you heard of flocking algorithms? :P It creates nice behaviors for a crowd of zombies if you have them seek towards your player when the player is sighted. You can decompose zombies into mobs (aka flocks) by world position using an island algorithm. The rough pseudocode for flock creation is something like this:

clear all zombie flock IDs
for each zombie
if zombie's flock ID is unassigned
find nearby zombies with assigned flock IDs
if there are such zombies
set this zombie's flock ID to the nearest zombie's flock ID
if no zombies are nearby
create a new valid flock ID for this zombie

Once in a long while (every several seconds? 30 seconds? A random value between 15 and 30 seconds?) you'd re-group the zombies into flocks so the mobs shift over time. If 5 zombies are near each other, they behave as part of a mob, as does a mob of 50 zombies. Moreover, regrouping the zombies over time allows for zombies to easily wander around the map.

Of course, that is a complex solution. A simpler solution could be a messaging system. For example, when a zombie notices the player, it alerts all zombies within "hearing distance" of it. Maybe if it's night, the zombies can notice the player from further away and/or alert zombies that are further away. All zombies that become aware of the player perform this process as well. Zombies that are alerted to the player's presence start behaving in some appropriate fashion - pathfinding to the player, flocking behaviors, etc.

Share this post


Link to post
Share on other sites
What if each zombie had 3 states: wonder, interested, and attack.

Wonder: the zombie randomly explores areas. Maybe they choose little waypoints in 20 foot increments.
Interested: something small catches the zombies attention like a flashing light or bird chirping or something. The zombie slowly moves towards this.
Attack: the zombie sees a human or hears a car alarm or something powerful. The zombie will chase the object as long as it can. If a player runs inside a house and shuts the door the zombie will pound at the door forever unless he sees something else that would trigger an attack.

A zombie hoard would form like this: one zombie goes into attack mode. All the zombies within 50 feet hear this zombie and also go into attack mode and the follow that zombie. This, in turn, triggers more zombies. Before you know it there are 1,000 zombies chasing the player because they are just following the ones in attack state.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!