Jump to content
ZehMatt

(A19) WalkerSim - Enhanced roaming zombies

Recommended Posts

What is this?

This plugin replaces the zombie spawning model with an offline simulation. Players on the server will be

assigned a visibility zone that decides which zombies will be active and which ones will be offline.

If the zombie was killed it will respawn at the map border as an offline version and roams the map, if the zombie

is still alive but leaves the player visibility it will become offline but keeping attributes such as health

and class.

Simulation01.gif

 

For more information please visit

https://github.com/ZehMatt/7dtd-WalkerSim

 

You can find the latest release here:

https://github.com/ZehMatt/7dtd-WalkerSim/releases

 

Update 8/25/2020, Version: 0.2

- A19 support.

- Fixed visibility zone not being calculated correctly.

- Fixed exceptions being thrown when new players join.

- Removed the need to disable enemy spawning via serverconfiguration.xml.

- Removed sleepers from the simulation, uses the builtin system instead now.

- Added audio events, offline zombies will be attracted towards gunshot sounds.

Download: https://github.com/ZehMatt/7dtd-WalkerSim/releases/tag/0.2

 

Update 8/27/2020, Version: 0.2.1

- DMT support, you can now play this mod without a dedicated server.

Download: https://github.com/ZehMatt/7dtd-WalkerSim/releases/tag/0.2.1

Edited by ZehMatt
Version 0.2.1 (Typo fix) (see edit history)
  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

I love the concept. I always wanted this implemented in several open world games, and it's great to see it finally come to fruition in some form. Great job all around, and please keep up the good work.

Share this post


Link to post
Share on other sites

If the zombie was killed it will respawn at the map border as an offline version and roams the map, if the zombie

is still alive but leaves the player visibility it will become offline but keeping attributes such as health

and class.

 

What does "offline" mean in this context?

I'd understand there is no further AI calculated for this zombie, it just stays where it was and doesn't do anything. That would allow for high zombie counts on the map, because an "offline" zombie only need almost no cpu-time (besidss the calculation if he is visible by a player).

 

But if a killed zombie respawns at the map border and is offline then it can not roam. So the zombies would cumulate at the map borders. If you let offline zombies roam, you loose the advantage of cpu usage.

Or do you just skip complex pathing for offline Zs and let them only more or less move straight to the map center (ignoring terrain, since they are not visible anyway?) or similar?

Share this post


Link to post
Share on other sites
What does "offline" mean in this context?

I'd understand there is no further AI calculated for this zombie, it just stays where it was and doesn't do anything. That would allow for high zombie counts on the map, because an "offline" zombie only need almost no cpu-time (besidss the calculation if he is visible by a player).

 

But if a killed zombie respawns at the map border and is offline then it can not roam. So the zombies would cumulate at the map borders. If you let offline zombies roam, you loose the advantage of cpu usage.

Or do you just skip complex pathing for offline Zs and let them only more or less move straight to the map center (ignoring terrain, since they are not visible anyway?) or similar?

 

"Offline" zombies are basically all the agents that are currently not a real in-game zombie. Once they are put back at the border they will roam the map until the player activates them to become "online" again.

 

EDIT: Zombie respawns look something like this:

bSUE6X3.gif

NOTE: I used "walkersim reset" which advances the simulation for N ticks during the initial startup, but thats pretty much what it would look like if you killed off all zombies at once with a nuke and speed up the simulation.

Edited by ZehMatt (see edit history)
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
"Offline" zombies are basically all the agents that are currently not a real in-game zombie. Once they are put back at the border they will roam the map until the player activates them to become "online" again.

So your simulation is ment to simulate zombie movement without real terrain but just a position?

And the game is ment to tell the simulation the viewboxes of players, your simulation then answeres with zombies inside this box and then the game (corrects their position to the terrain, they should not stand inside a wall) instantiates the real ingame zombies?

 

 

I'm not sure what 7d2d does actually, but i'd expect it does something similar already. I'd be a huge overhead to keep every zombie on the whole map as full instance in memory with full ai path calculation, movement animations, and other full calculation like it looses HP when it hits a cactus or pathing need to walk around a cactus.

