Ore Generation (Legacy): Difference between revisions
Content deleted Content added
Repolainen (talk | contribs) No edit summary |
m updating to minecraft.wiki links |
||
(24 intermediate revisions by 6 users not shown) | |||
Line 1:
== TL;DR ==
[[File:Example of Ore Generation.png|thumb|Example of Ore Generation as seen by an LuV Prospector]]
#Press F9 3 times and go to the blue area centers, then dig/stairstep down until you find the vein
#Can also use F3 and look for "This is an ore chunk".
#
#
#
Examples
<pre> X c: 1, Z c: 1 => 1-1=0, 0/3=0. X and Z are ok. Dig here.</pre>
[[File:Example of ore after stone was removed.png|thumb|Example view of ore with stone removed]]
Protips
*Mark an orecenter chunk in Journeymap. Then go over 3 chunks in both X and Z. When crossing over the X or Z = 0 axis, you will need to redo the centers.
*The orecenter chunks are normally 3 apart, except at the X or Z = 0 axis. A clever miner can take advantage of this.
*Next to the c:xx number, the number in parenthesis is your location in the chunk. Dig down near 8,8.
* There's a trick to quickly finding out if a number is divisible by 3 - the actual number doesn't matter, just if it is divisible by 3 and any remainder. Simply add the digits, and if the result is divisible by 3, so is the number. 120 = 1+2 = 3, 120 is divisible by 3 (40). Same for 102 or 210 or 201. 342 = 3+4+2 = 9, 342 is divisible by 3. 782 = 7+8+2 = 17, not divisible by 3, has remainder 2.
Here is a visual example of where to mine, with the X or Z = 0 axis visible. The 0,0 chunk is not special, just marks the center of the overworld
For those who are still confused,
*
* The Yellow Square has no special significance other than showing where the chunk (0,0) is. This is purely meant as a reference point and there is '''''NOT''''' a chunk center located here. (Although, since there are 4 ore veins located 1 chunk away in each diagonal cardinal direction, you are almost certainly going to find a combination of ore veins here, but likely at different depths. In other words, don't start counting from chunk (0,0), but rather one of the chunks with a green square and yellow coordinates.
*
<gallery widths="600" heights="325">
File:GTNH Vein Generation Guide.png|Example of where to mine, courtesy of Snagger from Discord.
</gallery>Happy mining!
==
GregTech disables all Vanilla ores (except Emerald Ore, Twilight Forest Hollow Hills, and Nether Quartz spawned around hives in the Nether), and replaces them with its own ore generation system.
==
GregTech ore blocks do not work like other ore blocks you know from other mods or vanilla. Such mods or vanilla uses actual Blocks for placement of their ores, however in GregTech, ores are actually non-ticking MetaTileEntities, defined not by block ID or metadata but by TileEntity data. Meaning that instead of a static Block, these ores are actually TileEntities in that they are all the same "block", but have different data assigned to them that make them function differently. This also means that most, if not all, traditional x-ray mods will NOT work for finding specific ores. Even changing your textures to be invisible will not work as these ores appear as regular blocks until exposed to air (thus making stone invisible, will turn the ores invisible too.) Each ore contains the internal ID of the ore (not block ID), and a true/false value whether they were placed by the world generator or by other means. This is mainly used to determine drops for [[#Small Ores|Small Ores]].
When an ore is generated, if there was a type of stone (Stone, Red/Black Granite, Basalt, Marble, Netherrack, or End Stone) in that location, the ore takes on that stone's base type (note that ores can not generate in other blocks, such as dirt). So if an Iron Ore generates on Netherrack, the ore has a stone type of Netherrack, but is still Iron. The only real differences between each stone type is the dust or dirty dust produced when mining [[#Small Ores|Small Ores]] or when pulverizing regular ores.
==
Ores generate in two types: Small Ores and Mix Veins (aka Vein Mixes).
===
These ores generate as semi-common single blocks throughout a dimension. They are intended as a way to get small amounts of raw materials useful for tools or any other small quantity needs; they are not intended to be used as a primary source of resources for progression or machinery. When broken, they drop either a Crushed Ore, an Impure Pile of Ore Dust, or, if applicable, a Gem, of the respective ore. Additionally, they may drop a Dust or a Dirty Dust of the stone type ([[#Ore Makeup|Ore Makeup]]) they were found in. Small Ores cannot be picked up with a Silktouch Pickaxe, however a Fortune Pickaxe will slightly increase their yields. Importantly, Small Ores can be mined at 1 mining level lower than the ore itself, allowing a player with a stone-level pickaxe to mine iron-level ores.
===
Mix Veins come in four parts, Primary, Secondary, Inbetween, and
Mix Veins can be a varying width and length depending on randomness and a configuration value called <code>size</code>. Each different '''mix type''' has a <code>size</code> value set for it. For programmers the min and max x and z values are defined by the following code, regular users can just read the table after.
<source lang="java">
// Determine West (inclusive)/East (exclusive) ends of orevein
int
int eXVein = aChunkX + 16 + aRandom.nextInt(this.mSize);
// Where aChunkX is just the world (block) x-coordinate of the western side of the chunk where the vein is being generated
// This code is duplicated for the Z values
// Determine North (inclusive)/South (exclusive) ends of orevein
int
int sZVein = aChunkZ + 16 + aRandom.nextInt(this.mSize);
// Where aChunkZ is just the world (block) z-coordinate of the northern side of the chunk where the vein is being generated
// Note that nextInt() generates a random number from 0 (inclusive) to the parameter (exclusive)
</source>
{| {{STDT|sortable c_12}}
! style="text-align: center; font-weight: bold;" |
! style="text-align: center; font-weight: bold;" |
! style="text-align: center; font-weight: bold;" |
|-
| style="text-align: center;" |
| style="text-align: center;" |
| style="text-align: center;" |
|-
| style="text-align: center;" |
| style="text-align: center;" |
| style="text-align: center;" |
|-
| style="text-align: center;" |16
| style="text-align: center;" |
| style="text-align: center;" |
|-
| style="text-align: center;" |24
| style="text-align: center;" |
| style="text-align: center;" |
|-
| style="text-align: center;" |
| style="text-align: center;" |
| style="text-align: center;" |
|-
| style="text-align: center;" |30
| style="text-align: center;" |
| style="text-align: center;" |
|-
| style="text-align: center;" |32
| style="text-align: center;" |16
| style="text-align: center;" |78
|}
Line 94 ⟶ 97:
Let's use the Iron mix type as an example. This mix type has a <code>size</code> value of 24. Meaning that the width could be anywhere between 16 and 64 meters/blocks, and same with the length (width and length could be the same, but more commonly will not match due to the random factor.)
The one exception is size 32. The reason is that after calculating the width/boundaries, the ore vein is moves 2 blocks east and 2 blocks south, to "avoid worldgen cascade" (?). However, chunks more than 32 blocks away from an ore chunk in either the x or z direction do not actually generate ores from that ore vein, so 2 blocks are cut off from the vein.
Mix Veins have varying densities depending on the distance of the chunk from the ore chunk and a configuration value called <code>density</code>. Each different '''mix type''' has a <code>density</code> value set for it. For programmers the local density of a chunk is defined by the following code, regular users can just see the grid after with the factors by which density is affected (with rounding down).<source lang="java">
//aChunkX, aChunkZ: x and z coordinates of the northwestern block of the chunk
//aSeedX, aSeedZ: x and z coordinates of the northwestern block of the ore chunk
int localDensity = Math.max(1,
this.mDensity / ((int) Math
.sqrt(2 + Math.pow(aChunkX / 16 - aSeedX / 16, 2) + Math.pow(aChunkZ / 16 - aSeedZ / 16, 2))));
</source>
<table style="border-collapse: collapse;">
<tr>
<td style="background-color: #FFC0CB; text-align: center;">1/3</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #FFC0CB; text-align: center;"> 1/3</td>
</tr>
<tr>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #90EE90; text-align: center;">1</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;"> 1/2</td>
</tr>
<tr>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #90EE90; text-align: center;">1</td>
<td style="background-color: #90EE90; text-align: center;">1</td>
<td style="background-color: #90EE90; text-align: center;">1</td>
<td style="background-color: #ADD8E6; text-align: center;"> 1/2</td>
</tr>
<tr>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #90EE90; text-align: center;">1</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;"> 1/2</td>
</tr>
<tr>
<td style="background-color: #FFC0CB; text-align: center;">1/3</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #ADD8E6; text-align: center;">1/2</td>
<td style="background-color: #FFC0CB; text-align: center;">1/3</td>
</tr>
</table>The maximum size of any existing vein is 32, which is 2 chunks either side of the ore chunk. The local density is only reduced by the factor in the grid if it will result in a density of at least 1 when rounding down. So only ore veins with a density of at least 3 see the full effect at the corners and only ore veins with a density of at least 2 see any effect at all. As is about to be demonstrated, a reduction in the local density by a factor of 1/2 actually corresponds to a reduction in density by a factor of 1/4, and 1/3 by 1/9, and there are further reductions as the chance of an ore generating is then affected by its distance from the center of the ore vein. An ore spawns at (tX,tZ) if both random numbers between 0-placeX and 0-placeZ exclusive are 0, where placeX and placeZ are calculated using:<source lang="java">
// tX, tZ: block coordinates
// wXVein (inc), eXVein (exc), nZVein (inc), sZVein (exc): coordinates of edges of ore vein
int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity);
int placeZ = Math.max(1, Math.max(MathHelper.abs_int(nZVein - tZ), MathHelper.abs_int(sZVein - tZ)) / localDensity);
</source>Since the maximum localDensity for any ore vein is 7, and the minimum width for any ore vein is 16, we will never have to use the first branch of the max condition, so the proportion chance of an ore generating simplifies to localDensity^2/([(wx + 1) // 2 + dx]*[(wz + 1) // 2 + dz]). Here wx and wz are the widths of the vein, and dx and dz are the distance from a center block in the vein, where if the corresponding width is even the center block is the easternmost/northernmost center block, and if the corresponding width is odd the center blocks are the center block and the block to the east/north of the center block. The distance from a center block to itself is 0. The maximum ore generation proportion you can have is 0.765625 at the very center of the smallest possible Lignite Coal vein, and the minimum is 0.0009765625 at the northwestern edge of a maximum size magnetite or gold vein. Note that the proportion is before checking if the block is actually valid to place an ore in (is stone, netherrack, end stone, granite, etc.).
The code determines whether to attempt to generate an ore type using the proportion using the priority: inbetween, primary/secondary, sporadic. The code only decides whether to generate the next type if the previous types were not attempted to be generated. Inbetween ores have an additional multplier of 1/2 to their generation and sporadic ores have an additional multiplier of 1/7. If the code decides to attempt to generate an ore type, it will check if the block is one that can be replaced with an ore (stone, netherrack, end stone, granite, etc.) and replace it if so. If this fails, the code does not try to generate any more of the ore types; it only does so when it decided not to attempt placing the other types of ore at all.
==Generation Process ==
Vein generation takes place as a series of steps. These steps will be explained in the following two subsections, first in a more basic, "dumbed-down" version, and second is a highly detailed and technical version for those who wish to learn the logic behind the vein generator process.
===Simple Explanation===
First the world generator locates a position for a new vein to be generated based on a formula ([[#Vein Location|Vein Location]]). Next the generator creates a random number that is used to select which mix type should be used for this new vein. If the selected mix type is not allowed to generate in the dimension, this process is repeated in that a new random number is generated to hopefully select a new mix type. This process is repeated 8 times until a valid mix type is found for the dimension. If after 8 times, a mix is not found, then the generator will move onto the next location and start over. If a mix is found that works in the dimension, a new random number is created to determine the y-coordinate (vertical position) for where the vein should be generated; as well as generating the width and length values of the vein as explained in [[#Mix Veins|Mix Veins]]. Finally, the vein is generated. However remember that a mix vein requires a stone type to be able to generate. If the vein places 0 ores in the bottom layer, another mix is attempted (up to a maximum of 8 placement attempts). So if the y-coordinate generated positions the veins in the air, or in non-stone type blocks, the ores will not be generated.
===
'''Remember, this explanation is intended for those looking to understand the complex logic that the generator uses when generating veins. You do NOT have to understand this section to continue.''' Before the explanation, note that in addition to the <code>size</code> value assigned to each mix type, there is also a <code>minY</code>, <code>maxY</code>, <code>weight</code>, and <code>density</code> value.
While still inside <code>LoopA</code>, a new loop, which we will call <code>LoopB</code> is started which loops through every mix type (again, regardless of dimension). Each cycle will subtract the mix type's weight from <code>W</code> and reassign it to the new value. <code>W = W - mixWeight;</code> Then it checks if W is equal to or less than 0; if yes, then the generator will attempt to use the last used mix type to fill in the chunk. If the generation succeeds or the ore vein does not overlap with the chunk and there is no air block in a certain spot described later, <code>LoopA</code> is stopped and the generator moves to the next
Upon generating the vein, the generator first picks where the vein will generate along the y-axis (vertically). The location is yet again random, however is confined using the <code>minY</code> and <code>maxY</code> values and defined using this formula:
Line 121 ⟶ 175:
The bottom-most layer of the vein is generated 1 block below the y-position generated by this formula.
==
The locations of veins are extremely important to know in order to mine efficiently. All mix veins are generated at specific locations defined by a mathematical formula. '''For programmers''' you can see the formula from the code here:
<source lang="java">
Line 130 ⟶ 184:
The formula is true whenever a chunk's x and z coordinates follow the following comparison: <code>|x| mod 3 = 1, and |z| mod 3 = 1</code>. Now what does this mean? First check if either x or z is negative, and make it positive. So for example, if x is -5, change it to positive 5 instead. Next divide the new x and z values by 3 and count any [http://www.mathwarehouse.com/dictionary/R-words/what-is-a-remainder.php remainders]. If the remainder of the x division, and the remainder of the z division, both equal 1, then that chunk is where the generator would have attempted to generate a vein.
=== Calculating Your Position in Chunk Coordinates
There are multiple ways of doing this.
* The [https://minecraft.
* If you do not wish to monkey around with the debug screen, you can also use a minimap mod, such as JourneyMap which comes with the GTNH modpack. Below the minimap, you will see your block coordinates. To convert this to chunk coordinates, you can type in these numbers to this [https://dinnerbone.com/minecraft/tools/coordinates/ converter].
*
===
To open the Debug Screen, press the F3 function key on your keyboard (usually along the top row). In this image you can see two circled numbers. [[File:Chunk-coords-debug.png|thumb|200px]] These numbers are the '''x''' and '''z''' chunk coordinates for the chunk that you are currently standing in. In the example image, the chunk coordinates are '''(194, -94)'''. So first we need to make any negative values positive, which gives us '''x''': 194, and '''z''': 94. Now we divide each by 3 and count the remainder.
Line 143 ⟶ 197:
Because only the z coordinate has a remainder of 1, this chunk is not a valid location for vein generation; however it is next to one. So a player in this situation would need to move to an adjacent chunk so that both remainders equal 1.
==
This is the easy part after understanding how ore generation works. Using the [[#Vein Location|Vein Location]] formula, you can find all the locations of potential mix veins, regardless of height in the world. Because of the formula, all you need to do to find mix veins in the most efficient way, is to find each location, and mine a vertical shaft down into the ground in the center of the chunk. There is no need to strip mine and no need to search caves; in fact, searching caves and strip mining is practically '''worthless'''. Each vein location can only have a maximum of a single vein (unless the size of the mix is so large that it overlaps, but this rarely happens except in the Deep Dark). Therefore, a single vertical shaft down the center of the chunk from the surface (or near surface) to bedrock will cover all the possible y-coordinates that a vein could have generated at. If you hit a vein before you reach bedrock, there is no reason to continue mining downward at that location.
Line 152 ⟶ 206:
The only other thing to consider is which dimensions specific mix veins generate in. '''Mix vein generation is NOT dependent on biome, only on dimension''', meaning that some ores, such as sulfur, you will need to go to the Nether to find instead of mining in the Overworld. To find out which ores generate in which mix types, in which dimensions, please refer to [http://bit.ly/gtnh-datasheets this spreadsheet created by MineAnPlay]. The spreadsheet lists all available mix types and the various attributes associated with each, including which dimensions they generate in. Click on the down-arrow at the top of a column to sort by that column, for example the N above Nether. This will let you see which ores are available in that dimension.
===
As you progress, it is important to use available tools to make sure you are mining as efficiently as possible. Once you get a jetpack, you can quickly move from center to center, as well as dig down without needing any sort of staircase to move back up the shaft. The Coal jetpack is the first decent pack, with the Copter pack being excellent for this. Just be aware of their limitations (ie, copter pack won't work in water).
The other important thing is to replace your pickaxe/hammer head as you tier up. You can also mix and match the materials for some good effects, such as perditio large plates with a vanadiumsteel head. Some good fast mining materials to keep an eye out for:
* Periditio (Thaumcraft shards) - Even if you don't plan to use Thaumcraft, Perditio shards can be used to make hammer and pick heads with very high mining speeds. Their drawback is the low durability, so be prepared to repair often with the shards, which can get expensive.
*
*
There are some additional tools that are useful
*
*
*
===
There are special situations where the above mentioned [[#Efficient Mining|Efficient Mining]] technique is not applicable.
*
* The above trick will also work on the Overworld when searching for Mica (only for Mica! otherwise, this should not be used in the Overworld). Mining horizontally at y31 you should be hitting centers every 2 minutes or so with a good hammer or pickaxe. Mining down 4 blocks every center would catch every vein, but just continuing horizontally is still fast. It may still take a while, but shouldn't take more than 150 centers to find unless you are extremely unlucky.
*
*
*
== Quarry like a K1ng
When using the Ender Quarry, it is important to understand how it interacts with the GT oregen. For the Overworld, Nether, and Twilight Forest, per-chunk generation is used, so it's OK to setup the ender quarry any way you want.
Line 194 ⟶ 248:
Or if you don't care about total volume, you can let your quarry run, but try to place the boundaries so that they are inside of ore centers.
==
As an alternative to understanding the details of ore generation, you can install InGameInfoXML and use config files to show you when you are in an ore chunk.
*
*
*
*
[[Category:
|