[MOD 0.12.11+] Underground mining drills

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

[MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

Type: Mod
Name: Underground Mining
Description: Adds combustion drilling and underground resources.
License: CC BY-NC 4.0
Version: 0.1.1
Release: 2016-03-13
Tested-With-Factorio-Version: 0.12.26
Category: Gameplay
Tags: Resources, Burner
Download-Url:
underground-mining_0.1.1.zip
(48.36 KiB) Downloaded 783 times
License
Long description
Pictures
Version history
Attention Mod Authors
Last edited by Schmendrick on Sun Mar 13, 2016 9:00 pm, edited 4 times in total.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

Fixed a stupid bug.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

TRauMa
Inserter
Inserter
Posts: 40
Joined: Fri Jan 15, 2016 3:48 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by TRauMa »

Hello,

with factorio 0.12.17 (linux-x64) and v0.0.4 of your mod I get this error when I load a previously existing save created without the mod:

Error while running the event handler:
__underground-mining__/control.lua:147: bad argument #1 to 'next' (table expected, got nil)

No other mod messes with mining and ores, except Test Mode and Ore Expansion.

If you need more info, just poke me. :)

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

TRauMa wrote:Hello,

with factorio 0.12.17 (linux-x64) and v0.0.4 of your mod I get this error when I load a previously existing save created without the mod:

Error while running the event handler:
__underground-mining__/control.lua:147: bad argument #1 to 'next' (table expected, got nil)

No other mod messes with mining and ores, except Test Mode and Ore Expansion.

If you need more info, just poke me. :)
Yeah, I know. My conversion to ..11+ was incomplete, and I didn't test it enough in my rush to get it out. I have my local copy fixed, but the whole issue of loading an old save (or regenerating ore) is kinda broken right now. It's probably something simple I've overlooked, but I don't have time to work on it more at the moment. I suppose I should upload what I have though...
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

TRauMa
Inserter
Inserter
Posts: 40
Joined: Fri Jan 15, 2016 3:48 pm
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by TRauMa »

Schmendrick wrote:I suppose I should upload what I have though...
If you do, I'll perhaps look into bringing it up to speed over the weekend (didn't look inside yet, so no promises ;) ).

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

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

Can I use this on an existing map (i.e. already played without the mod)?

Do I need to place this on an existing ore patch? Or can I place it on a completely exhausted ore patch?

How does deep mine yield (per second and per fuel used) compare to regular electric mine yield on a not-yet-depleted patch?

(i.e. is intended use to first strip an ore patch using regular mines, and then place deep mines, or directly place deep mines?)

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

Updated/fixed.
vanatteveldt wrote:Can I use this on an existing map (i.e. already played without the mod)?
Yes. Version 0.1.0 didn't, but 0.1.1 should work again.
Do I need to place this on an existing ore patch? Or can I place it on a completely exhausted ore patch?

How does deep mine yield (per second and per fuel used) compare to regular electric mine yield on a not-yet-depleted patch?

(i.e. is intended use to first strip an ore patch using regular mines, and then place deep mines, or directly place deep mines?)
The mod adds an "underground" version of the resource, which normal drills can't mine (just like a normal mining drill can't drill for oil), and it places patches of the underground ore in areas where the "surface" resource is (you can see this in the second picture). So you could put both normal miners and underground miners in the same patch. But underground mining is slow, unreliable, pollutes very much, and sometimes yields stone instead of (or in addition to) what you wanted - and sometimes completes a mining cycle without producing anything, if it is a poor vein! (Underground resources will never completely run out, but their odds to produce with each cycle get less and less as time goes on, to a certain minimum.) So you would almost never want to use underground mining while there is still surface ore. A full deposit will yield ore roughly 50% faster than an electric miner, a depleted one (after taking into account its rate of "dud" cycles) might produce ore at 1/3 or even 1/5th the speed (it varies by resource).
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

I added the mod to a game I'm running, but I don't see any "underground ore" sprites like in your picture, and I can't place a undergroud miner on a depleted or active mine. Does it only work on new fields? Can I generate the ore layer somehow?

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

Hm. I'm not sure what went wrong. The mod works by watching as new map is generated and placing the underground resources where it already finds surface ones. When it's starting with a pre-existing map, it will base them on whatever is left on the surface at that time, so you won't get underground fields anywhere you've already removed a field (or almost removed; the )

Do you have any other mods active? Is/was it a multiplayer map (it should work for multiplayer maps, but I haven't tested it so I can't be certain)?

I was going to give you a few commands to see if they helped, but I tested them myself to make sure they were working and... something's wrong with them. My underground resources generate appropriately on a new map, and seemed to do so when loaded into an existing save (though just a quick one I made for testing, not an established game), but I tested the regeneration function and it's buggy, so now I have that to look into. You're welcome to try it anyway in the meantime.
Bugged Regeneration
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

Thanks for the reply.