I guess when a zombie becomes a full instance (also with the graphical part) is determinded by the view distance (+ jitter).

 

You can easily test that. Look for a single zombie (it should be awake and moving) then move away from it. As soon as the zombie leaves your view distance you can't see it anymore. You can see that in detail when using a scope on your weapon. Wait some seconds, step closer to make it visible again, and see. It did not just vanish, it kept moving and acting, it's position changed anyway, so Zs are at least not "frozen" just because they leave view distance.

Share this post


Link to post
Share on other sites
So your simulation is ment to simulate zombie movement without real terrain but just a position?

And the game is ment to tell the simulation the viewboxes of players, your simulation then answeres with zombies inside this box and then the game (corrects their position to the terrain, they should not stand inside a wall) instantiates the real ingame zombies?

 

 

I'm not sure what 7d2d does actually, but i'd expect it does something similar already. I'd be a huge overhead to keep every zombie on the whole map as full instance in memory with full ai path calculation, movement animations, and other full calculation like it looses HP when it hits a cactus or pathing need to walk around a cactus.

I guess when a zombie becomes a full instance (also with the graphical part) is determinded by the view distance (+ jitter).

 

You can easily test that. Look for a single zombie (it should be awake and moving) then move away from it. As soon as the zombie leaves your view distance you can't see it anymore. You can see that in detail when using a scope on your weapon. Wait some seconds, step closer to make it visible again, and see. It did not just vanish, it kept moving and acting, it's position changed anyway, so Zs are at least not "frozen" just because they leave view distance.

 

Most assumptions are correct. To clarify the definition of "offline": Zombies that are offline will use a primitive 2d simulation to walk across the map, no obstacles or terrain height are considered, they are not real entities yet. Also the world is divided into a grid and in their offline state they pick a random grid block and walk towards it with some added noise in movement, if the destination is reached it just picks another random grid block. If the player box activates the zombie at the border of the named box it will spawn the zombie at the current offline location by reading the world chunk data to obtain the height and see if the spawn would be blocked. If the online zombie ("active in-game zombie") goes into the offline state it will continue to roam the map in the 2d simulation from the last position, if the player re-activates the specific offline zombie the player will meet the same zombie again.

 

There are some configurations in the XML that also change their roaming behavior, as an example: There is a configuration to how big the chance is that the offline zombie picks a POI zone rather than a world zone to walk towards, the default setting is currently 25%.

 

I hope that answers your questions.

  • Thanks 1

Share this post


Link to post
Share on other sites

When activating an offline zombie by entering the chunk, can/will this result in zombies popping up before your eyes?

Share this post


Link to post
Share on other sites

I hope that answers your questions.

Yes, i think i understood.

 

When activating an offline zombie by entering the chunk, can/will this result in zombies popping up before your eyes?

From what i got, this has nothing to do with the ingame chunks. Since you regularily move in the game any zombie will enter the viewbox of a player from a distance. Also the viewbox is bigger than one chunk (chunk is irc just 16x16?).

Just if you change your position by teleporting zombies may be delayed loaded (instantiated) in your near surroundings and therefore pop up.

Share this post


Link to post
Share on other sites
When activating an offline zombie by entering the chunk, can/will this result in zombies popping up before your eyes?

 

If you see them pop in thats most likely because of draw distance, thats what I've gathered from testing the maximum size of the box. I've actually not seen them spawn infront of me yet.

  • Thanks 1

Share this post


Link to post
Share on other sites
If you see them pop in thats most likely because of draw distance, thats what I've gathered from testing the maximum size of the box. I've actually not seen them spawn infront of me yet.

 

This is an interesting implementation. Thanks for sharing your work. A few questions.

 

1) Are the wandering horde and/or sleeper systems replaced by this or does it only impact biome spawning?

2) What do the 2d simulations look like and will the player ever see them?

3) What impact does this have on total zombie counts? Judging from the photo, this allows the limit to be increased significantly.

4) How does this change the player experience? Simulates large hordes approaching from the outskirts of the map?

