[MOD 0.12.0] endless resources

Topics and discussion about specific mods
Nagshell
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Wed Feb 25, 2015 1:53 pm
Contact:

Re: [0.11.1] endless resources

Post by Nagshell »

How can I make it work with DyTech ores and gems? I'd love to get more of those (*_* )

User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 348
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [0.11.1] endless resources

Post by MasterBuilder »

Nagshell wrote:How can I make it work with DyTech ores and gems? I'd love to get more of those (*_* )
Given the way it loops it should work with any resource ever. Only issue is load order.
If you make sure DyTech loads first, then this mod, it will alter DyTech's ores.

Easiest way do do this is add optional dependencies; something like:

Code: Select all

"dependencies": ["base >= 0.11.1", "? DyTech >= 0.0.0"]
(The '?' signifies that it's optional. And this isn't the right name or version, just an example.)

Do this for every mod that adds a resource and you're golden. (Most mods that add resources usually have "./prototypes/resources.lua".)
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.11.1] endless resources

Post by kovarex »

No, the proper way is to use the data-updates.lua instead of data.lua, so it is alwyas loaded after all the mods are initialised no matter what they are.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.11.1] endless resources

Post by bobingabout »

in ANY mod(this one or otherwise), make a data-updates.lua (as suggested by Korvarex) which contains the following content

Code: Select all

for _, resource in pairs(data.raw.resource) do
    if not resource.infinite then resource.infinite=true end
    if not resource.minimum then resource.minimum=20 end
    if not resource.maximum then resource.maximum=350 end
end
This will make all minable resources infinite.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Nedreow
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed May 06, 2015 3:08 pm
Contact:

Re: [0.11.1] endless resources

Post by Nedreow »

I have been trying to increase the minimum yield of the patches but it seems like the yield goes down when i make it higher, how can I make it so that the mining never slows down?

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: [0.11.1] endless resources

Post by SirRichie »

My own tests indicate that setting the minimum attribute of a resource achieves that.

However, a minimum of 100 does not mean 100% yield. When using endless resources, the values shown in Factorio are not accurate, as yield is calculated per resource tile, but drills usually access multiple resources tiles. In my experience, the default values of endless resources are good. If you do not want your resources to drop below ~100% yield, try 350 as the minimum.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.11.1] endless resources

Post by orzelek »

I'm using the mod with slight modification and while maximum value won't work directly (due to richness calculations I think) minimum value is respected exactly. So 25 minimum means that resource will get to 25% on map per tile.

Trev_lite
Inserter
Inserter
Posts: 43
Joined: Sat Mar 28, 2015 9:20 pm
Contact:

Re: [0.11.1] endless resources

Post by Trev_lite »

when i use endless resources the oil wells show 3-6k% instead of the normal 200-300%. is this normal?

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: [0.11.1] endless resources

Post by SirRichie »

I haven't verified this, but I don't think it is normal. endless resources does not change a single bit in the oil resource definitions, it just changes ores (oil is already endless...)
Are you sure you do not have any other mods?

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.11.1] endless resources

Post by orzelek »

As I recently found out actual displayed percent depends on normal value for given ore. So mod can actually affect %-ages displayed.

Trev_lite
Inserter
Inserter
Posts: 43
Joined: Sat Mar 28, 2015 9:20 pm
Contact:

Re: [0.11.1] endless resources

Post by Trev_lite »

SirRichie wrote:I haven't verified this, but I don't think it is normal. endless resources does not change a single bit in the oil resource definitions, it just changes ores (oil is already endless...)
Are you sure you do not have any other mods?
i have RSO mod but the guys over there said it was a problem with endless resources.

fake double post:

i have a sugesttion for the fix
replace

Code: Select all

for k, v in pairs(data.raw.resource) do
   data.raw.resource[k].infinite = true
   data.raw.resource[k].minimum  = 175
   data.raw.resource[k].normal   = 350
end
with something like

Code: Select all

for k, v in pairs(data.raw.resource) do
   if not data.raw.resouces[k].infinite then
        data.raw.resource[k].infinite = true
        data.raw.resource[k].minimum  = 175
        data.raw.resource[k].normal   = 350
    end
end

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: [0.11.1] endless resources

Post by SirRichie »

Shame on me, it does change oil!
I had this vague memory that it only changed ores... guess I was wrong

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.11.1] endless resources

Post by orzelek »

I'm using similar but with minimum set to 25 and normal to 100 :D
This one will stop at 50% but there might be lower generated from start I think.