I ran the command with my cursor on an iron ore field. It hung for a while (30 seconds or so), but didn't seem to generate any underground resources (not visible and a deep miner has no expected resources and can't be placed). What it did do is mess up my resource count according to YARM, it went down to 0 for all my iron ore fields. I'm now restarting without YARM, if that doesn't fix it Il'l post a list of all mods.

Edit: no luck. List of mods is copied below. Anything else I can try? Want me to post my savegame?

Code: Select all

$ grep -B1 "true" mod-list.json | grep name
            "name": "base",
            "name": "advanced-logistics-system",
            "name": "color-coding",
            "name": "EvoGUI",
            "name": "expanded_tools",
            "name": "FARL",
            "name": "Foreman",
            "name": "InitialScan",
            "name": "Landfill",
            "name": "launch-control",
            "name": "Orbital Ion Cannon",
            "name": "Piano_Player",
            "name": "RailTanker",
            "name": "rso-mod",
            "name": "SmartTrains",
            "name": "STRS",
            "name": "underground-mining",
            "name": "Warehousing",
            "name": "YARM",

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

vanatteveldt wrote:I ran the command with my cursor on an iron ore field. It hung for a while (30 seconds or so), but didn't seem to generate any underground resources (not visible and a deep miner has no expected resources and can't be placed). What it did do is mess up my resource count according to YARM, it went down to 0 for all my iron ore fields. I'm now restarting without YARM, if that doesn't fix it Il'l post a list of all mods.

Edit: no luck. List of mods is copied below. Anything else I can try? Want me to post my savegame?
Ok well first of all, the regenerate command takes so long because it records EVERY resource tile (of the resource in question), deletes it, calls Factorio's regenerate function, places the underground resources, deletes all the newly regenerated resources, and then recreates each of the recorded patches. This is why YARM got zeroed out: all the resources it was monitoring were destroyed and replaced with copies. This also means that regeneration is incompatible with RSO: it will place underground ore where vanilla would have generated them (and if I remember correctly, RSO actually zeroes out this generation to avoid being interfered with). So regenerate won't work for you with RSO. I'm still not sure why no patches were generated when you loaded the map, though, because it looks at existing resources (and it waits a tick before doing so, to ensure mods like RSO have a chance to do their thing first). I still suspect there's an issue with RSO though. I haven't looked at its more recent versions very closely, and maybe some of those changes are part of it. Underground mining looks at resource autoplace information to generate appropriate values for the underground stuff, and right now I'm thinking my mod is seeing a lot of zeroes and deciding nothing's worth existing. I'll take a look into it to see if that's the case, and try to come up with a good fallback if it is.

(This still doesn't help me figure out what's wrong with my own broken regeneration function though... it works, kinda, but with weird large gaps in the underground patches.)
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by vanatteveldt »

Cool! Give me a shout when I can do/test anything. Happy debugging :)

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:
vanatteveldt wrote:I ran the command with my cursor on an iron ore field. It hung for a while (30 seconds or so), but didn't seem to generate any underground resources (not visible and a deep miner has no expected resources and can't be placed). What it did do is mess up my resource count according to YARM, it went down to 0 for all my iron ore fields. I'm now restarting without YARM, if that doesn't fix it Il'l post a list of all mods.

Edit: no luck. List of mods is copied below. Anything else I can try? Want me to post my savegame?
Ok well first of all, the regenerate command takes so long because it records EVERY resource tile (of the resource in question), deletes it, calls Factorio's regenerate function, places the underground resources, deletes all the newly regenerated resources, and then recreates each of the recorded patches. This is why YARM got zeroed out: all the resources it was monitoring were destroyed and replaced with copies. This also means that regeneration is incompatible with RSO: it will place underground ore where vanilla would have generated them (and if I remember correctly, RSO actually zeroes out this generation to avoid being interfered with). So regenerate won't work for you with RSO. I'm still not sure why no patches were generated when you loaded the map, though, because it looks at existing resources (and it waits a tick before doing so, to ensure mods like RSO have a chance to do their thing first). I still suspect there's an issue with RSO though. I haven't looked at its more recent versions very closely, and maybe some of those changes are part of it. Underground mining looks at resource autoplace information to generate appropriate values for the underground stuff, and right now I'm thinking my mod is seeing a lot of zeroes and deciding nothing's worth existing. I'll take a look into it to see if that's the case, and try to come up with a good fallback if it is.

