Excellent, it always felt like something was missing from 2.0+ without my NPC friends. Thanks for your work.
Please can you tell me how to reduce the spawn rate (I see your options in the xml's to increase spawn rate, but I don't want to mess things up by putting my own numbers in to try and reduce it). Thanks again.
Glad you like them.
The commented-out XML in
entitygroups.xml shows you an easy way to
increase the spawns. It works by
decreasing the probably of "none" to spawn into the entity groups. (As you probably guessed, that's the game's way of saying "instead of spawning an entity, spawn nothing.")
If you want to
decrease the spawns, then you need to
increase the probability of "none" to spawn into those groups.
For example, here's the XML to make half as many NPCs spawn (on average):
XML:
<csv xpath="/entitygroups/entitygroup[starts-with(@name,'civilianNPCFriendly')]/text()" delim="\n" op="remove">none, 97</csv>
<csv xpath="/entitygroups/entitygroup[starts-with(@name,'civilianNPCFriendly')]/text()" delim="\n" op="add">none, 197</csv>
(The total of all the NPC probabilities is 3, so that decreases the probability of NPCs spawning from 3 in 100 to 3 in 200, i.e. from 3% to 1.5%.)
Halving the probability is a pretty drastic decrease, so you could also try something like 147 (3 in 150, or 2%).
The general formula is:
%chance of an NPC spawning = 300 / (x + 3), where
x is the "none" value. EDIT: Or, if you want to figure out the "none" value from a percent chance to spawn, the formula is
x = (300 / %chance) - 3.
I'm not sure what works for you. Honestly, I thought the existing probabilities were on the low side for most people, so I never thought to explain how to spawn fewer NPCs.
The XML above targets the civilian groups used in
all biome spawns, but you could also decrease the spawning in specific biomes if you like - for example, make them rarer in the forest biome, and more plentiful in harder biomes like the snow or wasteland. It depends on what you want to do, and at what stage you want to start encountering NPCs.
Hope that helps!
EDIT: Also - if you're on 2.5, make sure you get a recent version of SCore. There was a bug that caused NPCs to sometimes get stuck, and it was recently fixed.