Infinite Ores And Oil

by indiset

Prevents ore patches from running out Keeps oil at its initial yield UPS optimized for megabases Customizable mod settings Works with modded resources

Tweaks
3 months ago
1.1 - 2.0
50.8K
Mining Cheats

i Configurable Refill Amount and Capped Refill Amount

a month ago
(updated a month ago)

Perhaps, to make this initially more UPS-friendly, a refill amount incrementer, like 100, could be used: refill_amount+100, instead of refill_amount+1

In the mod's current state, I imagine initial performance costs can be steep with really low patch amounts (1, 2, 3, 4....). Yes, it gets better in the long run, but allowing a higher refill incrementer lessens the impact. I don't know. I barely play this game. Just like reading how people make their mods.

And you might need to, if the above is implemented, set a cap on storage.refill_amount, juuust in case it gets to the ResourceEntity's "amount" limit (uint32 or around 4 billion).

a month ago
(updated a month ago)

Hmm... I just realized something... on_resource_depleted is called for every tile, and this refill amount is incremented for every tile depleted. So, that amount increases quicker than what I thought. Again, I don't play factorio much.

And this means that newly mined resource patches will get potentially much larger refill amounts than the patches before it.

a month ago

Yeah, based on my testing this is not a real issue, the game will quickly get to over 1000 and then it stops becoming a real issue. I've found that the UPS impact is always very minimal unless you have stuff running every tick, which I don't. To your second point, someone would have to mine 8 * 10^18 ore for integer overflow to become an issue, which just isn't happening. Even and 1,000,000 ore mined per second (already unreasonable), it would take a quarter of a million years to deplete enough resources for an overflow to happen.

New response