Share this post


Link to post
Share on other sites
This is an interesting implementation. Thanks for sharing your work. A few questions.

 

1) Are the wandering horde and/or sleeper systems replaced by this or does it only impact biome spawning?

2) What do the 2d simulations look like and will the player ever see them?

3) What impact does this have on total zombie counts? Judging from the photo, this allows the limit to be increased significantly.

4) How does this change the player experience? Simulates large hordes approaching from the outskirts of the map?

 

The simulation doesn't show up active zombies. In fact they all show as inactive, so in the world you wouldn't see them all. Just the ones that are in your area.

 

Still, just like someone else already noted, this is most likely what the game already does. Well, sort of. The main difference is probably that the game currently spawns zombies randomly in the biome in your area and only spawns as many as your pc can handle rather than having to constantly calculate positions, stats of all the "offline" zombies on the whole map just to show couple of them to you when you get close. So I guess it's apples and shiny oranges, except the oranges are pretty expensive and you have to pay for them with the power of your pc which results in performance loss.

Share this post


Link to post
Share on other sites

Very interesting concept, I like the idea of persistent zombies wandering around. How do you define which zombies are being spawned? Are you using the "spawning.xml" that defines what type of zombies should be spawned in which biome? And how you define the spawning of zombies for low and high level players?

 

Imagine being level 5 and a wandering feral radiated wight appears...

Share this post


Link to post
Share on other sites

What kind of zombie is spawned is driven by the biome data. I did not implement game stages as I find that rather game breaking, assume player 1 with level 3 is with player 2 that is level 300, even if I average both levels it would be still way too high for player 1, getting this right in multiplayer is too tricky, the plugin focuses right now more on wandering zombies.

 

Also regarding the maximum zombies, it still obeys the server settings to how many active zombies there can be. To make it more balanced for players every player zone can activate the maximum allowed amount divided by the player count, so during bloodmoon and in general players will have equal chance to encounter zombies. So if your server is set to 72 max zombies and it has 4 clients connected then each client will be able to have 72 / 4 = 18 alive zombies around them, this changes when players are close to each other, it will combine the maximum in this case.

 

Regarding performance, this plugin should do equal or better as most of the logic runs in the background, it would be terrible to simulate massive amounts in the main thread.

  • Thanks 1

Share this post


Link to post
Share on other sites

This sounds really fantastic to simulate the movement of massive zombie herds, but it has one MAJOR con that is a make or break factor. Am I reading this correctly that we have to turn off enemy spawning to use this, thus disabling sleepers in POIs?

Edited by Cernwn (see edit history)

Share this post


Link to post
Share on other sites

At the moment, but he's got a fix in mind last we spoke that should handle this. In the interim consider this a proof of concept.

 

I played extensively with this and it definitely is going to add more to the game than subtract.

 

- - - Updated - - -

 

Oh, animal spawns are not affected.

Share this post


Link to post
Share on other sites
Posted (edited)

Update 8/25/2020, Version: 0.2

- A19 support.

- Fixed visibility zone not being calculated correctly.

- Fixed exceptions being thrown when new players join.

- Removed the need to disable enemy spawning via serverconfiguration.xml.

- Removed sleepers from the simulation, uses the builtin system instead now.

- Added audio events, offline zombies will be attracted towards gunshot sounds.

Download: https://github.com/ZehMatt/7dtd-WalkerSim/releases/tag/0.2

 

NOTE: Now that the simulation will be aware of your gunfire you need to re-think on how you play the game, making a ruckus will just attract more zombies, so think carefully what weapons you will use now, its recommended to use silenced guns if you don't want to attract large quantities of zombies.

Edited by ZehMatt (see edit history)
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

I enjoyed the crap out of it; the world was "alive" again.  Well, dead, but you get it.

Share this post


Link to post
Share on other sites

I love the sound of this! How hard is it to get up and running?

Share this post


Link to post
Share on other sites
52 minutes ago, mr.devolver said:

Does this mod work only with dedicated servers?

At the moment yes. I was considering supporting this for clients only but I'm not sure how to approach it yet.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...