Forum: gaming.stackexchange.com
Tags: <minecraft-java-edition>
Title: How many world seeds are in Minecraft?
Question: I was wondering about how many seeds are in Minecraft(1.8.7) and how it ocuppies so few disk space? I think that there are a lot of seeds per world type, calculating this also for EVERY customized combinations. I am sure that they are over zillions.  Can you tell me the number of seeds?

Answers:
sents: text: There are 18,446,744,073,709,551,616 (2 64 ) possible seeds.
text: All seeds are a number, if letters are entered into the seed box, Java's hashCode() function is used to turn it into a number.
text: Seeds do not use up much disk space (stored as a long integer, meaning just 8 bytes per world) because only a seed that has been chosen for a world is stored; not all 18 quintillion.
text: When a seed is needed for world generation, a random one is generated from the system clock (or entered manually by the user) and is then stored and used to generate the world.
text: How many possible worlds can generate, including customization options ?
text: Probably more than any computer can calculate given all of the float sliders available in a customized world.
text: Here's an image showing a randomly generated seed: -3,010,441,696,458,036,422
text: is far lower than both -2,147,483,648
text: and -140,737,488,355,328.
text: This means that seeds use higher than 32 bit and 48 bit signed integer ranges.
answer_details: author: gaming.stackexchange.com/users/54474/SirBenet
score: 52
sents: text: I originally stated that Minecraft uses Java's default Random class for pseudo-random number generation.
text: Random uses 48-bit seeds .
text: However, that would imply that the seeds 1 and 2 48 +1 result in the same world, which others have pointed out is not true.
text: So I did some more digging.
text: Minecraft appears to use Random everywhere except for the biome-generation code.
text: There, it uses its own homespun random generator.
text: From GenLayer.java: protected int nextInt(int upperBound){ int randVal =
text: (int)((this.chunkSeed >> 24) % (long)upperBound);
text: if (randVal < 0) { randVal += upperBound; } this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; this.chunkSeed += this.worldGenSeed; return randVal;} This is a linear congruential generator with values a = 6364136223846793005 and m = 1442695040888963407 .
text: This will indeed produce 2 64 distinct output streams, and thus there are 2 64 distinct worlds.
text: The claim on the Minecraft wiki that "Multiplayer seeds may only have 2 48 possible values [..] due to using Random.nextLong
text: () " is incorrect.
text: The single-player and multiplayer world generators are not different.
text: The use of Random everywhere else does mean that some things will be the same between seeds that are off by 2 48 , such as seeds 1 and 2 48 +1.
text: For example, the location of ores should be almost the same between the two (except for ores removed by cave-systems) .
text: Also, the use of per-chunk seeds has some interesting consequences.
text: For example, given the small number of biomes and the large number of chunks, in any given world there is a very high probability that there are two chunks which are exactly the same.
text: Finding those chunks, however, involves math which is beyond me.
text: If anyone is interested in figuring it out, the code for initializing the chunkSeed is public void initChunkSeed(long chunkX, long chunkY){ this.chunkSeed = this.worldGenSeed; for(int
text: i = 0; i < 2; i++) { this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; this.chunkSeed += chunkX; this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; this.chunkSeed += chunkY; }}
answer_details: author: gaming.stackexchange.com/users/2578/BlueRaja - Danny Pflughoeft
score: 19
sents: text: So the answer is found here: http://minecraft.gamepedia.com/Seed_(level_generation)
text: Which even though it's already linked on this page no one seems to have read it all.
text: To summarize: If you use a word or phrase then String.hashCode() is called and it limits your maximum amount of seeds to 2^32 because of it's implementation.
text: If you enter your own number or let the system determine the seed
text: then your seed limit is 2^64 seeds.
text: HOWEVER:
text: If it's a multiplayer world
text: they implement the nextLong() java function and
text: the limitations of that are 2^48 possible seed options.
answer_details: author: gaming.stackexchange.com/users/23986/Ryan
score: 6
sents: text: Seeds are hashed into a 32 bit signed integer.
text: Which is programmer speak for a number that can be positive or negative, and is 32 values in base 2.
text: This gives the numbers from -2,147,483,648 to 2,147,483,647.
text: Depending on the implementation of Minecraft some of those might result in the same world in certain aspects like having 2 seeds with different biomes but the same heightmap.
text: (Partial) correction:If you don't set a text seed minecraft will instead take the current time as it's value, which is a 64 bit number so there are more options there.
text: Source: http://minecraft.gamepedia.com/Seed_(level_generation)
answer_details: author: gaming.stackexchange.com/users/244/Elva
score: 2
sents: text: The number of seeds isn't limited by the application itself.
text: Just by the length of the allowed value for the seed itself.
text: The seeds won't be stored into Minecraft.
text: The seed itself will just be some kind of "startvalue" where the world generation starts it generate process.
text: There isn't a seed for every world inside the game itself.
text: You'll only get the same world as the generation process would run and generate the same world due to the same start conditions.
text: You can compare it by counting the steps from your way home to your work.
text: If the same condition applies every day the same way will be used.
text: If it snows one day or if you stay up a bit later on the day the start condition is different and your going to take another way or another time to your work.
text: But if the same different condition would apply on another day it will end the same way.
text: Just as an example to clarify it for the non-techies. :-)
answer_details: author: gaming.stackexchange.com/users/115641/Ionic
score: 1
sents: text: Computers do not truly generate random numbers.
text: When fetching a random number, it just gives you the next number in a sequence of seemingly random numbers (they have no pattern or connection to each other).
text: A seed is what truly randomizes this list of numbers, in most cases, the current system time will be used as a seed.
text: You could think of a seed as a way to get the same random result repeatedly.
text: The way a Minecraft world is generated is by an algorithm that repeatedly fetches random numbers such as when to increase surface height, etc...
text: Using seeds, these random numbers will be the same each time, which results in a world being the same when the same seed is used.
text: That being said, seeds do not take up disk space because they are simply a way to scramble/randomize the list of seemingly random numbers.
answer_details: author: gaming.stackexchange.com/users/115057/Jayden Miller
score: 1

Summary of the answers:
There are 18,446,744,073,709,551,616 (2 64 ) possible seeds.
Minecraft has 18,446,744,073,709,551,616 (2 64 ) possible seeds