(This still doesn't help me figure out what's wrong with my own broken regeneration function though... it works, kinda, but with weird large gaps in the underground patches.)
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.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

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. :(
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Dreadicon
Inserter
Inserter
Posts: 38
Joined: Sun Jun 22, 2014 9:06 am
Contact:

Re: [MOD 0.12.11+] Underground mining drills

Post by Dreadicon »

Just wanted to chime in that I love your mod and am quite happy you have kept it up to date. It's my favorite of the 'underground mining' mods.

A suggestion for the regen script: you might need to just brute-force it and scan the whole map manually; same for newly generated terrain, or hook into RSO directly. I wouldn't sweat it too much though; I LOVE RSO and wouldnt play without it.....but the devs apparently have something of the same idea. In a recent blog post, they basically outlined a mining overhaul that's something like a combo of RSO and your mod. I don't think it will make your mod or RSO obsolete, but it will make both your and the RSO devs' lives easier as you won't be fighting/hacking with the game so much as tweaking it.

Another idea that just popped into my head: prospecting! Set it up such that using an item will scan the map chunk for resources and place them at that time. That way you only need a brute-force regen command, and a localized regen action.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by Schmendrick »

Dreadicon wrote:Just wanted to chime in that I love your mod and am quite happy you have kept it up to date. It's my favorite of the 'underground mining' mods.
Thanks! Generally I like keeping things simple, and I like opening up options (hence my inclusion of the diesel drill; it's not just a stepping stone for the underground drill, though I'm not sure how much use it sees by players. It is more efficient than the basic electric drill, solar power aside).
Dreadicon wrote:A suggestion for the regen script: you might need to just brute-force it and scan the whole map manually; same for newly generated terrain, or hook into RSO directly.
Actually, this is pretty much what it does. It doesn't hook into RSO directly, but I have added a "refresh" option in my working build that just recalculates the underground resources based on current surface ones (without resetting anything), in case resources like RSO's haven't been caught for some reason.
Dreadicon wrote:In a recent blog post, they basically outlined a mining overhaul that's something like a combo of RSO and your mod. I don't think it will make your mod or RSO obsolete, but it will make both your and the RSO devs' lives easier as you won't be fighting/hacking with the game so much as tweaking it.
Yeah, I'm looking forward to it, provided it doesn't go against my personal ideas of game balance :lol:

In any case, they have been talking for a long time about exposing more of the map gen process to scripting, so hopefully mods like mine or RSO will be a lot cleaner and easier to implement, and even allow (non-hacky implementation of) complex stuff (abandoned villages? mazes?) ... eventually.
Dreadicon wrote: Another idea that just popped into my head: prospecting! Set it up such that using an item will scan the map chunk for resources and place them at that time. That way you only need a brute-force regen command, and a localized regen action.
I prefer to add as few new items or interfaces as possible, so probably not. If I did do something like that (and I do have ideas for a more comprehensive mod, actually, that might), it would probably be through some sort of custom radar type.

That said, an update: The problem with RSO was, indeed, related to the way RSO modifies base resources to not autoplace (basically, its massive negative influence addition caused my richness estimator to use its sanity check to wrap around to very positive, pushing to insanely high levels the threshold of surface resource concentration required for underground to appear). I've fixed that, but I'm still getting weird gaps in placed underground resources. I'm not sure why.

If anybody is interested in giving it a shot, here is my work in progress. It's mostly the same as the version in the OP, but it works with RSO and it (still?) sometimes has odd gaps in the middle of a field. It should be usable overall though if you want to get right to using it on an RSO map.
Attachments
underground-mining_0.1.2.zip
(48.5 KiB) Downloaded 129 times
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by orzelek »

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 :)

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.

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
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 :)

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 think you misunderstand; the mod (probably) works fine with RSO as it (the 0.1.2 WIP) is; the inconsistencies it has at this point don't seem to be caused by RSO and are probably a completely irrelevant bug. I can't speak with 100% assurance because, of course, I haven't found the bug yet and one never knows. But it shows up both with and without RSO, which otherwise seems to be handled fine.

RSO doesn't remove autoplace settings, it just adds a constant -1000 influence peak to all of them, causing them to never be high enough to generate. Underground mining (which attempts to dynamically be as compatible as possible with any mods or vanilla changes) uses the autoplace information of a resource to estimate appropriate richness values/thresholds for its underground counterpart, and this was throwing it off. It now ignores any constant (non-noise/attribute layer) influence -- though I should probably change that to have it ignore any influences beyond certain bounds, instead (or as well).
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [MOD 0.12.11+] Underground mining drills

Post by orzelek »

Schmendrick wrote:
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 :)

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 think you misunderstand; the mod (probably) works fine with RSO as it (the 0.1.2 WIP) is; the inconsistencies it has at this point don't seem to be caused by RSO and are probably a completely irrelevant bug. I can't speak with 100% assurance because, of course, I haven't found the bug yet and one never knows. But it shows up both with and without RSO, which otherwise seems to be handled fine.

RSO doesn't remove autoplace settings, it just adds a constant -1000 influence peak to all of them, causing them to never be high enough to generate. Underground mining (which attempts to dynamically be as compatible as possible with any mods or vanilla changes) uses the autoplace information of a resource to estimate appropriate richness values/thresholds for its underground counterpart, and this was throwing it off. It now ignores any constant (non-noise/attribute layer) influence -- though I should probably change that to have it ignore any influences beyond certain bounds, instead (or as well).
I know those :)

I'm simply offering to add support to RSO - it would guarantee ore spawns when both mods are in use.

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.

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: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?

Post Reply

Return to “Mods”