Project Zomboid

Project Zomboid

They Knew [B41]
How do spawn rates work in Zomboid? (Regarding "chance" column)
I want to turn down the spawn rate of these guys but I'm confused on how this is supposed to work.

the mod has these lines:

local NBCspawnchance = SandboxVars.TheyKnew.SpawnChance * 0.001;

table.insert(ZombiesZoneDefinition.Default,{name = "TheyKnewNBC", chance= NBCspawnchance});

Basically if you set it to 1 million NBCspawnchance will be 1000. that is the "chance" inserted into what I assume is the game's internal DB

It's confusing to me because if I look at AuthenticZ's source code they do stuff like:

table.insert(ZombiesZoneDefinition.Default,{name = "AuthenticFreddyKrueger", chance=0.00001, gender="male"});

for what seem to be rare zombie types, and

table.insert(ZombiesZoneDefinition.Default,{name = "AuthenticMiner", chance=80, room="traincar", gender="male"});

for what seem to be less rare zombies.

So, if I were to extrapolate info from this, I'd think a LOWER value in the chance column would make zombies more rare, whilst higher values would make them more common.

But increasing the spawn chance in sandbox vars would yield higher chance values instead of lower ones! Which is really confusing. (according to the source base 1/500 spawnrate would yield 0.5 "chance", 1/1m would yield 1000)

Anyone here know how it's really supposed to work?