For example, I type a bunch of crap in the seed bar and I ask someone else to type the same thing I typed either the same time or shortly after, would it be the same? How come people can simply share seeds?
If you put letters in the seed it will convert into an int, which basically means your letters/string will turn into numbers. I only know about that, everything else is new to me. I am interested in this topic though and I'll edit in more information if I find some cool facts.
The game uses a random number generator to decide where to put oceans, mountains, villages, houses, villagers etc, etc.
But computers are really really bad at generating random numbers so what they usually do instead is generate a list of random looking numbers by applying a mathematical formula to each number to generate the next number, and the seed (converted to a number) is used as the first number.
Therefore you always get the same list of psudo random numbers if you start with the same seed.
And Minecraft uses the randomish numbers in the same order each time so the same seed generates the same world each time (if you're using the same version of MC).
It's a lot more complicated than that and I don't really understand the details (paging TheMasterCaver!) but MC uses a lot of different psudo random lists all, somehow, generated from the original seed so it doesn't matter, much, in what order the chunks are generated for instance, a chunk uses the same list for its generation no matter if you teleport directly there or spend ages exploring in the other direction before you get close to it.
I think that works by starting a new random number list for that chunk using a seed that is based on, somehow, combining the original seed and the coordinates of the chunk.
I think that works by starting a new random number list for that chunk using a seed that is based on, somehow, combining the original seed and the coordinates of the chunk.
This is correct; the formulas are actually surprisingly simple; here is the basis of java's Random class, which is used by the game to generate most random numbers:
Yes, that's it - it just multiplies a value by 25214903917 and adds 11, then truncates it to 2^48 (which is also the period, or the maximum number of unique values it can generate before repeating). The setSeed method itself combines the seed with 25214903917 to help randomize the bits in the case where the seed is a small value.
The chunk seed itself is set in multiple ways for different parts of world generation; for example, the method that places features like ores and trees sets the seed as follows:
The chunk coordinates are multiplied by two values which are derived from the world seed; each of these values will always be odd numbers (preventing either from being zero, which is possible in the world generator class used to generate caves and structures, which will result in that coordinate having no effect on the chunk seed).
The biome generator itself uses a custom RNG which is basically the same thing, just with different constants and a period of 2^64 (this means that while every seed will have a different biome layout they may have the same features in areas where the biomes are the same since there are only 2^48 possible seeds with Java's Random):
/**
* Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in
* as an argument).
*/
public void initWorldGenSeed(long par1)
{
this.worldGenSeed = par1;
if (this.parent != null) this.parent.initWorldGenSeed(par1);
this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
this.worldGenSeed += this.baseSeed;
this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
this.worldGenSeed += this.baseSeed;
this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
this.worldGenSeed += this.baseSeed;
}
/**
* Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates.
*/
public void initChunkSeed(long par1, long par3)
{
this.chunkSeed = this.worldGenSeed;
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
this.chunkSeed += par1;
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
this.chunkSeed += par3;
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
this.chunkSeed += par1;
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
this.chunkSeed += par3;
}
/**
* returns a LCG pseudo random number from [0, x). Args: int x
*/
protected int nextInt(int par1)
{
int var2 = (int)((this.chunkSeed >> 24) % (long)par1);
if (var2 < 0) var2 += par1;
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
this.chunkSeed += this.worldGenSeed;
return var2;
}
The biome generation code is also deceptively simple, considering the complex patterns it makes - it really just sets different values in a grid, which are randomly blended and smoothed out in a series of zoom steps (without these steps you'd just have a checkerboard of 4x4 block square biomes); for example, the following code places initial landmasses (1, where 0 represents areas that will be ocean, with a 1 in 10 chance of a point being land; this code is from 1.6.4 but later versions operate on the same basic principle):
Also, some time ago I created an Excel spreadsheet that emulates the Minecraft use of the Java string.hashcode() routine.
Since the Minecraft seed input window limits input to 32 characters my spreadsheet does also.
There are no dangerous weapons. There are only dangerous people. R.A. Heinlein
If you aren't part of the solution, then you obviously weren't properly dissolved.
I now have a .ods spreadsheet file that works with the input of Unicode characters just like Amidst and Minecraft.
Unfortunately my copy of Excel is too old, HOWEVER LibreCalc in LibreOffice 6.3 does have the Unicode() function so I have saved the workbook (3 sheets) as an .ods file.
There are no dangerous weapons. There are only dangerous people. R.A. Heinlein
If you aren't part of the solution, then you obviously weren't properly dissolved.
For example, I type a bunch of crap in the seed bar and I ask someone else to type the same thing I typed either the same time or shortly after, would it be the same? How come people can simply share seeds?
If you put letters in the seed it will convert into an int, which basically means your letters/string will turn into numbers. I only know about that, everything else is new to me. I am interested in this topic though and I'll edit in more information if I find some cool facts.
I am most active on Discussion, but you'll see my messages all around the place since threads get moved a lot.
The game uses a random number generator to decide where to put oceans, mountains, villages, houses, villagers etc, etc.
But computers are really really bad at generating random numbers so what they usually do instead is generate a list of random looking numbers by applying a mathematical formula to each number to generate the next number, and the seed (converted to a number) is used as the first number.
Therefore you always get the same list of psudo random numbers if you start with the same seed.
And Minecraft uses the randomish numbers in the same order each time so the same seed generates the same world each time (if you're using the same version of MC).
It's a lot more complicated than that and I don't really understand the details (paging TheMasterCaver!) but MC uses a lot of different psudo random lists all, somehow, generated from the original seed so it doesn't matter, much, in what order the chunks are generated for instance, a chunk uses the same list for its generation no matter if you teleport directly there or spend ages exploring in the other direction before you get close to it.
I think that works by starting a new random number list for that chunk using a seed that is based on, somehow, combining the original seed and the coordinates of the chunk.
Just testing.
This is correct; the formulas are actually surprisingly simple; here is the basis of java's Random class, which is used by the game to generate most random numbers:
Yes, that's it - it just multiplies a value by 25214903917 and adds 11, then truncates it to 2^48 (which is also the period, or the maximum number of unique values it can generate before repeating). The setSeed method itself combines the seed with 25214903917 to help randomize the bits in the case where the seed is a small value.
The chunk seed itself is set in multiple ways for different parts of world generation; for example, the method that places features like ores and trees sets the seed as follows:
The chunk coordinates are multiplied by two values which are derived from the world seed; each of these values will always be odd numbers (preventing either from being zero, which is possible in the world generator class used to generate caves and structures, which will result in that coordinate having no effect on the chunk seed).
The biome generator itself uses a custom RNG which is basically the same thing, just with different constants and a period of 2^64 (this means that while every seed will have a different biome layout they may have the same features in areas where the biomes are the same since there are only 2^48 possible seeds with Java's Random):
The biome generation code is also deceptively simple, considering the complex patterns it makes - it really just sets different values in a grid, which are randomly blended and smoothed out in a series of zoom steps (without these steps you'd just have a checkerboard of 4x4 block square biomes); for example, the following code places initial landmasses (1, where 0 represents areas that will be ocean, with a 1 in 10 chance of a point being land; this code is from 1.6.4 but later versions operate on the same basic principle):
I've even made my own custom random number generator class for my own mod, which is again quite simple:
https://www.dropbox.com/s/9d1kqn8b4gx2ep2/Random64.java?dl=0
(all of these are examples of linear congruential generators)
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?
There's is another thread discussing this (also with corrections/comments by TheMasterCaver) here:
https://www.minecraftforum.net/forums/minecraft-java-edition/seeds/2968599-seed-calculation-notes
Also, some time ago I created an Excel spreadsheet that emulates the Minecraft use of the Java string.hashcode() routine.
Since the Minecraft seed input window limits input to 32 characters my spreadsheet does also.
The spreadsheet can be download as a .zip file from here:
http://www.mediafire.com/file/f7ruo1arrf7bcut/Hashcode.zip/file
There are no dangerous weapons. There are only dangerous people. R.A. Heinlein
If you aren't part of the solution, then you obviously weren't properly dissolved.
The latest release of Amidst, version 4.6 can be found here:
https://github.com/toolbox4minecraft/amidst/releases
You should probably also read this:
https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-tools/2970854-amidst-map-explorer-for-minecraft-1-14
You can find me on the Minecraft Forums Discord server.
https://discord.gg/wGrQNKX
I now have a .ods spreadsheet file that works with the input of Unicode characters just like Amidst and Minecraft.
Unfortunately my copy of Excel is too old, HOWEVER LibreCalc in LibreOffice 6.3 does have the Unicode() function so I have saved the workbook (3 sheets) as an .ods file.
Here's the link to the file:
xlsx format: https://www.mediafire.com/file/clbpk0oyb16e4gn/Hashcode_Unicode_New_Excel.xlsx/file
ods file: https://www.mediafire.com/file/pi20gg1jbmww5gh/Hashcode_Unicode.ods/file
There are no dangerous weapons. There are only dangerous people. R.A. Heinlein
If you aren't part of the solution, then you obviously weren't properly dissolved.
The latest release of Amidst, version 4.6 can be found here:
https://github.com/toolbox4minecraft/amidst/releases
You should probably also read this:
https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-tools/2970854-amidst-map-explorer-for-minecraft-1-14
You can find me on the Minecraft Forums Discord server.
https://discord.gg/wGrQNKX