If you build a nether portal near the spawn, is it guaranteed that the nearest Nether Fortress is within a few hundred blocks from the place you enter the Nether, or can it be a few thousand blocks in some seeds?

Pretty much yes, since they are quite common, an average of one every 768 chunks. Specifically, the game divides the Nether into a grid of 16x16 chunk regions; there is a 1/3 chance per region of a fortress. Due to the way the game offsets them within regions (possibly unintended from looking at the code) they are aligned along the z-axis (north-south), which effectively makes them more clustered together within strips:

protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ)
{
int x = chunkX >> 4;
int z = chunkZ >> 4;
this.rand.setSeed((long)(x ^ z << 4) ^ this.worldObj.getSeed());
this.rand.nextInt();
return this.rand.nextInt(3) != 0 ? false : (chunkX != (x << 4) + 4 + this.rand.nextInt(8) ? false : chunkZ == (z << 4) + 4 + this.rand.nextInt(8));
}

(>> 4 means to divide by 16; this means that x and z will be the same for intervals of 16 chunks, as will be the chunk-specific seed value. The likely reason for the clustering along strips is the way x and z are combined to create a seed, they just XOR them with z being multiplied by 16, and a simple XOR like this is considered to be a very bad hash function since it doesn't randomize the inputs very well, and Java's Random function isn't that good either and doesn't do anything to make a seed more random; ideally you want the chunk seed to be as random as possible)

This doesn't guarantee that there will be one nearby since they may not generate within a region but the chance rapidly diminishes with distance; assuming you start near 0,0 the chance that all four surrounding regions (within +/-256 blocks) won't have a fortress is about 20% (0.66666^4); for the next 256 blocks out (16 regions, 0.66666^16) the chance is only 0.15%, so it is nearly guaranteed that there will be a fortress within 512 blocks of the origin; from looking at their distribution it looks like they are concentrated in half the overall area due to the aforementioned strips, which are also not continuous across the x-axis:

I used 1.6.4 for these but they are placed the same way in newer versions. Note that they appear to be in strips which are half the overall area and alternate across the x-axis (the distances here are 8 times the real distance in the Nether); in the first seed there are none directly to the north of spawn and a double-side strip to the south but in the second seed the pattern is reversed; this means that if you do not see any to the north/south after a while try going in the other direction:

quote=TheMasterCaver
This doesn't guarantee that there will be one nearby since they may not generate within a region but the chance rapidly diminishes with distance; assuming you start near 0,0 the chance that all four surrounding regions (within +/-256 blocks) won't have a fortress is about 20% (0.66666^4); for the next 256 blocks out (16 regions, 0.66666^16) the chance is only 0.15%, so it is nearly guaranteed that there will be a fortress within 512 blocks of the origin; from looking at their distribution it looks like they are concentrated in half the overall area due to the aforementioned strips, which are also not continuous across the x-axis:

Assuming I understand this correctly, this would apply to any intersection of four regions, not just to x0,z0: is that correct?

If not, how so?

Rollback Post to RevisionRollBack

WARNING: I have an extemely "grindy" playstyle; YMMV — if this doesn't seem fun to you, mine what you can from it & bin the rest.

quote=TheMasterCaver
This doesn't guarantee that there will be one nearby since they may not generate within a region but the chance rapidly diminishes with distance; assuming you start near 0,0 the chance that all four surrounding regions (within +/-256 blocks) won't have a fortress is about 20% (0.66666^4); for the next 256 blocks out (16 regions, 0.66666^16) the chance is only 0.15%, so it is nearly guaranteed that there will be a fortress within 512 blocks of the origin; from looking at their distribution it looks like they are concentrated in half the overall area due to the aforementioned strips, which are also not continuous across the x-axis:

Assuming I understand this correctly, this would apply to any intersection of four regions, not just to x0,z0: is that correct?

If not, how so?

Based on the maps that I've looked at it appears that the chance is twice as high in a double-wide strip along the z-axis, either to the north or south of the x-axis, but zero in the other direction, otherwise the chance is the same everywhere else since each strip is one region across.

