Rampant

by Veden

Improves the enemies tactics by using potential fields (pheromones) allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, raids, rallying death cry, and player hunting. Uses blockable biter projectiles. Adds new Enemies which can be disabled in mod settings. Difficulty setting in mod options menu.

Content
1 year, 2 months ago
0.13 - 1.1
124K
Enemies

b game.forces.enemy.evolution_by_killing_spawners keeps increasing

4 years ago
(updated 4 years ago)

Rampant 0.18.7

I created a small mod with only a tick handler to output when the evolution_by_killing_spawners (evo_s) changes. My character is standing idle; I had just finished killing about 10 bases. Here's a snippet at the start and a snippet and the end of a few day/night cycles. This pattern continues. I started at 22% evolution (17% from spawners) and ended my test at 66% (87% from spawners).

I noticed because at night time (I have nocturnal mode set), I got wrecked and there were big biters. That's what started me monitoring evolution and reloading an older save... and eventually writing the test.

 533.700 Checksum for script G:/Games/Factorio/temp/currently-playing/control.lua: 2466797803
 533.701 Checksum for script __personally-ratioed__/control.lua: 3191678421
 533.719 Checksum for script __Rampant__/control.lua: 4248612112
delta_ticks=   0 (0.00s) evo=0.226727 evo_s=0.050000 (17%) [darkness=0.000000]
delta_ticks=7379 (122.98s) evo=0.228489 evo_s=0.052000 (17%) [darkness=0.000000]
delta_ticks=   1 (0.02s) evo=0.229680 evo_s=0.054000 (18%) [darkness=0.000000]
delta_ticks=  61 (1.02s) evo=0.230869 evo_s=0.056000 (18%) [darkness=0.000000]
delta_ticks=   1 (0.02s) evo=0.232052 evo_s=0.058000 (19%) [darkness=0.000000]
delta_ticks=  61 (1.02s) evo=0.233234 evo_s=0.060000 (19%) [darkness=0.000000]
delta_ticks= 175 (2.92s) evo=0.234417 evo_s=0.062000 (20%) [darkness=0.000000]
delta_ticks=  63 (1.05s) evo=0.235591 evo_s=0.064000 (20%) [darkness=0.000000]
delta_ticks= 382 (6.37s) evo=0.236774 evo_s=0.066000 (21%) [darkness=0.000000]
delta_ticks=   1 (0.02s) evo=0.237939 evo_s=0.068000 (21%) [darkness=0.000000]
delta_ticks=2855 (47.58s) evo=0.239212 evo_s=0.070000 (22%) [darkness=0.000000]
delta_ticks=   1 (0.02s) evo=0.240369 evo_s=0.072000 (22%) [darkness=0.000000]
delta_ticks=  61 (1.02s) evo=0.241525 evo_s=0.074000 (23%) [darkness=0.000000]
delta_ticks=   1 (0.02s) evo=0.242676 evo_s=0.076000 (23%) [darkness=0.000000]
delta_ticks=  61 (1.02s) evo=0.243825 evo_s=0.078000 (24%) [darkness=0.000000]
delta_ticks= 175 (2.92s) evo=0.244976 evo_s=0.080000 (24%) [darkness=0.000000]
delta_ticks=  63 (1.05s) evo=0.246118 evo_s=0.082000 (25%) [darkness=0.000000]
delta_ticks=  96 (1.60s) evo=0.247259 evo_s=0.084000 (25%) [darkness=0.000000]
...
delta_ticks=1078 (17.97s) evo=0.662559 evo_s=1.704000 (87%) [darkness=0.349600]
delta_ticks=   1 (0.02s) evo=0.662786 evo_s=1.706000 (87%) [darkness=0.349550]
delta_ticks=  62 (1.03s) evo=0.663014 evo_s=1.708000 (87%) [darkness=0.346450]
delta_ticks= 236 (3.93s) evo=0.663243 evo_s=1.710000 (87%) [darkness=0.334650]
delta_ticks=  63 (1.05s) evo=0.663471 evo_s=1.712000 (87%) [darkness=0.331500]
delta_ticks= 159 (2.65s) evo=0.663698 evo_s=1.714000 (87%) [darkness=0.323550]
delta_ticks=1109 (18.48s) evo=0.663933 evo_s=1.716000 (87%) [darkness=0.268100]

Once I removed Rampant and had only that one mod installed that outputs the above lines, the evolution from killing spawners remained stable.

Here's the on_tick handler I wrote:

local evo_s_prev = 0
local evo_tick_prev

script.on_event (defines.events.on_tick,function (event)
    local evo = game.forces.enemy.evolution_factor
    local evo_t = game.forces.enemy.evolution_factor_by_time
    local evo_s = game.forces.enemy.evolution_factor_by_killing_spawners
    local evo_p = game.forces.enemy.evolution_factor_by_pollution
    local evo_total = evo_t + evo_s + evo_p

    if not evo_tick_prev then evo_tick_prev = event.tick end

    local delta_ticks = event.tick - evo_tick_prev

    if evo_s ~= evo_s_prev then
        local surface = game.surfaces[1]
        print (string.format ("delta_ticks=%4d (%.2fs) evo=%f evo_s=%f (%d%%) [darkness=%f]",
                delta_ticks, delta_ticks / 60, evo, evo_s, evo_s * 100 / evo_total, surface.darkness
        ))
        evo_s_prev = evo_s
        evo_tick_prev = event.tick
    end
end)
4 years ago
(updated 4 years ago)

I have /command game.speed=10 because it takes a little bit before Rampant starts ticking.

  • If I take a clean save w/o Rampant and then re-enable Rampant - starts ticking again;
  • If I call /command game.forces.enemy.reset_evolution() - resets and and ticks;
delta_ticks=   0 (0.00s) evo=0.226804 evo_s=0.050000 (17%) [darkness=0.000000]                  
delta_ticks= 553 (9.22s) evo=0.000000 evo_s=0.000000 (-9223372036854775808%) [darkness=0.000000]
delta_ticks=6829 (113.82s) evo=0.002708 evo_s=0.002000 (73%) [darkness=0.000000]                
...
  • If I load the clean save w/o Rampant and call reset_evolution, it only shows the reset calculation above, no ticking;
  • If I then load the clean save w/ Rampant (evolution has been reset), it ticks after a bit.
delta_ticks=7347 (122.45s) evo=0.002859 evo_s=0.002000 (69%) [darkness=0.000000]
delta_ticks=  62 (1.03s) evo=0.004852 evo_s=0.004000 (82%) [darkness=0.000000]  
...
4 years ago
(updated 4 years ago)

On a hunch, because Rampant's biter bases are so prettily organized and the step increase matched by Factorio config, I added a new event handler to watch for spawners dying... sure enough:

delta_ticks=7346 spawner death at {x = -123, y = -219}
delta_ticks=   1 (0.02s) evo=0.002859 evo_s=0.002000 (69%) [darkness=0.000000]
delta_ticks=  61 spawner death at {x = -187, y = -187}
delta_ticks=   1 (0.02s) evo=0.004852 evo_s=0.004000 (82%) [darkness=0.000000]
delta_ticks=   0 spawner death at {x = -59, y = -219}
delta_ticks=   1 (0.02s) evo=0.006833 evo_s=0.006000 (87%) [darkness=0.000000]
...

It appears that (for whatever the reason), Rampant is whacking off biter bases, which spikes the evolution.

4 years ago
(updated 4 years ago)

Meant to edit not quote

4 years ago

Thanks for the report, should be fixed in the latest.

New response