• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Improved Hordes [V1.0]

Fair Warning just traveled to wasteland an it got way to out of hand, it was playable but endless rad zombies. Im currently reworking it cause i need to figure out the bio multiplier for GS.

Setting.xml

<max_horde_density>4.0</max_horde_density>   Changed density from 2.0 ----> 4.0

<max_entities_spawned_per_player>-1</max_entities_spawned_per_player>  Changed from 16 ----> -1

Hordes.xml

<groups> <!-- Define possible groups for wandering hordes-->
            <group name="Zombies">
                <gs min="0" increaseEvery="0"> <!-- 3 zombies @ GS 0, 20 zombies @ GS 55 (1/3 of 165), 10 zombies @ GS 110 (2/3 of 165), 0 zombies @ GS 165+ -->
                    <entity time="day" biomes="wasteland" group="ZombiesWasteland" minCount="3" maxCount="8"/>
                    <entity time="night" biomes="wasteland" group="ZombiesWastelandNight" minCount="3" maxCount="8"/>
            
                    <entity time="day" biomes="pine_forest,snow,desert,burnt_forest" group="ZombiesAll" minCount="20" maxCount="30"/>
                    <entity time="night" biomes="pine_forest,snow,desert,burnt_forest" group="ZombiesNight" minCount="20" maxCount="30"/>

                </gs>
                
                <gs min="70" increaseEvery="0">
                    <entity time="day" biomes="wasteland" group="IHZombiesAllFeralWasteland" minCount="1" maxCount="10"/>
                    <entity time="night" biomes="wasteland" group="ZombiesWastelandNight" minCount="1" maxCount="10"/>
                
                    <entity time="day" biomes="pine_forest,snow,desert,burnt_forest" group="IHZombiesAllFeral" minCount="20" maxCount="30"/>
                    <entity time="night" biomes="pine_forest,snow,desert,burnt_forest" group="IHZombiesAllFeralNight" minCount="20" maxCount="30"/>

                </gs>
                
                <!-- Radiated Zombies -->
                <gs min="180" increaseEvery="0">
                    <entity time="day" biomes="wasteland" group="IHZombiesAllRadiatedWasteland" minCount="1" maxCount="20"/>
                    <entity time="night" biomes="wasteland" group="IHZombiesAllRadiatedWastelandNight" minCount="1" maxCount="20"/>
                
                    <entity time="day" biomes="pine_forest,snow,desert,burnt_forest" group="IHZombiesAllRadiated" minCount="1" maxCount="20"/>
                    <entity time="night" biomes="pine_forest,snow,desert,burnt_forest" group="IHZombiesAllRadiatedNight" minCount="1" maxCount="20"/>
                </gs>
            </group>

The Red is what I changed which is the min and max count. Though this leads to an insane # of zombies in the wasteland. 

The Blue is what I am going to experiment with to try and control the amount.

Full Disclaimer..... I have no idea what I am doing. I'm just changing what sounds right to change in my mind. have fun. Fair Warning this causes slight stuttering in the Wasteland and lag in my system. Other biomes didn't have stuttering.
Stuttering might be caused by lots of zombies spawning from nearby hordes, still working on optimizing this. I have come across similar issues while developing the add-ons so far. I did find a bug where unloading hordes causes the rest of a horde to spawn before despawning, potentially making the stuttering worse.

Good point on the biome game stage multiplier, I haven’t taken a good look at how that’s being calculated by the game. The horde biome count multiplier is applied to an exponential curve that currently has very aggressive scaling in the wasteland, might add a setting and tone it down a notch as well.

Did you do that by just increasing the max_entities_spawned_by_player, or did you also play around with the numbers inside the hordes.xml? Have you changed anything in your serverconfig.xml file also? Basically, tell me exactly what you did so I can do it, too.

We always go into wandering hordes thinking about xp, and that's all wrong. There's just no fear. I don't think I've ever had a significant enough crowd just wander on through where you're thinking this could actually be a problem.
Trying to balance this out as well. The experience should be capturing the feeling of like a level 1 wandering into a town in the forest and seeing a horde of 8-10 zombies, that but scaled for all levels.

