[0.11.21+] 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:

[0.11.21+] Underground mining drills

Post by Schmendrick »

Adds underground versions of surface resources; plays nicely with mods that add resources, as well as RSO. Yes, I know this concept has been done already in different mods, but I like to think of mine as a cleaner and more balanced implementation.
underground.jpg
underground.jpg (131.87 KiB) Viewed 34982 times
Underground resources are accessible only by the underground mining drill, and work like oil in that they lose richness (chance to produce) but eventually reach a minimum value. Underground mining also has a chance to bring up stone instead of the desired resource.

Adds the tech Combustion drilling (and Combustion drilling 2), which unlock the diesel mining drill and the underground (burner) mining drill, respectively. The diesel drill is simply an improved burner mining drill; the underground mining drill allows access to the new underground resources.
combustiondrilling.jpg
combustiondrilling.jpg (29.87 KiB) Viewed 34982 times
Underground resource generation can take a little time (especially if loading a large existing map, or loading for the first time after adding a mod that adds a new resource) on startup. When loading an old map, underground resources will be generated based on current surface values, not original ones. To force generation of underground resources based on original methods, use

Code: Select all

remote.call("underground-mining","regenerate")
while your mouse cursor is is hovered over a resource in question (this works for the first player only). If you are not the first player or for whatever reason can not reach a sample of such a resource, use

Code: Select all

remote.call("underground-mining","regenerate","iron-ore")
with the game engine name of the resource.

Using this method will *not* work nicely with alternate resource generation mods such as RSO, but rather will produce underground resources based on what vanilla autoplace settings would have yielded.

Mod authors: read the notes in data.lua to change the default behavior of this mod with your resources.
  • Fixed bug where the mod 'forgot' it had already generated ores, leading to sometimes enormous load times, every time.
  • Version for Factorio 0.12.11+
Attachments
underground-mining_0.0.2.zip
(47.81 KiB) Downloaded 3636 times
Last edited by Schmendrick on Mon Jan 04, 2016 11:29 pm, edited 1 time 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: [0.11.21+] Underground mining drills

Post by Schmendrick »

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

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

Re: [0.11.21+] Underground mining drills

Post by Trev_lite »

do you think you could eventual add RSO comparability?

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

Re: [0.11.21+] Underground mining drills

Post by Schmendrick »

Trev_lite wrote:do you think you could eventual add RSO comparability?
Schmendrick wrote:plays nicely with mods that add resources, as well as RSO.
RSO / alternate spawning mods will only be an issue when manually regenerating resources; there's not much of a way around this.
Last edited by Schmendrick on Sat May 09, 2015 8:33 pm, edited 1 time in total.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [0.11.21+] Underground mining drills

Post by Trev_lite »

YAY!
what would be the interaction of this mod with the infinite resource mod?

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

Re: [0.11.21+] Underground mining drills

Post by Schmendrick »

This mod creates underground versions of any resource that:
  • Has an autoplace setting
  • Is of the default "basic-solid" resource category
  • Is not already infinite
It performs these changes in data-updates.lua, so if the infinite resources mod makes its changes in data.lua (or if for whatever reason is loaded by Factorio before Underground), then there will not also be underground copies made.

It names the new resource "underground-whatever", where "whatever" is the name of the source resource. If a mod adds resource(s) such that a "blah" and "underground-blah" both exist, this mod is likely to overwrite the "underground-blah" (though it has support to suppress this behavior if the mod author knows to indicate so). It will also place copies of "underground-blah" around deposits of "blah," based on their richness (there is currently no support to suppress this.)
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

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

Re: [0.11.21+] Underground mining drills

Post by Trev_lite »

is RSO mod supposed to say underground-xxx is not configured and will not be spawned? (i think so)
maybe you can talk to who ever is currently maintaining RSO to not have this error messaged when both mods are used.

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

Re: [0.11.21+] Underground mining drills

Post by Schmendrick »

So, as-is, underground ore generation is not very efficient, and can even crash Factorio if you load a large enough pre-existing map (especially with additional ores from mods). I'm working on making it a bit better, hopefully an update in a few days.
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: [0.11.21+] Underground mining drills

Post by orzelek »

I'm not sure how RSO should behave with this mod.

