[MOD 0.12.11+] Underground mining drills

Topics and discussion about specific mods
Schmendrick
Fast Inserter
Fast Inserter
Posts: 223
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

Overene wrote:
Schmendrick wrote:
Overene wrote:This actually seemed like a cool mod until I realized that underground ores appear only in the spawn area and no where else.

Was happy to delete this.
Thank you for the compliment! Sorry you deleted a cool mod. :(
Is there a way to make underground ores spawn farther away from spawn or was that just a bug?
I'm not aware of any bug that prevents them from spawning further away. What other mods are you using?
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Overene
Fast Inserter
Fast Inserter
Posts: 130
Joined: Wed Mar 09, 2016 11:20 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Overene »

Schmendrick wrote:
Overene wrote:
Schmendrick wrote:
Overene wrote:This actually seemed like a cool mod until I realized that underground ores appear only in the spawn area and no where else.

Was happy to delete this.
Thank you for the compliment! Sorry you deleted a cool mod. :(
Is there a way to make underground ores spawn farther away from spawn or was that just a bug?
I'm not aware of any bug that prevents them from spawning further away. What other mods are you using?
Air filtering, blueprints strings, bridge railway, clock, crafting speed research, electricity xyle, evogui, reverse factory, rotatable pipes, simple teleporters, underground mining, and waitex.

I don't think any of these would affect that, but it might have been related to me playing on an island, and there were no underground resources beyond that island.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

With the new version regenerating via the command works, it doesn't work on load (which is fine for me).

Also, it seems like it only generates on empty land, or at least when there are no miners present. I had a copper field half covered in miners, and running the command only placed resources under the empty part of the field. Removing the miners and running the command again also made resources appear under the newly empties outpost.

This is fine for me, as I can now just call the command whenever needed, but I figured you might want the feedback :)

Schmendrick
Fast Inserter
Fast Inserter
Posts: 223
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

orzelek wrote:The autoplace trick on RSO - I do think it's not needed but I didn't play with it to check how it works if it simply removes all the autoplaces. That wouldn't help you I think :)
Somehow I misread this as meaning that you weren't sure how RSO did it... which did strike me a strange ;) (I thought maybe that part was written by someone else I guess.) Sorry for explaining your own code to you :) But, yes, removing all autoplace information would leave Underground Mining completely in the dark, as it completely ignores resources without autoplace info (my thinking was that such a resource is clearly script controlled and thus its "owner" wanted to strictly maintain it). But I have thought better of this (underground resources are only generated relatively immediately after initial resource placement, or when called via command) and now provide (sketchy) support for resources without autoplace specifications. Still working on the numbers for this, but this should be the last thing I need to do before I have the next "publishable" version, so when I get those hammered out I'll make an update to the original post.
orzelek wrote:Other thing is that RSO could spawn underground ore's in same way it upgrades ore to infinite one for Angelsores mod. It's quite easy to add - would need some input from you on how the infinite patches should relate to over-ground patches.
You can fire RSO with Angelsores to see how it works currently.
I'm simply offering to add support to RSO - it would guarantee ore spawns when both mods are in use.
Honestly, I think the way it is is fine; underground resources get placed in the same place above ground ones do. No reconfiguration for any new mods needed. My only real concern is that the quantities represented in RSO might not reflect the "natural" values estimated (a formula I want to rework at some point in the future anyway) from autoplace peaks, thus resulting in weird richness issues. But that's probably pretty minor.
orzelek wrote:Edit:
Actually about your bug. I took a quick look in the code and it seems for me then there is no trigger for generation of underground ores other then calling the regenerate command. So generation happens once on init and then it won't fire unless triggered. Might be missing something tho.
Script initialization sets on_tick, which does some initialization (including checking for underground resource types to be generated) and sets the on_tick event to be the real maintenance event. The first time the main event runs, it regenerates any of the new underground resources and sets the on_chunk_generated event, which files a queue of chunks to analyze. When the main tick event finishes processing a queue, it unregisters itself to save processing cycles (on_chunk_generated reregisters it).
vanatteveldt wrote:With the new version regenerating via the command works, it doesn't work on load (which is fine for me).

Also, it seems like it only generates on empty land, or at least when there are no miners present. I had a copper field half covered in miners, and running the command only placed resources under the empty part of the field. Removing the miners and running the command again also made resources appear under the newly empties outpost.
I am not sure why it isn't working on load... unless that's an artifact of placed mines somehow. When exactly isn't it running?

Actually my latest local version where I fixed the weird gaps - for some boneheaded reason (yay, debugging is always an adventure in reminding yourself what an idiot you are!) I was using the can_place_entity check (to avoid placing underground resources under water) with the underground miner entity instead of the resource. :roll: This is what was causing your observation, and trees, of all things, were causing the gaps in my own experiments (which is what first tipped me off to check that part of the code). (I know why I did it, and it was a decent reason, but there is a better way to go about it which I am now using.) You should probably wait until I have the new one (0.1.2) up in the original post and test that one to see what problems are still there. I'll also remove the earlier interim 0.1.2 file above, to avoid any confusion.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Darloth »

Thankyou for doing this, way better than I was doing or ever could.

This mod exemplifies just about everything I wanted from an underground drilling mod, with things I didn't even know I wanted until you did them.

In general, I like it a lot!

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

I started a new factory with this mod and rich settings (cause I was tired of building new outposts...)

Is it normal that underground resources only spawn on a small part of an ore patch?

This was a full iron ore patch that filled more or less the whole enclosure, but there are only a couple of underground resources:

Image

Edit: strange enough, the ore in my main base is fine. Is this an RSO problem again?

Edit: calling 'remote.call("underground-mining","regenerate")' caused the underground iron to disappear completely, also in my main base.

Schmendrick
Fast Inserter
Fast Inserter
Posts: 223
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

vanatteveldt wrote:I started a new factory with this mod and rich settings (cause I was tired of building new outposts...)

Is it normal that underground resources only spawn on a small part of an ore patch?

Edit: strange enough, the ore in my main base is fine. Is this an RSO problem again?

Edit: calling 'remote.call("underground-mining","regenerate")' caused the underground iron to disappear completely, also in my main base.
Schmendrick wrote:for some boneheaded reason (yay, debugging is always an adventure in reminding yourself what an idiot you are!) I was using the can_place_entity check (to avoid placing underground resources under water) with the underground miner entity instead of the resource. :roll: This is what was causing your observation, and trees, of all things, were causing the gaps in my own experiments (which is what first tipped me off to check that part of the code).
I really need to make the latest adjustments and update the OP...
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

No that you mention it, that patch was indeed covered with trees....

Thanks for keeping this mod alive and up-to-date! (I mean it, I'm a software development, I know that the pain starts when the release is out...)

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

Re: [MOD 0.12.11+] Underground mining drills

Post by orzelek »

RSO should not be affecting this.. but no warranties ;)

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

I've been playing a little bit with the drills, but I feel that they are a bit underpowered at the moment. I think an underground coal drill would hardly break even, correct?

I think I would want to increase (minimum) output by 2x or 3x, would that be easy to change in the lua?

from a very brief inspection, I would guess I should probably change

Code: Select all

control.lua:195 minimum[uname] = proto.minimum_resource_amount or 1
Into 2 or 3, does that make sense?

Schmendrick
Fast Inserter
Fast Inserter
Posts: 223
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

vanatteveldt wrote:I've been playing a little bit with the drills, but I feel that they are a bit underpowered at the moment. I think an underground coal drill would hardly break even, correct?
Solid fuel is renewable already; you'd only need an underground coal drill for plastic/explosives/etc. It's *supposed* to be an inefficient tradeoff versus recurrent relocation of mining operations.

That said,
vanatteveldt wrote: I think I would want to increase (minimum) output by 2x or 3x, would that be easy to change in the lua?

from a very brief inspection, I would guess I should probably change

Code: Select all

control.lua:195 minimum[uname] = proto.minimum_resource_amount or 1
Into 2 or 3, does that make sense?
The change you are looking for isn't in control, it's in data-updates. The minimum variable in control is just a reference so the placement knows the threshold below which not to generate underground ore. An infinite resource has a "normal" value and a "minimum" value. For oil these are 7500 and 750. An oil patch with an "amount" of 7500 will show ingame as 100% richness; 15000 as 200%, etc. The minimum value is just that; after producing and making the roll to determine whether to deplete the resource, it won't go below this. That's why vanilla crude ends up at a minimum of 10% richness. This doesn't stop scripting from producing a crude-oil patch at 375 (5% richness) or whatever. So the mod avoids that. Also, too low a threshold results in often awkward placement, visually, like the underground shadow ore spreading too far outside a surface patch, or looking ridiculously huge (and permanent!) over those tiny little spots of 2 or 3 resources.

So if you were looking to simply increase the minimum richness of all underground resources, you'd want to go fiddle with the actual resource prototypes in data-updates.lua around line 89 (not sure, my local copy is probably different from the uploaded one) where it caps depleted richness at 25% with

Code: Select all

if temp > .25 then temp = .25 end --autocalced vals max at 25% ()
with some other thing, like clamping a minimum value or something.

Even better though, especially if your main issue is with coal, read data.lua for my instructions for other mods to control the way Underground Mining handles their resources. You could make your own supplemental mod (listing underground-mining as a prerequisite) that has a data.lua with

Code: Select all

data.modcom.underground_mining.richness["coal"]={minimum=.5}
and boom, underground coal has a minimum richness of 50% without any dirty mod editing and the compatibility problems it poses.

Either of these methods will also affect the threshold for the placement method, though, so setting a high minimum may result in more surface patches without underground analogues. If this bothers you than the line you originally singled out is the one to edit. You could simply set minimum[uname] = 1 to remove the effective minimum (the or here is basically just a sanity check to avoid nil problems), or you could be a little kinder to the "too low a minimum is silly" principle and go with

Code: Select all

control.lua:195 minimum[uname] = (proto.minimum_resource_amount or 4)/4
or something.

I'm still kinda messing around with these numbers (see posts above) though so keep that in mind.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

Cool, thanks.

I understand it's supposed to be a tradeoff, and I wouldn't expect underground mining to be nearly as good as regular mining, but output seemed to me so low to not even make it worth the bother; then again, maybe I'm just lazy :). Note that there is also a tradeoff in terms of manufacturing and setup complexity and pollution, so I would think that intuitively a sweet spot would be output or around 25%-33% or the original field, so given that they are also larger in size I thought maybe 0.2/s might be a good value?

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Darloth »

After some playtesting (admittedly, in a low resources game) I also would agree that the underground resources are perhaps not rich enough to really justify the investment.

For reference - I start mining and get reported values of maybe 0.4 to 0.6 ore and a bit less stone per cycle, and after about... an hour or so, this has dropped to 0.1 ore and effectively zero stone.

First - I NEED that stone, and there's no "underground stone". An interesting possibility (though I realize due to the way resources work - way harder to code) would be that as you deplete the main resource, the chance of stone actually increases, leaving the total mining speed about the same.

Second and more importantly though - for the pollution they output, the requirement (which I like) to constantly fuel them with actual fuel instead of just electricity, and the additional filtering and post-processing necessary for a big, expensive dual output device, they just don't make very much stuff. Once they're depleted, which happens quite soon, there just isn't enough of the ore coming out for it to be worth it. Nobody needs an ore field which generates 0.5 iron ore per cycle, it just isn't enough to count in Factorio, where dozens or hundreds or even more per cycle are more realistic numbers.

I'd say somewhere in the region of a 30 to 50% minimum chance of generating an ore per cycle, and then the starting values also being increased (so you ended up with projected outputs of 1.5-2 ore per cycle, plus the same in stone) would be ideal, but again, this is one game where resources are pretty rare and so I do not know how widely applicable they might be.

Schmendrick
Fast Inserter
Fast Inserter
Posts: 223
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

vanatteveldt wrote:Cool, thanks.

I understand it's supposed to be a tradeoff, and I wouldn't expect underground mining to be nearly as good as regular mining, but output seemed to me so low to not even make it worth the bother; then again, maybe I'm just lazy :). Note that there is also a tradeoff in terms of manufacturing and setup complexity and pollution, so I would think that intuitively a sweet spot would be output or around 25%-33% or the original field, so given that they are also larger in size I thought maybe 0.2/s might be a good value?
Ok, let's math. Vanilla ore is about .525/second, or .0583 per tile per second (we'll ignore space for belts, to keep things simple). Underground miners work (at 100% production rate) at .775/s. Given the 12.5% chance to not produce, this means 100% richness is effectively .678/s, or .0424 per tile per second.
So if you want to end up with (usable) output at 25-33% the original field you'll want to place the minimum richness at about 35 or 45%.
Darloth wrote:First - I NEED that stone, and there's no "underground stone". An interesting possibility (though I realize due to the way resources work - way harder to code) would be that as you deplete the main resource, the chance of stone actually increases, leaving the total mining speed about the same.
There should be underground stone, but due to the minimum threshold thing if you're on a map with low resources they might not be showing up (see also the bug in current published versions about collisions with surface stuff, which may be blocking your stone). Underground stone also has a 100% chance to produce; normal resources have a 7/8 chance to produce the desired result and a 1/8 chance to produce stone instead, rolled separately due to Factorio mechanics (it *is* possible to take tighter script control of the situation, but that is hacky and inelegant, and less efficient, which I try to avoid), so you may get neither or both (10% each).
Darloth wrote:Second and more importantly though - for the pollution they output, the requirement (which I like) to constantly fuel them with actual fuel instead of just electricity, and the additional filtering and post-processing necessary for a big, expensive dual output device, they just don't make very much stuff. Once they're depleted, which happens quite soon, there just isn't enough of the ore coming out for it to be worth it. Nobody needs an ore field which generates 0.5 iron ore per cycle, it just isn't enough to count in Factorio, where dozens or hundreds or even more per cycle are more realistic numbers.

