Factorio and Conquer: Tiberian Dawn


Adds Tiberium ore that spreads - Harvest it, refine it, and convert it to power, weapons, and other ores. By Zillo7 (0.15), SAH4001 (0.16), Oktabyte (0.17), JamesFire and randomflyingtaco (0.17 update and 0.18+)

Content
a month ago
0.17 - 2.1
46.0K
Combat Environment Mining Manufacturing Power

i Performance suggestion

4 days ago

Hi! I'm a fellow modder.

A player sent me his save (Factorio 2.1.24, 244 mods, nauvis 25,447 chunks / 488,800 entities, a second planet with 223,835 entities) and told me he was having some lag spikes. I had a look at his save and did some benchmarking and noticed some of the lag was coming from this mod.

There seems to be a 5-minute handler at control.lua:1479 (storageIntegrityChecks, :1486) takes about 145 ms in one tick. It is the only thing on that tick: with the mod removed (and interstellar-progression-overhaul, which depends on it) the tick drops from 239 ms to 92 ms. Split by call: count_entities_filtered{name = "tibGrowthNode"} on every surface 62 ms, get_resource_counts() on every surface 84 ms to read two values.

The save has no tiberium nodes and no tiberium ore, so both are pure whole-surface scans that find nothing and keep triggering every 5 minutes.

I was thinking that this could be improved by tracking blue and green amounts in your growth code or only call get_resource_counts on surfaces that have tiberium (a surface with no node in the list can be skipped), and maybe keep the node list in sync with register_on_object_destroyed so the full count is only needed after a configuration change; or maybe spread the surfaces over several ticks so that the entire load doesn't get handled in the same tick, making it a smoother experience. The mod is pretty big, so I might be mistaken in my suggestions or might have missed some detail, but I hope this helps!

Have a nice week!

New response