fnfear said:
I feel like silencers don't seem to work with your mod? Whenever I shoot with silenced weapons I get endless hordes coming just as much as I would if I shoot without silencers.
Update on this: next version will have a better sound event implementation that has been based off of the game’s sound-specific heat system. It greatly reduces range for silenced weapons unless you’re using a machine gun at a high firing rate.

 
Getting this Red Error whenever I exit a world using the latest version of the mod.

2023-07-01T01:42:03 17916.806 ERR [Improved Hordes] [WorldHordeTracker] ThreadLoop(ThreadInfo): An exception occurred during UpdateAsync: Object reference not set to an instance of an object 
Stacktrace: 
  at ImprovedHordes.Core.World.Horde.HordeBiomes.GetBiomeAt (UnityEngine.Vector2 location) [0x00010] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHorde.UpdateDecay (System.Single dt) [0x0000c] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHordeTracker.UpdateHorde (ImprovedHordes.Core.World.Horde.WorldHorde horde, System.Single dt, System.Collections.Generic.List`1[T] playerGroups, System.Collections.Generic.List`1[T] eventReports) [0x00255] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHordeTracker.UpdateTrackerAsync (System.Collections.Generic.List`1[T] players, System.Collections.Generic.List`1[T] eventReports, System.Single dt) [0x000e3] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHordeTracker.UpdateAsync (System.Single dt) [0x00032] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.Threading.Threaded.ThreadLoop (ThreadManager+ThreadInfo threadInfo) [0x00027] in <b674cbf2ddb947b584a1118d26a33bc4>:0 

 
Stuttering might be caused by lots of zombies spawning from nearby hordes, still working on optimizing this. I have come across similar issues while developing the add-ons so far. I did find a bug where unloading hordes causes the rest of a horde to spawn before despawning, potentially making the stuttering worse.

Good point on the biome game stage multiplier, I haven’t taken a good look at how that’s being calculated by the game. The horde biome count multiplier is applied to an exponential curve that currently has very aggressive scaling in the wasteland, might add a setting and tone it down a notch as well.
I believe your right. The stuttering only happens when the hordes appear or are near by but it's not a horrible stutter usually. It's more of there's a stutter. And then I look around cause I know a horde will be showing up, kind of a ln early warning system. It also probably cause of the adjustments I made. 

When in the wasteland we (2 players) were getting nothing but rad hordes and they were everywhere. 

 
Getting this Red Error whenever I exit a world using the latest version of the mod.

2023-07-01T01:42:03 17916.806 ERR [Improved Hordes] [WorldHordeTracker] ThreadLoop(ThreadInfo): An exception occurred during UpdateAsync: Object reference not set to an instance of an object 
Stacktrace: 
  at ImprovedHordes.Core.World.Horde.HordeBiomes.GetBiomeAt (UnityEngine.Vector2 location) [0x00010] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHorde.UpdateDecay (System.Single dt) [0x0000c] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHordeTracker.UpdateHorde (ImprovedHordes.Core.World.Horde.WorldHorde horde, System.Single dt, System.Collections.Generic.List`1[T] playerGroups, System.Collections.Generic.List`1[T] eventReports) [0x00255] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHordeTracker.UpdateTrackerAsync (System.Collections.Generic.List`1[T] players, System.Collections.Generic.List`1[T] eventReports, System.Single dt) [0x000e3] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.World.Horde.WorldHordeTracker.UpdateAsync (System.Single dt) [0x00032] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
  at ImprovedHordes.Core.Threading.Threaded.ThreadLoop (ThreadManager+ThreadInfo threadInfo) [0x00027] in <b674cbf2ddb947b584a1118d26a33bc4>:0 
Thanks for bringing this up, already been fixed in the next update. It should be safe to ignore in the meantime, it's caused by the world being unloaded faster than the mod can react.

I believe your right. The stuttering only happens when the hordes appear or are near by but it's not a horrible stutter usually. It's more of there's a stutter. And then I look around cause I know a horde will be showing up, kind of a ln early warning system. It also probably cause of the adjustments I made. 

When in the wasteland we (2 players) were getting nothing but rad hordes and they were everywhere. 
I see. I'd expect there to be a mix of standard/feral/radiated, not just one type. Will need to take another pass at the entity selection code.