I'd say somewhere in the region of a 30 to 50% minimum chance of generating an ore per cycle, and then the starting values also being increased (so you ended up with projected outputs of 1.5-2 ore per cycle, plus the same in stone) would be ideal, but again, this is one game where resources are pretty rare and so I do not know how widely applicable they might be.
After hearing you mention this, I might look into adding "resource richness sensitivity" to the mod (basically just multiplying perceived surface levels for purposes of generating underground ore). The numbers in general should probably be revisited... in fact I may just publish my current in-progress version, whose most significant fix is the dumb placement issue, just to avoid confusion on that front, while I twiddle with the numbers for who knows how long.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Bonesters
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Apr 21, 2016 5:08 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Bonesters »

Hi, I've been using this mod for a while now, and I really like it, but I just can't seem to get it to work with modded ores (specifically the ores added by 5dim's mods). It generates underground versions of all vanilla ores properly, but doesn't generate any underground versions of his ores. I've tried the regenerate command, and tried it in both single and multiplayer. I've also tried using version 0.1.2 of underground mining, but it also didn't generate underground versions of the mod's ores. I'd appreciate any help you could give.

Mod list

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

What are good designs for underground drills?

There are three challenges:
- the drill area is the same as the building size, so every tile not covered by a drill is not producing
- you need to feed coal, ie belt/chest plus inserter
- you have dual output (ore + stone)

I now work with two designs:

Logistic: Share a passive provider between two drills, immediately outputting in the chest; and use a requester plus inserter to get fuel. Since the output facing left and right is not on the same tile, the design is staggered, allowing the coal requester to be re-used by the drill in the next row. This 'wastes' 6 tiles per two drills (2 chests, 2 inserters, one power pole, and one empty space), or 84% space efficient. Of course this uses quite a lot of bot energy as they transport the fuel and the output products.
logistic drills

Belt design for coal drills: run a belt from the drill to an output line, with the coal drill grabbing from the output line for fuel. This is a really small setup, and not terribly space efficient, but you can safely mirror the design, so efficiency is 3x4 missed tiles for 2x4x4 drill tiles, or 73%
coal drills
Belt design for non-coal drills: this adds the complexity of using the belt line both for input and for output, making it impossible to share the line with feeders from the left and the right, so efficiency drops to 67%.
belts
Any better designs / ideas?

Ryan123220
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon May 16, 2016 10:12 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Ryan123220 »

Hey Schmendrick,

I've added this mod to a game that is already started and I am having some issues. I have read through everything here but I have not had any luck yet. The big thing that I am having issue with is trees on top of ores causing the underground ores to not generate. To fix this I removed all the trees then regenerated the underground ores, but this causes another issue. If there is any already placed underground drills then the underground ores do not regenerate due to the entity being on top of it. Is there a way to remove the entity check so that the ores will generate under trees/drills as if they were not there?

User avatar
mojo2012
Inserter
Inserter
Posts: 25
Joined: Fri Apr 01, 2016 8:05 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by mojo2012 »

Hi guys,

I generally like the idea of underground resources. Is there a way to make this work with bob's ores mod? My mod is depending on it (although I could use another ore mod, if necessary).

Currently there are no underground ores generated for the newly added bobores, like zinc, because it seems that the "autoplace" field of the resource definition as created by bobores is not set correctly.

Any ideas how to fix this?

User avatar
MiniMe943
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Mon Mar 02, 2015 5:24 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by MiniMe943 »

Any word on updating for 0.13?

Schmendrick
Fast Inserter
Fast Inserter
Posts: 223
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

I'll make it a priority.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Post Reply

Return to “Mods”