Reading your posts above - I think that RSO would need to take over spawning of underground copies of resources.
And fixed version of endless mod running in data-updates will mean no underground stuff - they are not needed then if I understand correctly.

To handle loading order I'd need to add dependency maybe - altho RSO does all the generation from control script so it would go after all data is ready.

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

Re: [0.11.21+] Underground mining drills

Post by Schmendrick »

Underground mining waits one tick after chunk generation (which is the time that RSO generates). So underground ores get placed after RSO places. With the exception of running the "regenerate" command (which runs Factorio's autoplace and then places underground ores based on them, then replaces the old surface resources), Underground mining works perfectly fine with RSO (or anything else that handles resource manipulation on the onchunkgenerated event). The upcoming update will wait even longer, because of the way I am spreading out the generation algorithm.
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: [0.11.21+] Underground mining drills

Post by orzelek »

There are 2 ways:
1. Ignore the RSO warnings and all should work :D I can make it not display warning for underground-* ores.
2. Make RSO aware of underground resources and vice-versa. Then RSO can create the underground resource in it's own generation loop saving you lots of work. It goes creating resource tile by tile anyway.

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

Re: [0.11.21+] Underground mining drills

Post by Schmendrick »

orzelek wrote:There are 2 ways:
2. Make RSO aware of underground resources and vice-versa. Then RSO can create the underground resource in it's own generation loop saving you lots of work. It goes creating resource tile by tile anyway.
Underground ores are handled entirely by control.lua, based on surface resources generated by any method; it waits a tick to do its thing specifically so that it will work seamlessly with mods like RSO -- and it does, apart from possible warning announcements. Tightly integrating it with exceptions and special behavior for RSO (which would also need modification) is unnecessary, would only complicate its behavior with other configurations (including vanilla) as well, possibly, as updates to either mod, and would just generally be a waste of time.

The generated underground ores have no autoplace data. Resources with no autoplace data (from this or any other mod) will only ever be created by script and never by vanilla Factorio. Since RSO is intended to replace vanilla generation, perhaps it could be modified to ignore (and not produce warnings for) resources with no autoplace, since they are not under the purview of what it is replacing?
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: [0.11.21+] Underground mining drills

Post by orzelek »

I'll take a look at adding auto-ignore for stuff that has no autoplace information. Might need to find some other mods that have resources like that but I have list of few already in explicit ignore list.

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

Re: [0.11.21+] Underground mining drills

Post by orzelek »

It turns out that I can't check autoplace information - it's not accessible from control file.
I'll need to use the name prefix to suppress the warnings.

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

Re: [0.11.21+] Underground mining drills

Post by Schmendrick »

Well, more and more info becomes available to scripting as versions advance... fingers crossed :)
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Nafen
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Jun 10, 2015 2:53 pm
Contact:

Re: [0.11.21+] Underground mining drills

Post by Nafen »

This does not seem to work with RSO despite RSO's changelog showing it now has compatibility ...

If I launch a new world with just RSO and Underground mining drills, no underground ores are generated. Even using Underground mining drills' regenerate command or RSO's regenerate command doesn't fix it.

Disabling RSO and restarting the game, Underground mining drills generates the underground ore on creating new world ..

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

Re: [0.11.21+] Underground mining drills

Post by orzelek »

RSO's compatibility was only to disable it's ore check to not warn about unconfigured ores that underground mining drills make.
My guess would be that something broke with my RSO updates - I didn't do any long checking if to works properly.

Nafen
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Jun 10, 2015 2:53 pm
Contact:

Re: [0.11.21+] Underground mining drills

Post by Nafen »

It sucks that they don't play nice together, I really like the idea that you would have to travel further away to get more resources to work with (RSO) but then you could still utilise each resource node once you have researched a bit more (underground drills).

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

Re: [0.11.21+] Underground mining drills

Post by orzelek »

I might take a look at it at some point to try and figure out what's happening.
Not before 0.12 for sure.

Rhamphoryncus
Fast Inserter
Fast Inserter
Posts: 120
Joined: Tue Jul 14, 2015 10:57 pm
Contact:

Re: [0.11.21+] Underground mining drills

Post by Rhamphoryncus »

Any news on updating underground mining drills for 0.12?

I poked at endless ores/bobsore infinite mode and underground mining drills seems much cleaner, so I'm quite curious to try it out.

Post Reply

Return to “Mods”