The stutter in this case might also be linked to the fact that you've disabled the entity player spawn limit and increased your horde zombie counts, so the game tries to spawn all of them at the same time. I'm going to see if I can try delay each spawn slightly to make it feel smoother.

 
Is there any way to disable the mod and enable it when entering missions because when I'm doing a Tier 5 or 4 mission, multiple hordes always arrive while I'm inside the building. I always play on the default Insane difficulty, and the mod is very well made, but I have this issue with it. Is there any configuration to reduce the number of hordes that appear? In one mission, I had approximately 3 hordes appear.
Looking into adding an option to limiting how many hordes can be spawned at a time, though it's not going to be easy to track how many hordes are active for a group of players with the current implementation, so still looking into that one.

How are you gameplay-wise? Are you in a tougher biome and in a town or out in the wilderness? I have got a working implementation of stealthier sound event tracking coming next update that should help with some of these issues (i.e. guns with silencers will work properly).

 
Last edited by a moderator:
I dont know if this is a bug with improved hordes or base game, but both times i had improved hordes installed, but during and after a blood moon i get infinite spawning zeds it never ends,  i have game set to 120 minutes per day and 18 hour days, ive had a constant horde for 60+ minutes after blood moon horde, ended up trying to drive across the map hoping to reset it and zeds still spawning, it went so long the entire game completely crashed. and also both times it was a two player group. with a 150-170 ish gamescore each.
Id like to re-nable improved horde but am afraid of another infinite blood moon but also trying to see if i get this without improved hordes

 
I dont know if this is a bug with improved hordes or base game, but both times i had improved hordes installed, but during and after a blood moon i get infinite spawning zeds it never ends,  i have game set to 120 minutes per day and 18 hour days, ive had a constant horde for 60+ minutes after blood moon horde, ended up trying to drive across the map hoping to reset it and zeds still spawning, it went so long the entire game completely crashed. and also both times it was a two player group. with a 150-170 ish gamescore each.
Id like to re-nable improved horde but am afraid of another infinite blood moon but also trying to see if i get this without improved hordes
Hmm can't think of anything that might cause this mod-related and I've only gotten 2 reports about it so far. Are you running the latest version of the mod?

The mod doesn't touch blood moons at all so I'm not sure what could be causing it. It could be a vanilla bug but I'm hesitant to say, as that could only be confirmed if there are any reports without the mod.

Do you have a log file from that time that you could share that might provide some insight as to what could be going on? You can find it by opening the console and clicking the "Open Logs Folder" in the top right of the window. Uploading it to pastebin then linking it here would be a good start to try figure out what's going on.

 
Last edited by a moderator:
Hmm can't think of anything that might cause this mod-related and I've only gotten 2 reports about it so far. Are you running the latest version of the mod?

The mod doesn't touch blood moons at all so I'm not sure what could be causing it. It could be a vanilla bug but I'm hesitant to say, as that could only be confirmed if there are any reports without the mod.

Do you have a log file from that time that you could share that might provide some insight as to what could be going on? You can find it by opening the console and clicking the "Open Logs Folder" in the top right of the window. Uploading it to pastebin then linking it here would be a good start to try figure out what's going on.
cant remember which day it was it was a couple days ago, either the 27th or 28th i could post all logs from those two days but it be easier to just reinstall improved hordes and see if it happens again, and i check for updates to mods every day since im also looking at new mods every day :)

The first time it happened was in a20 before a21 came out, and the newest was with a21

