Endless resources


Makes all ore deposits infinitely mineable. Includes modded ores, crude oil and modded liquids. Works in multiplayer and in games with multiple surfaces. In contrary to most other endless resource mods, this one does not convert the numbers on the ore patches to percentages and therefore still has ore patches change their size every now and then and let miners show the correct ratios.

Tweaks
8 hours ago
0.17 - 2.0
13.6K
Mining Cheats

b [Fixed] endless_recources freezing my game?

4 years ago

endless_recources freezing my game?
So i was playing on a pack with a lot of mods but every now and then it started to freeze took me a while to figure it out but endless_recources caused this.
Even if i go with NO mods enabled enabling this mod cuases freezing?
If i have to guess its every time an ore gets low and refills it.
Any id how to solve this?

4 years ago

May I ask what your PC specifications are? Mainly CPU. The mod iterates through all of the ore patches in frequent intervals. If it has to refill many ore patches at the same time, it can cause UPS-drops on low spec PCs. If you want to circumvent this and you don't need the refilling that often, you can always modify the control.lua of the mod and edit the time between iterations causing the lag less often. Alternatively you can let the mod refill to higher numbers so that refilling isn't necessary that often. Beside this, it is totally normal that you have ONE drop at the start of a new map because it has to do the initial refill where most of the ore patches are low on resources.

If you need additional help, please feel free to comment again under this topic.

4 years ago
(updated 4 years ago)

Here are my specs:
AMD Ryzen 7 2700X 3.7 GHz 8-Core Processor
MSI B450 GAMING PRO CARBON AC ATX AM4 Motherboard
Corsair Vengeance RGB Pro 32 GB (2 x 16 GB) DDR4-3200 CL16 Memory
NVIDIA GeForce GTX 1060 6GB

Not low end at all i would say if any my video card is a bit old...

And i did get more drops often the more the world progressed at a certain time it was every like 3mins a 10sec freeze
I dint try to dc my 2 second monitors (have 3 monitors 1x4k 2xHD but that again would come down to videocard issuses not CPU
I liteerly did try anyting exept edit the file u talking about

4 years ago

Your specs probably aren't the problem, mine are lower and it works without issues. Could you add this code into the control.lua file of the mod to check where the problem is exactly located?

"game.print("A")" at line 7 and "game.print("B")" at line 27 (without the outer quotation marks).

Then go into a game and look which of the letters (A/B) comes up when the lag occurs and if it is the same letter all the time. Also check if the letter comes directly before a lag or if there is an interval of time after the letter that is lag-free.

4 years ago

This is the letters i got in 5 mins, b is half second freeze, a (about)15secs freeze:
a,b,b,b,b,b,a,b.b.b
So only letter A seem to cause major freeze, i see the letter after the freeze.
Btw sounds just continu, but the screen freezes trains ect continu where i saw them last. idk if this is info you can use.

4 years ago

First thing I recognize is that the order of letters doesn't match what should appear according to the code (A every 2 mins, B every 20 secs) but this is just a minor flaw. That the sounds continue is typical for freezing in most games. How big is your map? I mean only the discovered part. Everytime you see a letter the mod searches the whole map on every surface and looks for low ore patches. This can cause UPS problems on large maps and games that have lots of surfaces. If your mining behaviour allows it (i.e. you don't mine stuff too fast) you can always make the checking intervals larger in my code by modifying the "on_nth_tick" parameters. Lets say for example that you mine 0.5 ores per second, you would need 2000 seconds to mine 1000 ores (my threshold to fill up). This means it is only necessary to check every 2000 seconds/120000 ticks. This way you can reduce the amount of checks greatly and the freezes don't occure as often as now. Alternativly if you don't mind loosing the changing in optical patch size, you can just enlarge the number the patches are set to to a really high number (e.g. a few millions) so they don't need to be refilled ever again.

4 years ago

well i do use this in space exploration meaning i have multible worlds technically idk but i guess that could be the issue here maybe.. but if i disable space exp, there are no other worlds to gen, even if i would to load the save i think. My world is indeed starting to get a maga base. I can ideed change the resource amout prob will go for that. I would usume that i'm only getting this freeze if it fills, not if its checking.

4 years ago

Ok that sounds like a savegame where my mod could cause problems... have you tried the things I explained in my last post?

4 years ago

had the same problem on a new map, only about 40~ ore patches visible, with a very highend system I was seeing 900+ spikes on the debug output, something like that just flat-out shouldn't be happening, perhaps a code refactor is in order, admittedly I don't have any experience with modding in this but could a staggered update of ore patches do the trick?

tested some other mods that do the same thing and none of them show this behavior.

4 years ago

I checked it myself and could reproduce it... I don't know why this happens in the new Factorio version since they didn't change much. A staggered update is unfortunately not possible because of the way you loop things in Factorio's scripts. The other mods don't show this behaviour because they work differently. They convert all resources to a fluid-type resource which are basically infinite by default (like oil in vanilla). The reason I didn't do this is because I wanted to keep the numbers of ore as numbers and not percentages and also further use the different stages of ore amounts as visuals. But I understand that freezes like this are game breaking, so give me a few hours to implement a better solution. It looks like it is finally time for plan B... :)

4 years ago

I just released the new version. Please inform me if it solved the problem for I reworked the entire code to a new system of regeneration. It should now use nearly zero resources of your system. Thank you both for the issue reports.

4 years ago

hey sorry dint realy have time to test, nice to see your working on it! I will test out tomorrow and ill let you know

4 years ago

i can indeed confirm it is fixed no more freezing when i use this mod thanks for your time :)

New response