Darloth
Fast Inserter
Fast Inserter
Posts: 117
Joined: Sun Jun 08, 2014 3:57 pm
Contact:

Re: [0.12.0] endless resources

Post by Darloth »

It's worth noting that even though things say 3000% yield, miners can't actually go any faster than 100%. The yield is the percentage chance to produce a lump of ore, but they can only ever produce at most 1 lump at a time, even if the "yield" is 3000%.

As such, setting a high normal figure should mean that the yield starts to drop off (reaches less than 100%) earlier, but each percentage point of drop takes longer to occur, so the higher you set the normal, the more oil-like and the less ore-like it behaves. I haven't extensively tested that though.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.12.0] endless resources

Post by orzelek »

I'm currently testing with min = 200 and normal = 1000.
It should stabilize at 20% which means that you can continue to work the field but finding new ones will be necessary to keep the throughput up.

If someone wants to play around I'm attaching it here. It's also modified to affect all ores (added by mods for example) and don't touch oil.
Attachments
endless-resources_0.3.0.zip
(841 Bytes) Downloaded 811 times

Boun6000
Burner Inserter
Burner Inserter
Posts: 15
Joined: Wed Jul 29, 2015 7:51 am
Contact:

Re: [0.12.0] endless resources

Post by Boun6000 »

LoSboccacc wrote: (never tested with other resources adding mod)
it works with resource adding mods

zampa
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Nov 23, 2015 7:27 pm
Contact:

Re: [MOD 0.12.0] endless resources

Post by zampa »

Hey guys, I just started using endless resources in a marathon game, figured it'd be fun to play through, but I just now noticed that the yield actually drops the longer you mine a specific patch, can I change it to somehow always have stardard yield (like a normal game) but JUST endless quantity... I spend a good amount of hours in this marathon game and it would suck to have to find new patches far away from my base...

Edit: I tried setting " data.raw.resource[k].minimum" to all kind of values between 10 and 10,000 (highest yield seem to be the lower number i go to (e.g. 10), but still fields seem to drop to a lower and lower yield rate. I just want to get 1 resource every cycle :/


So tl:dr:
Can I keep the yield the same, and just have limitless resources?

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: [MOD 0.12.0] endless resources

Post by SirRichie »

I haven't tested, but what you would want to have are values where .minimum equals .normal
Of course, that won't help you with a game already in progress where resources have dropped below .normal (anything below .normal will decrease the yield below 100%).

So for a running game, probably something like
.normal = 10 and .minimum = 10
might work.

User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 348
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [MOD 0.12.0] endless resources

Post by MasterBuilder »

zampa wrote:Hey guys, I just started using endless resources in a marathon game, figured it'd be fun to play through, but I just now noticed that the yield actually drops the longer you mine a specific patch, can I change it to somehow always have stardard yield (like a normal game) but JUST endless quantity... I spend a good amount of hours in this marathon game and it would suck to have to find new patches far away from my base...

Edit: I tried setting " data.raw.resource[k].minimum" to all kind of values between 10 and 10,000 (highest yield seem to be the lower number i go to (e.g. 10), but still fields seem to drop to a lower and lower yield rate. I just want to get 1 resource every cycle :/


So tl:dr:
Can I keep the yield the same, and just have limitless resources?
You can, but, not easily for an existing save.
Basically, all 'endless' resources have a min & max yield. Raising the min will not stop the yield from dropping, just from going below that threshold. If you set the min & max the same the yield should, in theory, never change.
When the fields are generated they use & save the current min/max values. Changing the minimum will only work for NEWLY generated resources.

If you want this to happen on existing resources you'll have to regenerate them.
IIRC there is a command to regenerate all resources but this may cause more problems that it will solve if your map was created using an older resource generation algorithm OR if mods have added resources since the initial generation.

EDIT: Just made this (untested) and I don't know if it works on endless resources. (Wiki page only shows 'amount' for the resource entity but this could just be out of date.)
Pasting this into the console should work. Or maybe it will destroy your game. Or maybe nothing. Use at your own risk.

Code: Select all

/c for _,ore in pairs(game.player.surface.find_entities_filtered({area = {{game.player.position.x+20, game.player.position.y+20}, {game.player.position.x-20, game.player.position.y-20}}, type="resource"})) do
	ore.amount = 200
end
If it works it will set the 'amount' of any resource entity within a 40^2 tile area around the player.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.

BronyTheGamer
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Mar 12, 2016 4:24 pm
Contact:

Re: [MOD 0.12.0] endless resources

Post by BronyTheGamer »

Could someone please make this compatible with Yuoki ores?

Post Reply

Return to “Mods”