Ill re-enable imroved hordes since i actualy prefer playing with it on lol, but if it happens again ill send a log

 
I dont know if this is a bug with improved hordes or base game, but both times i had improved hordes installed, but during and after a blood moon i get infinite spawning zeds it never ends,  i have game set to 120 minutes per day and 18 hour days, ive had a constant horde for 60+ minutes after blood moon horde, ended up trying to drive across the map hoping to reset it and zeds still spawning, it went so long the entire game completely crashed. and also both times it was a two player group. with a 150-170 ish gamescore each.
Id like to re-nable improved horde but am afraid of another infinite blood moon but also trying to see if i get this without improved hordes
I to been having issues on my server with the mod as where whenever in a party the wandering horde spawns and it continuously spawns zombies non stop.  One time we tried to actually try and clear it all but they kept spawning and always right in front of us.  Usually get the infinite hordes for us inside cities.  And the only way to stop them is to "killall" X2 in console or to leave the area and restart game.  Also has been "crashing" server quite often but not where the server actually shuts down but freezes all AI and player actions (Like looting, playing ui sounds, etc).  I will try and get a output log for when it happens next time.  Also for me its usually not during a BM but when in cities.  But I have had it once occur during the end of a bloodmoon that broke the bloodmoon zombies from spawning...that only happened once for me on the previous update.  I would like to know how to properly set size of the wandering hordes and maybe how often they can occur during a game day as of right now it seems like when I am at my base I will get 4 or 5 massive hordes constantly come through and a lot of the time (if they don't spot me) will get close to my base and then start pathing in a large circle around my base and never leave..  so I have to deal with them...not a big deal, reason why I wanted better wandering hordes but seems way too often and would like the zombie if I don't attract them too continue going in the directing they are heading until they "despawn"..

 
I to been having issues on my server with the mod as where whenever in a party the wandering horde spawns and it continuously spawns zombies non stop.  One time we tried to actually try and clear it all but they kept spawning and always right in front of us.  Usually get the infinite hordes for us inside cities.  And the only way to stop them is to "killall" X2 in console or to leave the area and restart game.  Also has been "crashing" server quite often but not where the server actually shuts down but freezes all AI and player actions (Like looting, playing ui sounds, etc).  I will try and get a output log for when it happens next time.  Also for me its usually not during a BM but when in cities.  But I have had it once occur during the end of a bloodmoon that broke the bloodmoon zombies from spawning...that only happened once for me on the previous update.  I would like to know how to properly set size of the wandering hordes and maybe how often they can occur during a game day as of right now it seems like when I am at my base I will get 4 or 5 massive hordes constantly come through and a lot of the time (if they don't spot me) will get close to my base and then start pathing in a large circle around my base and never leave..  so I have to deal with them...not a big deal, reason why I wanted better wandering hordes but seems way too often and would like the zombie if I don't attract them too continue going in the directing they are heading until they "despawn"..
Yeah a log next time would be much appreciated. This is useful information though and could point to some spawn bug with hordes, particularly if you mention it’s happened outside of a blood moon.

You can change the size of the wandering hordes two ways:

1. by tweaking the entity counts in the hordes.xml file under Config/ImprovedHordes

2. tweaking the max horde density setting in the settings.xml file under that same folder. This setting is a random capped multiplier that gets applied on top of the hordes.xml numbers.

However you can’t limit the number of hordes you encounter in a day and at what time since I’ve moved away from that system (they all roam the map now at all times), you can decrease the number of hordes in the world overall by tweaking the following settings:

1. decrease the max world density

2. change the horde sparsity settings for wilderness hordes (bigger number here means more thinly dispersed)

3. lower the horde biome multiplier (this one is currently bugged and won’t be applied, got a fix in for next update)

The hordes do tend to pass by if they’re not at their target yet, however when they reach their destination they wander for quite some time / fall asleep until they feel like moving on. I’m reworking some of the wandering behaviour to have them roam around throughout town instead of having zombies walking around aimlessly individually. I hope at some point to make the horde AI more customisable but that’s a while away.

 
The Red is what I changed which is the min and max count. Though this leads to an insane # of zombies in the wasteland. 

The Blue is what I am going to experiment with to try and control the amount.


This was great, I did make similar changes to mine (love the mincount 20 and maxcount 30 stuff), but I also turned the zombie horde sensing on and as you can imagine, both changes at once spelt death for my wife and I the first night of our new map. Lots of fun though.

This said, anyone else had the problem where a zombie will just disappear? I had it couple of times, most notably at the end of a particular horde. Will try to keep an eye out for the log the next time I see it.

 
Last edited by a moderator:
Is there a way to make it so that the hordes don't just stand still once they are about 50 blocks from the player?
Potentially seems to be an issue with the vanilla movement AI system being overloaded with too many requests at once when large hordes spawn at the same time. Seems to fix itself after a little bit but I am still investigating this as part of the spawn issues I’ve been receiving.

anyone else had the problem where a zombie will just disappear? I had it couple of times, most notably at the end of a particular horde. Will try to keep an eye out for the log the next time I see it.
Hmm this shouldn’t be happening so it might be a bug to do with unloading hordes, will look into it.

 
Planning to release the first beta tomorrow, lots of bug fixes and changes coming.
Nice, excited.

We just wiped our server yesterday and wanted to include IH in the new version but i saw that a new version was coming soon, cant wait.

Now should i tell them when i put in or...let it be a surprise...

Just like when i added demolishers to regular POI spawns. Heh. SURPRISE BOOM is best boom. Taught them to be a little more careful about shooting everything they see.

 
Buscando agregar una opción para limitar cuántas hordas se pueden generar a la vez, aunque no será fácil rastrear cuántas hordas están activas para un grupo de jugadores con la implementación actual, así que todavía estoy investigando esa.

¿Cómo estás jugando en cuanto a la jugabilidad? ¿Estás en un bioma más duro y en una ciudad o en el desierto? Tengo una implementación funcional de seguimiento de eventos de sonido más sigiloso que viene próxima actualización que debería ayudar con algunos de estos problemas (es decir, las armas con silenciadores funcionarán correctamente).
In the wasteland biome, it is nearly impossible to complete a Tier 5 or 6 mission. I'm playing in Navezgane, and when I reached  the Shotgun Messiah store, I was swarmed by approximately 6 hordes, totaling around 350 zombies. I had to use the console command "killall" because the number of zombies and hordes was excessive. In the other biomes, I think I managed to solve the problem by modifying the values halfway for the following command lines, as it slightly decreased the frequency of hordes.
The file you modified those commands in is the "Hordes.XML" file.
<group name="Zombies">
                <gs min="0" increaseEvery="3"> original : 6
                <gs min="70" increaseEvery="4"> original : 8
<!-- Radiated Zombies -->
                <gs min="180" increaseEvery="3"> original : 6
It seems that reducing the values of those commands by half may have had some effect, at least in terms of gameplay, as the hordes appeared to have decreased slightly during missions. However, without the full context or knowledge of the specific game or simulation you are referring to, it's challenging to provide a definitive assessment or solution. It's always a good idea to experiment with different settings and values to find the optimal balance for your gameplay experience.

 
Last edited by a moderator:
When I use the improvedhordes stats command what am I seeing? Is it the total number of zombies or the number of hordes? 
Shows the total number of hordes. Number of zombies is calculated depending on your gamestage, horde density, and the settings in the hordes file.

In the wasteland biome, it is nearly impossible to complete a Tier 5 or 6 mission. I'm playing in Navezgane, and when I reached  the Shotgun Messiah store, I was swarmed by approximately 6 hordes, totaling around 350 zombies. I had to use the console command "killall" because the number of zombies and hordes was excessive. In the other biomes, I think I managed to solve the problem by modifying the values halfway for the following command lines, as it slightly decreased the frequency of hordes.
The file you modified those commands in is the "Hordes.XML" file.
<group name="Zombies">
                <gs min="0" increaseEvery="3"> original : 6
                <gs min="70" increaseEvery="4"> original : 8
<!-- Radiated Zombies -->
                <gs min="180" increaseEvery="3"> original : 6
It seems that reducing the values of those commands by half may have had some effect, at least in terms of gameplay, as the hordes appeared to have decreased slightly during missions. However, without the full context or knowledge of the specific game or simulation you are referring to, it's challenging to provide a definitive assessment or solution. It's always a good idea to experiment with different settings and values to find the optimal balance for your gameplay experience.
Hmm if anything I would expect the hordes would get bigger slightly faster with these settings. I've slightly nerfed the number of hordes in the wasteland zones next update and added a setting to scale this back to default or change it further. There's some other changes to wandering hordes as well but I'll leave those in the patch notes.

This is my favorite mod. My friends and I really enjoy using it. Thank you so much for sharing it with us!
No problem! I wanted to find a mod like this but there wasn't anything close back then.

 
Back
Top