Thursday, August 4, 2011

Tunnels: Multilevel Mining

continued from Tunnels: Basic Math of Efficient Mining

Update: A kind commenter recently pointed out to me that my "most time efficient" mining pattern is actually not the most time efficient! I've updated my post with a more efficient pattern that takes more advantage of the tendency of ore to appear in clusters. See my conclusions section for the updated pattern.

Maximizing visibility ratios and block ratios for multilevel mines is really a fun exercise, but it’s little more than a guess-and-check procedure. Before we start with the guessing-and-checking, though, I want to introduce a “rule” that helps narrow down candidates.

Golden Rule: Each level of tunnels should be shifted to the left or right from the one below it (“staggered”).

To consider why this is, look at the following two diagrams. One illustrates tunnels directly on top of each other, while the other illustrates a “staggered” system. The grey squares are unexposed spaces, the green squares are exposed ones, and the white are empty (that is, part of the tunnel).
ScreenShot015
The non-staggered system only exposes 11 blocks, to the staggered system’s 12. This is because the upper tunnel in the non-staggered system shares its floor with the ceiling of the lower tunnel, while the staggered system exposes another block instead.

Before we get into the results, I want to quickly make a quick note about my calculations. Feel free to skip it if you just want to see the most efficient mining patterns.

Calculation Note

In calculating the ratios of these mines, I’m assuming that the mine is basically being tessellated beyond the diagram. In other words, the ratios represent the mining pattern repeated ad ifinitum, and may differ slightly depending on where in the pattern your mine starts and ends. Counting the green squares and white squares on the pattern grids does not always produce accurate results.

Results: The Two (Now Three) Optimal Patterns

I’ve narrowed it down to two patterns which (I believe) are the most ideal. In other words, any alteration to these patterns tends to degrade their effectiveness. Pattern one maximizes block ratio – that is, it’s more efficient in terms of finding minerals quickly. Pattern two maximizes visibility ratio: it allows you to find all ore in an area, guaranteed. Pattern three takes advantage of the tendency of ore to appear in clusters by reducing the visibility ratio in order to reduce the amount of digging required to collect all the ore from an area.

Pattern Number Block Ratio Visibility Ratio
One 4 8/9 = 88.8%
Two
Three (submitted)
3
4
1 = 100%
about 50%
Pattern One
 ScreenShot016
Pattern Two
mining_pattern_2
Pattern Three

Summary Recommendation

It’s important to remember that ore tends to occur in veins, not just one-block pieces here and there. As such, the 89% visibility ratio of Pattern One will likely not result in any ore being missed – even if there is ore in the narrow areas of the ground that are unseen, it is likely that the ore would be in a vein that extends at least one block up, down, left or right, which would make the vein visible in a tunnel.

In other words, Pattern One is much more unlikely to actually miss ore than it’s visibility ratio suggests. Because of this and its block ratio advantage, Pattern One is commonly thought to be the most effective mining pattern, while Pattern Two is usually relegated to multiplayer server mines which are used by multiple people, when efficiency is less important and a perfect visibility ratio is desired.

Update: In terms of time efficiency, Pattern Three is actually the most effective. Since it is highly likely that ore appears in clumps, trying to expose all the ore in an area is actually unnecessary. In other words, tunnels have two ways of exposing ore: one is direct exposure, in that you can see the blocks directly, and the other is indirect exposure, where you can't see the block but blocks around it have been directly exposed so you can just assume that it isn't ore. Pattern Three takes advantage of indirect exposure to let the miner use fewer tunnels to excavate the same area.

Final Note: One must consider how to get to those upper mines from the shaft. A lot of miners angle their shaft upwards in the direction of the tunnels, producing a form of stairs and making their access shaft take the form of an italic v, or rather by a plane intersecting the vertical plane at a 45 degree angle. Alternatively, some miners might use ladders and many build staircases between floors in their access shaft.

Wednesday, August 3, 2011

Tunnels: Basic Math of Efficient Mining

Block Ratio