In a related note, is there an altitude range that fortresss appear in? My nether portal came in at level 112 (!), and I'm afraid I'm going over any fortresses that might exist.

In a related note, is there an altitude range that fortresss appear in? My nether portal came in at level 112 (!), and I'm afraid I'm going over any fortresses that might exist.

Not by any means a scientific sample, but looking at positions I've recorded for blaze spawners in various forts suggests the main fortress forms from ~65 to ~96 with the legs reaching down….

Rollback Post to RevisionRollBack

WARNING: I have an extemely "grindy" playstyle; YMMV — if this doesn't seem fun to you, mine what you can from it & bin the rest.

To post a comment, please login or register a new account.

If you build a nether portal near the spawn, is it guaranteed that the nearest Nether Fortress is within a few hundred blocks from the place you enter the Nether, or can it be a few thousand blocks in some seeds?

Pretty much yes, since they are quite common, an average of one every 768 chunks. Specifically, the game divides the Nether into a grid of 16x16 chunk regions; there is a 1/3 chance per region of a fortress. Due to the way the game offsets them within regions (possibly unintended from looking at the code) they are aligned along the z-axis (north-south), which effectively makes them more clustered together within strips:

(>> 4 means to divide by 16; this means that x and z will be the same for intervals of 16 chunks, as will be the chunk-specific seed value. The likely reason for the clustering along strips is the way x and z are combined to create a seed, they just XOR them with z being multiplied by 16, and a simple XOR like this is considered to be a very bad hash function since it doesn't randomize the inputs very well, and Java's Random function isn't that good either and doesn't do anything to make a seed more random; ideally you want the chunk seed to be as random as possible)

This doesn't guarantee that there will be one nearby since they may not generate within a region but the chance rapidly diminishes with distance; assuming you start near 0,0 the chance that all four surrounding regions (within +/-256 blocks) won't have a fortress is about 20% (0.66666^4); for the next 256 blocks out (16 regions, 0.66666^16) the chance is only 0.15%, so it is nearly guaranteed that there will be a fortress within 512 blocks of the origin; from looking at their distribution it looks like they are concentrated in half the overall area due to the aforementioned strips, which are also not continuous across the x-axis:

TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.

TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.

Why do I still play in 1.6.4?

quote=TheMasterCaver

This doesn't guarantee that there will be one nearby since they may not generate within a region but the chance rapidly diminishes with distance; assuming you start near 0,0 the chance that all four surrounding regions (within +/-256 blocks) won't have a fortress is about 20% (0.66666^4); for the next 256 blocks out (16 regions, 0.66666^16) the chance is only 0.15%, so it is nearly guaranteed that there will be a fortress within 512 blocks of the origin; from looking at their distribution it looks like they are concentrated in half the overall area due to the aforementioned strips, which are also not continuous across the x-axis:

Assuming I understand this correctly, this would apply to any intersection of four regions, not just to x0,z0: is that correct?

If not, how so?

WARNING: I have an extemely "grindy" playstyle; YMMV — if this doesn't seem fun to you, mine what you can from it & bin the rest.

Based on the maps that I've looked at it appears that the chance is twice as high in a double-wide strip along the z-axis, either to the north or south of the x-axis, but zero in the other direction, otherwise the chance is the same everywhere else since each strip is one region across.

TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.

TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.

Why do I still play in 1.6.4?

In a related note, is there an altitude range that fortresss appear in? My nether portal came in at level 112 (!), and I'm afraid I'm going over any fortresses that might exist.

Nether fortresses usually form with the bottoms of the pillars in the lava oceans (level 30), so you should try to get a view of the lava level.

Just testing.

Not by any means a scientific sample, but looking at positions I've recorded for blaze spawners in various forts suggests the main fortress forms from ~65 to ~96 with the legs reaching down….

WARNING: I have an extemely "grindy" playstyle; YMMV — if this doesn't seem fun to you, mine what you can from it & bin the rest.