Jump to content

Relationship(s) between spawned animals, etc. and their spawning in the world?


Cadamier

Recommended Posts

Hello,

 

I've been looking over the files and I see some of the relationships between the files and items, etc. spawning; but what about the animals spawning?

IE: For the animalStag in the entitygroup.xml I see 5 matches, they're in the Plains, Burnt Forest, Forest, Snow, and AnimalsAll groups. I know that thats where they spawn, but I'm seeing other entities that have probabilities, and max count, etc. Can anything have a probability, max count, etc? Also - what are the limits that the game will accept for those values?

 

I also see other things which I don't see in game; for instance invisibleAnimal... What's that one all about?

 

Does the order within the group have anything to do with the spawning?

 

Is it possible to have subgroups within the specified groups?

 

I wonder if there's a book on all this... lol

 

Thank you for your time and attention!

Link to comment
Share on other sites

Spawning in 7 days to die works from 4 files (in order of importance):

--- EntityClasses.xml ---

Contains all the statistics on all the animals, zombies, vehicles, traders, npcs etc. This is where the names of said entities are drawn from. I will not go into detail on this one to much since its a bit out of scope for your question.

 

--- EntityGroups.xml ---

Contains all the lists, this file is like the loot.xml but then only for making groups. Basically this file sets lists where the actual spawning is done from, it references EntityClasses and is thus dependent on that file. As long as an entity referenced here exists in there it can be spawned (or attempted to spawn).

 

Each group has at least 1 entry but essentially the amount of entries can be large, not sure there is a limit, but I assume its as big as standard array or list in C# allows, which should be plenty. I have created extensive lists for Gnamod and have not encountered a limit here.

 

Each list entry, say animalStag, has a probability, which you can see a % or chance it spawns. But the total of number you put in the list is what is leading here. If you set the stag to 0.01, and there are no other entries it spawns 100% (since it has 0.01 of 0.01 total chance to spawn). What I generally do is set the total of a list to 100 so each every entry is an actual percentage chance. Then I know if I give the animalStag prob="1" it has 1% chance to appear in the world.

 

The invisibleAnimal is a hack, I think I invented it for A15 and then Gazz started using it for A16. It is basically an entity that ceases to exist on spawn, which means it thins out the spawning of the world (I will get to that in spawning.xml). But you can use it reduce animals or zombie spawns in the world, basically making the chance something appears less than 100, as there can be no empty groups as you can have in loot.xml

 

The order of the list has no effect as far as I can tell, the probability is what matters. Some entries have no probablity set, I think in this case you can assume it is 1, but I generally set them for everything, even if they are all 1.

 

--- Gamestages.xml ---

This file has replaced most horde spawning since A15, leaving many legacy entries in Spawning.xml redundant. It also controls the sleeper spawning. Here you can set the blood moon hordes, wandering hordes, scout hordes and sleepers. World spawns and scout spawns are still done in Spawning.xml. This may seem like a very complex file at first, but its mostly because of how the sleeper and blood moon hordes are setup for vanilla. I use a much cleaner setup myself making the file a lot more readable.

 

--- Spawning.xml ---

This file used to control all spawning, but now only does world and scout spawning. All other entries are legacy and have NO effect on the game anymore (trust me I tried).

 

World spawns work a bit differently from the others and generally are set on a really low number of 1 or 2 and a reset time of 4 ingame days. Do not let this low number fool you, the 1 is per spawn point and there can be quite a few spawn points. And as of A16 the spawn points do not spawn zombies instantly but they build up. Setting it to 10 means you will see only a few zeds at first but pretty quickly you will be at maximum spawns. This is also where the invisibleAnimal comes in, even a setting of 1 generates a lot of animals, and thus their numbers can be thinned down with this. In my setup I coupled this with daily respawning rather than every 4 days, since any invisible animal spawn will count as a dead animal and thus not spawn back later, but rather 4 days later. This is why animals die out after day 1 in the same area and randomly reappear a few days later.

 

I do not know if there is a book on this, but I learned most of this from modding, I think I have been tweaking hordes since A12, so if you have more questions just ask.

Link to comment
Share on other sites

entitygroups.xml

 

<entitygroup name="FriendlyAnimalsDesert">

<entity name="invisibleAnimal" prob="6" />

<entity name="animalRabbit" />

<entity name="animalChicken" />

<entity name="animalBoar" prob="0.4" />

</entitygroup>

 

 

There are probabilities for one entity at 6 and then another at 0.4 and then the rabbit and chicken don't have a probability.

 

I would take it as depending on if there is a probability listed or not listed then the system would calculate if one is spawned... In the case that there isn't one listed then there should be at least one of those entities spawned?

For the invisibleAnimal - does that mean at least 6 will be spawned?

 

But more specifically I'm wondering about the 'limitations' for the:

prob="x.x"

It would seem that the limits for 'x.x' are any number?

 

I also see other things such as with the biomes.xml

 

<!-- Pine Forest Main Biome -->

<biome name="pine_forest" biomemapcolor="#004000" >

<weather>

<Temperature min="-50" max="-10" prob="1"/>

<Fog min="0" max="0" prob=".9"/>

<Fog min="100" max="100" prob=".1"/>

<CloudThickness min="0" max="0" prob=".2"/>

<CloudThickness min="10" max="70" prob=".5"/>

<CloudThickness min="100" max="100" prob=".3"/>

<Precipitation min="0" max="0" prob=".0"/>

<Precipitation min="50" max="100" prob=".75"/>

<Wind min="10" max="20" prob="0.9"/>

<Wind min="20" max="100" prob="0.1"/>

</weather>

 

And here you kind of have probabilities with specific limitations within probabilities with specific limitations lol

 

I'm guessing that it depends upon many things, but more specifically what is being 'factored' or 'operated' upon. In assembly programming there are specific limitations and specific format for operators, I was wondering what is the equivalent here. I also know that going beyond the limits can crash the system, that's what I'm mostly concerned about lol

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...