I already have it on my list to review enemies, changing the spawning shouldn't be an issue.
Code: Select all
Biter spawner
result_units = (function()
local res = {}
res[1] = {"small-biter", {{0.0, 0.3}, {0.6, 0.0}}}
if not data.is_demo then
-- from evolution_factor 0.3 the weight for medium-biter is linearly rising from 0 to 0.3
-- this means for example that when the evolution_factor is 0.45 the probability of spawning
-- a small biter is 66% while probability for medium biter is 33%.
res[2] = {"medium-biter", {{0.2, 0.0}, {0.6, 0.3}, {0.7, 0.1}}}
-- for evolution factor of 1 the spawning probabilities are: small-biter 0%, medium-biter 1/8, big-biter 4/8, behemoth biter 3/8
res[3] = {"big-biter", {{0.5, 0.0}, {1.0, 0.4}}}
res[4] = {"behemoth-biter", {{0.9, 0.0}, {1.0, 0.3}}}
end
return res
end)(),
Spitter spawner
result_units = (function()
local res = {}
res[1] = {"small-biter", {{0.0, 0.3}, {0.35, 0}}}
res[2] = {"small-spitter", {{0.25, 0.0}, {0.5, 0.3}, {0.7, 0.0}}}
res[3] = {"medium-spitter", {{0.4, 0.0}, {0.7, 0.3}, {0.9, 0.1}}}
res[4] = {"big-spitter", {{0.5, 0.0}, {1.0, 0.4}}}
res[5] = {"behemoth-spitter", {{0.9, 0.0}, {1.0, 0.3}}}
return res
end)(),
Bob biter spawner
result_units =
{
{"small-biter", {{0.0, 0.3}, {0.5, 0.3}, {0.7, 0.0}}},
{"medium-biter", {{0.2, 0.0}, {0.6, 0.3}, {0.8, 0.0}}},
-- {"big-biter", {{0.6, 0.0}, {0.8, 0.4}, {0.9, 0.0}}},
-- Big enemies apear at 0.6, slowly become elemental between 0.7 and 0.8, and disapear by 0.9
{"big-biter", {{0.6, 0.0}, {0.7, 0.4}, {0.8, 0.0}}},
{"bob-big-piercing-biter", {{0.7, 0.0}, {0.8, 0.4}, {0.9, 0.0}}},
{"bob-huge-acid-biter", {{0.7, 0.0}, {0.8, 0.2}}},
{"bob-huge-explosive-biter", {{0.7, 0.0}, {0.8, 0.1}}},
{"bob-giant-poison-biter", {{0.8, 0.0}, {0.9, 0.2}}},
{"bob-giant-fire-biter", {{0.8, 0.0}, {0.9, 0.1}}},
{"bob-titan-biter", {{0.9, 0.0}, {1.0, 0.3}}},
{"bob-behemoth-biter", {{0.99, 0.0}, {1.0, 0.3}}},
{"bob-leviathan-biter", {{0.99, 0.0}, {1.0, 0.05}}},
},
Bob spitter spawner
result_units =
{
{"small-biter", {{0.0, 0.3}, {0.25, 0.3}, {0.35, 0.0}}},
{"small-spitter", {{0.25, 0.3}, {0.5, 0.3}, {0.7, 0.0}}},
{"medium-spitter", {{0.4, 0.0}, {0.6, 0.3}, {0.8, 0.0}}},
-- {"big-spitter", {{0.6, 0.0}, {0.8, 0.4}, {0.9, 0.0}}},
-- Big enemies apear at 0.6, slowly become elemental between 0.7 and 0.8, and disapear by 0.9
{"big-spitter", {{0.6, 0.0}, {0.7, 0.4}, {0.8, 0.0}}},
{"bob-big-electric-spitter", {{0.7, 0.0}, {0.8, 0.4}, {0.9, 0.0}}},
{"bob-huge-explosive-spitter", {{0.7, 0.0}, {0.8, 0.2}}},
{"bob-huge-acid-spitter", {{0.7, 0.0}, {0.8, 0.1}}},
{"bob-giant-fire-spitter", {{0.8, 0.0}, {0.9, 0.2}}},
{"bob-giant-poison-spitter", {{0.8, 0.0}, {0.9, 0.1}}},
{"bob-titan-spitter", {{0.9, 0.0}, {1.0, 0.3}}},
{"bob-behemoth-spitter", {{0.99, 0.0}, {1.0, 0.3}}},
{"bob-leviathan-spitter", {{0.99, 0.0}, {1.0, 0.05}}},
},
As you can see, to start with, everything from big and higher should drop by 0.1, and Leviathan has a 0.05 rating where most others have around a 0.3, meaning it's a 6th as likely to spawn.
To make things harder, I could add options to change the spawning so that tougher enemies show up even earlier, or in higher numbers in late game, or both.
They would all have to be startup options though, as this information is all read only in runtime.