This is an old revision of the document!
Loggy's Freespawn reverse engineering notes
Yomi, "natural" spawns
Friendly dominion and a temple is required.
"Terrains" is true in any combination of caves/mountains/highlands, otherwise false.
"Your cap" also technically includes Shinuyama's cap, both of them have the flag used for this for some reason.
Number of spawn attempts is Turmoil + 1.
If End of Culture is up, add Turmoil again (so it becomes 2*Turmoil + 1).
While the number of spawn attempts > 0:
66% to just flat out fail (-1 spawn attempt).
If (terrains or your cap) and a 2% chance: Amanojaku (-2 spawn attempts)
If (terrains or your cap) and a 80% chance: Kuro-Oni (-2 spawn attempts)
If (terrains or your cap) and a 70% chance: Oni (-2 spawn attempts)
30% chance per cold scale: Ao-Oni (-1 spawn attempt)
30% chance per heat scale: Aka-Oni (-1 spawn attempt)
Otherwise: 1d4 (non-exploding) Ko-Oni (-1 spawn attempt)
(Once a single check succeeds, go spawn the units, subtract the spawn attempts, and then go back to the top of the bullets)
Yomi, Oni Summoner
Local value = (turmoil * 10) + unrest, capped at 100
If End of culture, double this (and cap at 150).
Doesn't function underwater.
Final % to spawn is (local value * oni summoner ability value)/100
Unknown criteria can also prevent spawning
You get a non-exploding d6 number of Ko-Oni.
Therodos
first it checks to see if you have candles, if you don't it does nothing
then it checks something else I don't understand, if you don't have that it does nothing
then it checks for a fort in the province, if there isn't one it does nothing
then it checks something else I don't understand, if you don't have that it does nothing
then it does (candles + [random number 0-2 incl] + death scale)
then it divides this number by 3 and rounds down
if that number is less than 1, it does nothing
This number is the number of spawn attempts.
For each spawn attempt:
pick a random number 0-8. If you rolled 8 and there is no temple in the province, set this to 0 instead
roll another random number 0-99. If it's less than 5, set the previous number to a random number 0-3 + 10
Spawn units based on the first number in this section:
0-3 incl: 1d4 exploding units with ID 0xb1a [spectral hoplite]
4 or 5: 1d4 exploding units with ID 0xb18 [spectral archer]
6 or 7: 1d4 exploding units with ID 0xb19 [spectral peltast]
8: 1 unit with ID 0xb1b [spectral kourete]
9: do nothing
10 or 11: 1 commander with ID 0xb1c [spectral commander]
12: 1 commander with ID 0xb1d [ephor 2845]
13: 1 commander with ID 0xb1e [spectral philosopher]
LA Rlyeh
If you don't have candles, don't do any of this.
Void critter component:
Scale component: 2 * candles + magic scale
If a random number 0-499 inclusive is less than (scale component * 5):
Roll 2d(candles/3 + 4, rounded down). These are closed die rolls. You get the void encounter that corresponds to this result:
If 1-5: 6x lesser otherness
If 6: 4x vile thing
If 7: 3x thing of many eyes
If 8: 3x thing from the void
If 9: 5x elder thing
If 10: 4x formless spawn
If 11: 4x otherness
If 12: 3x thing from the beyond
If 13: 2x dweller in the deep
If 14: 4x: greater otherness
If 15: 5x thing that should not be
If 16: 1x vastness
If 17+: 2x greater otherness
Cultist component:
If the province has no temple, get number of candles. If (province pop/10) < the number of candles, use that instead.
If the province has a temple, instead:
If a random number 0-74 is less than the value above, you're geting cultists.
If underwater, always get Cultist#1639
If coastal, always get Hybrid Cultist
If not coastal, 50% for Hybrid Cultist, 25% for Cultist#1640, 25% for Mad Cultist
Madman component:
Calculate 10 * number of candles.
If (province pop/20) is less than this, use that value instead.
If a random number 0-99 is less than the above value, you get madmen.
If this is a non-coastal land province, you get Madman
If this is a coastal land province, you get Mad Hybrids
If this is underwater, equal chances of Peasant [which is weird because they'll instantly drown], Mad Merman#1568, and Mad Ones.
No matter what type, you get 2d8 exploding.
Dreamer component:
Take (province pop/20) or (sloth + 5*candles), whichever is smaller.
If random number 0-99 is less than this value, you get dreamers.
If on land, it's always Human Dreamers.
Otherwise, equal chances for Deep One Dreamer, Triton Dreamer, and Merman Dreamer#1572
No matter which type, get 2d8 exploding.
MA Ermor
If you don't have candles, you get nothing.
If you don't own the province, you get nothing.
Candle value = (candles / 2) + 2
If you have a temple, add (8 * game setting's gold multiple)/100, rounded down.
Number of spawns = old candle value * 175/100, rounded down
If the number of spawns is 0 or negative, you get nothing.
For each spawn attempt:
Asphodel
first it checks to see if you have candles, if you don't it does nothing
then it checks something else I don't understand, if you don't have that it does nothing
Number of spawns = 3, or 4 if you have a temple in the province
For each spawn attempt:
if this is not a UW province, and a random number 0-9 < (number of candles + growth):
25% chance, if there are armed corpses, or always if there armed corpses but no unarmed corpses:
If there are only civilian corpses:
If any corpses were removed:
if this is not a UW province, and a random number 0-9 < (number of candles + growth), and something to do with the presence of a forest (I assume, if province is a forest, but sign flags are doing my head in right now):
There is a (2 + Growth + Magic)% chance to get a high quality spawn:
Equal chances for Mandragora, Carrion Beast#718, Minotaur Manikin, Carrion Beast#1006, Sagittarian Carcass
Otherwise, a low quality spawn:
Equal chances for Manikin, Satyr Manikin, Harpy Manikin, Carrion Beast#715, Carrion Beast#716, Carrion Beast#717
If you rolled a (regular) manikin or mandragora (unit ID - 313 < 2), you instead get Carrion Beast#715 or Carrion Beast#716, chosen at random
Spawn 1 of the selected creature type
Regardless of spawn attempts, spawn (closed) 1d2 Sagittarian Carcasses if all of the following are true:
(5 + Growth) * 2 + Candles * 3 > a random number 0-99
The province is not underwater
The province is a forest
The province has a temple