Deep infinite mining drill

Place to get help with not working mods / modding interface.
Post Reply
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Deep infinite mining drill

Post by bNarFProfCrazy »

I considered making a mod that allows infinite mining (with a special drill building).
However the mining is bound to certain conditions.

1) You cannot get all resources from everywhere.
There will be a function that determines whether and how much of a resource is available at a certain place.
There can be more than one resource at a given location (if you are (un-)lucky then you can get all ores from there.

2) There shouldn't be an (visible) entity that shows which resource is available at a given location.
But you should be able to see the results when you try to place the deep mining drill, if you have a sensor nearby. (Similar to the default mining drills).

I thought about using some kind of yield resource patch like the crude oil fields. However I'm not sure how I could customize the yield/min-yield of each patch.

3) Running the drill should take resources. Concrete + lubricant + ? and produce different outputs with a different speed or result amounts or produce nothing for a run based on the location.
Location a Produces 5 copper core + 2 stone / run
Location b produces 1 copper core + 1 iron ore / run
Location c produces 5 stone / run
Location d produces 15 stone / run
Location e produces nothing at all
Each run costs 1 concrete + 0.1 lubricant everywhere (example)

Regarding 2) I thought of using some invisible ore entity created by the sensor structure.
Regarding 3) I thought of creating recipes (not prototyes?) on the fly and setting them via script as fixed one or using the yield from the invisible resource patches while playing with hardness to balance the amounts. However for the second idea I'm not sure how to handle the resource requirements then.

Any idea how to do this?
Or other suggestions how to do this?

xcompwiz
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 27, 2016 8:18 pm
Contact:

Re: Deep infinite mining drill

Post by xcompwiz »

1) In terms of accomplishing this without adding entities to the world, you could try a procedural method of calculating the resources at a location (example: Perlin Noise) which allows you to sample a region at will for little cost. Perlin noise is a good option as it's pretty close to a lookup (not quite, but close enough if not done too often). Once you generate the resources at a tile you could cache it for a time (current session or less).
This would at least provide you with the resource map. :) The noise could readily provide you with rates, which would be in keeping with oil.
NOTE: Be sure to use the surface seed when generating.

Displaying what resources a drill could/will get should mostly involve getting those numbers from the above map generation.

I'm afraid I'm too new to this to provide much help with the rest. I don't think the game likes recipes being made on the fly, so you probably don't want to go that route. I don't know how oil logic is defined, but that might be the best way.

Post Reply

Return to “Modding help”