The theory of mine efficiency is extremely simple. Any time you dig a mine, you’re exposing blocks that could be something you want – iron ore, diamond, etc. Any such mine has a ratio of blocks exposed to blocks dug (block ratio). Consider the smallest, simplest mine: a tunnel one block wide and two blocks high. Such a tunnel of length l requires digging blocks equal to 2l. It exposes (that is, lets you see) all the blocks surrounding the tunnel, not counting the corners, as well as the blocks that you dug out to make the tunnel: eight blocks total per block-length of the tunnel, plus two at each end: 8l + 4.

Since tunnels tend to be long, it’s easier to drop the +4 constant – consider how insignificant those 4 blocks become as a tunnel approaches 100 block lengths or more! Dropping the constant makes the ratio very obvious: 8l / 2l = 8/2 = 4, the block ratio of a two-high tunnel. If you sketch a cross-section of the tunnel on graph paper and label the blocks dug and blocks exposed, it becomes clear why 4 is the correct ratio. This graph-paper shortcut turns out to be an efficient way to calculate the block ratio of most mining systems. which include long tunnels of a constant height and width.

It is the desire of an efficient miner to maximize the block ratio of their mine. A smart miner quickly notes that increasing the width or height of such mine tunnels, though, actually decreases the block ratio (since the volume of a solid increases faster than the surface area as the solid’s dimensions change). Does this one-by-two tunnel, then, provide the optimal possible ratio? I’ll spoil the surprise: yes.

However, the story isn’t over yet (luckily for Minecraft engineers like myself). Such a tunnel is transport-intensive (you have to walk the full length of your mine to extend it) and dangerously unattractive. Furthermore, there is another issue to consider, one much more fiddly and interesting. Imagine you’re on a multiplayer server and you are starting a personal mine below your vast estate. Of course, you don’t want to dig an absurdly long tunnel, since it would probably hit other people’s mines, and you’re only supposed to be digging underneath the land you own. How can you maximize the ore output of your property, while maintaining an acceptable block ratio in your mine?

This situation introduces two new issues that are really the same issue in different forms. First, how do we dig a mine with limited dimensions? Second, how do we find as much ore as possible in a given area? In other words, we want to dig a mine which is as space-efficient as possible.

Visibility Ratio

In order to quantify space-efficiency, I humbly introduce another variable to compete with the block ratio: visibility ratio. The visibility ratio of the mine is the number of blocks exposed by the mine system over the total number of blocks in the area: exposed / total – always between 0 and 1. An ideally space-efficient mine exposes all the blocks in the area; it has a visibility ratio of 1. The one-by-two mine tunnel, on the other hand, is perfectly inefficient in this respect: Only a tiny fraction of the blocks under your property would be exposed by a single tunnel. In general, and as the area in question becomes large, the visibility ratio of the single tunnel approaches 0.

Now we have to try to maximize two different ratios: block ratio and visibility ratio. However, the two tend to be at odds with each other. Mines with very high visibility ratio, like a quarry (a.k.a. big fat hole), tend to have very low block ratios, and tunnels, which have high block ratios, have low visibility ratios!

The answer, is, basically, to dig lots of tunnels close together (I think you can tell that I’m not very good at writing cliffhanger questions). One-by-two tunnels, dug parallel to each other (branching from a perpendicular tunnel that provides access) provide a visibility ratio of 1 along a horizontal plane. Other models produce efficient mining as well, but this form of mining (branch mining, in Minecraft vernacular) can’t be beat for maximizing both block and visibility ratios.

Generalizing Vertically

However, what about above and below the tunnels? You can’t see the corner blocks, so the perfect visibility ratio really only exists for the two-block height of the tunnels themselves, and the visibility ratio for the blocks directly above and below the tunnels is really more like 0.3 – not very good. Furthermore, the mining area of interest in your property (remember the thought experiment?) doesn’t just have a width and length: it has height. Rather than digging a mine on a purely horizontal plane, true space-efficiency is achieved with multi-level mines.

The rest is left as an exercise to the reader. (Kidding! Next post: efficient multilevel mines.)