Zombie AI proposal

entspeak

Well-Known Member
I've pulled most of this from a post I made in the DayZ forums. Given that the zombies in the DayZ mythos are not the undead sort of Romero's Dawn of the Dead, but more like the infected sort of Boyle's 28 Days Later, I've been thinking about the way they handle sight and sound:

I feel that the way that they handle sight and sound should be different in terms of aggro. I'm not sure how the AI works in the coding (I've looked at it, but most of it is gibberish to me - lol). But, if what I propose is possible, I think it would solve some of the issues the community has had with the zombies in DayZ and make for some interesting gameplay.

The basic premise:

Vision:
Based on a conversation I had with r4z0r in the DayZ forums, in DayZ 1.7.6.1, zeds have a field of view of 30 degrees directly in front of them (to put how narrow that is in perspective, humans have a 180 degree FOV) and they can see 80m (which, is reduced already from 200m and I think is fine). Because FOV fans outwards on that angle, it's much easier to be seen at 80m away from a zed than it is when you're 10m away... in fact, you could be pretty much right in front of them at 5m away and they just might not see you. Add to this that the check for players is not constant, but happens in intervals every few seconds, and if you're close to a zombie, they might slowly turn around and walk right by you. This seems backwards to me. I would propose an 80 degree field of view and a 80m sight distance - so that you have a greater chance of being seen when you're closer. Finally, as a general rule, zombies should aggro when they recognize food - meaning based on sight. If they see a player, they aggro. This should always be the case.

Sound:
Sound, however, should be handled differently. Really loud sounds may aggro zombies for a bit, but if they don't see food after a short bit of time, they should calm back down. If a zombie hears a quieter sound, it should simply be attracted to it - like they currently are to flares. It would also be great if, when zombies hear something, they moved toward the position at which the sound occurred and not the originator of the sound (unless they see him).

And sight and sound should be separate things to a zombie - meaning that they will break off moving toward a sound if they see a player... any player - even if that player didn't make the noise, they then aggro on that player. Sight should be given priority when it comes to aggro. And louder noises should trump softer ones. If a zombie is turning toward you because it hears you walking, but someone fires a Lee Enfield... the zombie should aggro on the Lee Enfield noise and you should pray that the noise doesn't put you in the path of the zombie.

So, how might this work specifically? Like so:

Firing a weapon: There would be two zones for a zombie hearing a shot from all weapons - one that aggro's and one that simply attracts zombies. Since, as I understand it, audible range is based on the ammo, you could have an aggro range as a percentage of the audible range. As an example: 9mm pistols would aggro zombies at 40% of the audible range for zombies (about 20m or so), .45's at 50%, Stanag based guns at 60%, Lee Enfield at 85%, etc... Zombies outside those ranges, but still within audible range for zombies would still be attracted to the sound, but not aggro (unless they hear another zombie nearby aggro - at which point, they follow the zombie hearing zombie guidelines.)

Movement: If a zombie hears a player moving, they should be attracted to it, but only aggro when they see a player - even if that player isn't the one making the noise. But, I also think that if you get too close to them (1m?) they should aggro on you - sensing you. They should also aggro if you run into them.

Engine noise: Engine noise should aggro the zombies within hearing distance toward the sound of the engine - changing their path toward any player they see on the way. Once the engine is off (or idling), the aggro ceases after 10 seconds if the zombies don't see a player. Turning on a car and idling shouldn't aggro zombies outside a 10m range, but should attract them (maybe the range could be adjusted based on the vehicle... the range at which a zed would aggro when starting a V3S is greater than they would when starting a Skoda, for example). Of course, if a zombie sees a player in the vehicle, they should aggro.

The exception to all of this is the bicycle... which should only attract zombies that hear it, but not aggro them unless they see a player. Personally, I think that the noise from bicycles should also be a bit quieter to be more realistic.

Vehicle Repair and Refuel: The sound of repairing a vehicle should only aggro zombies within 20m, but attract them beyond that, if they can still hear it. The sound of refueling should only attract zombies within a short distance, and they aggro if they see a player.

Zombies hearing other Zombies: If a zombie hears another one aggro, that noise should only attract them toward the aggroing zombie... and they will only aggro themselves based upon the above guidelines for sound or if they see a player.

With all of this, zombies should lose complete interest in a noise a minute or so after the noise is gone... they, in essence, forget why they were going that particular direction and continue on mindlessly.

The benefit to the above system is that it keeps the zombies relevant and a threat, but not overpowered. It makes it very dangerous, but not totally suicidal to fire a weapon around zombies. It also impacts team play in that your shots may cause a zombie to aggro on a nearby teammate who happens to be the first one the zombie sees as it turns toward the sound.

Thoughts, suggestions? Is this something that can be done with the AI code? Or is it too complex for the engine?
 
Although this is a very complex system you are proposing, I think your ideas in terms of it are great and most of them would seem possible. Not saying the easiest thing to do, but definetely something we should take a focus on.

I'll draw some UML diagrams when I have time to do so, and I'll show them to you so you can check if that's the system you were suggesting. I'll give you a warning now: it might look quite complicated ;)

To give you an idea of how the zombie AI works, here is the FSM (basicly a UML diagram you could say, but actually containing code for actions etc if conditions are true/false):

LIcmjJL.png
 
Back
Top