• Search
  • Tools

Seeds letters to numbers.

  • #1 Jun 29, 2013

    Seeds

    Share and discuss seeds!
    So hopefully this is in the right place... I didn't see any game mechanics thread so thought this was the best place to put it (sorry if its not... Just be glad I'm not saying that I love melon seeds.....).

    Anyways back 2 years ago I made my first Minecraft world. In todays world I was feeling kinda nostalgic and I wanted to figure out what 2572945 was when converted back to the original letters I typed. I did some research on these two topics and I suggest you do do because they explain everything a lot better than I do.

    I then figured out that my seed(2572945) had to be 4 characters long because (((((32*31)+32)*31)+32)*31)+32=

    985088

    and (((((127*31)+127)*31)+127)*31)+127=

    3909568

    (32 is the ASCII value for "space" and 127 is the ASCII value for "~") I did the same for 3 characters and 5 characters and my seed only fit inside the 4 charter range. Then I wrote an extremely simple c++ program that is able to list all possible ways to end up with a certain number seed.

    Edit: Well... almost all..... read BigAlanM's post below.(no use in re explaining it here)

    //Brute Force //By: Rion1337 #include<iostream> using namespace std;  //Variables  int seed; int a; int b; int c; int d; int temp;  //Functions  int math();  //Program Start int main() { cout << "Welcome to Brute Force\n\tEnter your number seed:"; cin >> seed; cout << "Please be patient, Working through about 85000000 combinations.\nWorking...\n"; for(a = 32; a < 128; a++) { //cout << "debug1"; for(b = 32; b < 128;b++) { //cout << "debug2"; for(c = 32; c < 128; c++) { //cout << "debug3"; for(d = 32; d < 128; d++) { //cout << "debug4"; if(math()==seed) { cout << "Possibility: " << a << " " << b << " " << c << " " << d << "\n"; } } } } } system("pause"); }  int math() { temp = (a*31)+b; temp = (temp*31)+c; temp = (temp*31)+d; return temp; }

    When I saw its outcome I saw a very interesting pattern,

    Seed
    SefE
    Seg&
    SfFd
    SfGE
    SfH&
    Sg'd
    Sg(E
    Sg)&
    TFed
    TFfE
    TFg&
    TGFd
    TGGE
    TGH&
    TH'd
    TH(E
    TH)&
    U'ed
    U'fE
    U'g&
    U(Fd
    U(GE
    U(H&
    U)'d
    U)(E
    U))&

    all of these will give you the seed 2572945 but here is what I found really interesting. If you look down the first column you see 9 of a character then 9 of a character one ASCII value up from the previous.

    The second, 3 of a char followed by 3 of another char 1 ASCII value up but this pattern seems to change or reset every 9 characters.

    The third, is this pattern over and over again efgFGH'()

    The fourth, again is the same pattern over and over again dE&

    I thought this was really interesting and wanted to post is in the topics above but they were outdated :( so I started a topic of my own.

    I may or may not continue looking into this but if any of you want to that's fine with me. Also you are free to use my work above if it helps (I didn't look into it much besides the patterns) but if any of you find something cool please post it here (i really want to know why these patterns happen but am to lazy.............).

    Rollback Post to Revision RollBack

  • #2 Jun 29, 2013

    Interesting, however there are longer text strings that will also yield 2572945.

    MC seeds are signed quad integers, that is 64 bits with the most significant bit being a sign bit (1 = -) if you enter the seed as a number. However, the text string hash routine uses a 32 bit signed integer.

    MC will accept a 32 character ascii string and if it can't recognize it as a number will hash it to a numeric seed using its hashing routine.

    There is nothing stopping the hashing routine from overflowing so any text string long enough and with the right characters will cause the routine to start repeating.

    For example this text string, "

    pollinating sandboxes" (without the quotes) will produce a numeric seed of 0 (zero) so " pollinating sandboxesSeed" produces your same 2572945 numeric seed.

    I do not know if there is a shorter text string that hashes to zero.

    Rollback Post to Revision RollBack

  • #3 Jun 29, 2013

    Well I did some math and I think that it is possible to roll over to the negatives using only 6 characters. I tweaked my program but the only problem is that my program is going through every single possibility (hence why its called Brute Force) so it has to try 96^x seeds where x is number of chars in the seed... soo for 6 chars I think it was around 770billion........... very...very big number... and I'm to lazy to try and figure out a way to go backwards through the equation or try and write a more efficient way of trying seeds :(

    EDIT: ran my program and it turned up blank. Most likely there isn't a way to do it with 6 chars. Ill try 7.
    EDIT2: I found way to many to list but there are ways to roll it back to 0 with 7 chars.(or maybe my program just broke... it was running for 4 hours and its not very well made...)

    Rollback Post to Revision RollBack

  • #4 Jun 30, 2013

    2^32 = 4,294,967,296 or 4.29E+9. This is the rollover point.
    Ascii 126 is ~. This is the highest printable character that can be entered for a seed.
    Hash values:
    ~ = 126
    ~~ = 4032
    ~~~ = 125118
    ~~~~ = 3878784
    ~~~~~ = 120242430
    ~~~~~~ = 3.73E+09 Just below the rollover point.
    ~~~~~~~ = 1.16E+11 Definitely above the rollover point
    Even 7 spaces " " produces 3.21E+10 which is also above rollover.
    That would indicate that using printable characters it's not possible to hit rollover exactly with 6 or 7 characters. This is due to the limitation of using characters in the ascii range of 32-126.

    OBTW: You can use Amidst v2.1 to calculate the numeric seed from any MC compatible text string without having to create a world. (Note: Amidst v2.1 doe not limit it's input to 32 characters like MC does, so be careful)
    This also gives you the resulting biome map that would be created by MC with that seed.

    Rollback Post to Revision RollBack

  • #5 Jun 30, 2013

    What if you were to roll over more than once? I'm sure that pollinating sandboxess rolled over more than once for how long the seed is. I'll have to edit my program so that is properly hashes the numbers, not just plugs them into ((a*31)+b )*31+c) etc.

    Rollback Post to Revision RollBack

  • #6 Jun 30, 2013

    What if you were to roll over more than once? I'm sure that pollinating sandboxes rolled over more than once for how long the seed is. I'll have to edit my program so that is properly hashes the numbers, not just plugs them into ((a*31)+ B) *31+c) etc.

    I have no doubt that the hash routine rolls over several times hashing

    pollinating sandboxes.
    BTW the formula for hashing "abc" would be (97*(31^2))+(98*(31^1))+(99*(31^0)) where 97, 98, and 99 are the ascii codes for a,b,and c respectively.

    The following is from: http://en.wikipedia....Java_hashCode()

    where:
    h(s) is the hash code for string s
    n is the length of s
    si i s the ascii code for the ith ;character in string s, s[0] being the first character and s[n-1] being the last

    I have found a way to keep numbers in range in Excel by using the mod() function on the 31^n-i-i term.
    ie: mod(31^11, 2^32)
    Actually any term that might get too big.
    This is equivalent to the rolling over that occurs in the java routine.

    Update: I just finished my Excel spreadsheet hashing "

    pollinating sandboxes" and it works perfectly without Excel going out of range or defaulting to scientific notation. It stayed all integers.

    Rollback Post to Revision RollBack

  • #8 Jun 30, 2013

    The java hashcode() routine uses 32 bit signed integer math so text seeds will be in the range of -2,147,483,648 to 2,147,483,647.

    HOWEVER, the Minecraft seed input routine can take a 64 bit signed integer, so you can enter any integer in the range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
    WARNING: DO NOT enter the commas! The seed input routine in MC only recognizes -+0123456789, those 12 characters only, as being numeric. + can be used but isn't necessary. Any leading zeros will be removed without changing the outcome.

    Not entering a seed or entering 0 (zero) when you create a world will cause MC to produce a seed derived from the computer's internal clock. This seed will also be a 64 bit signed integer.

    Rollback Post to Revision RollBack

  • #9 Jun 30, 2013

    So there's really no way to go "oh, at this point in the seed, this digit means Extreme Hills, and this digit means More Than Average Gold Ore", is there?

    Rollback Post to Revision RollBack

  • #10 Jun 30, 2013

    So there's really no way to go "oh, at this point in the seed, this digit means Extreme Hills, and this digit means More Than Average Gold Ore", is there?

    Nope, none at all.

    Amidst v2.1 will take a seed and instantly give you a biome map of the world that would be produced using that seed.
    It will also show the locations of the three strongholds, and guesses where villages, temples, and witch huts will be.

    Rollback Post to Revision RollBack

  • #11 Jul 2, 2013

    I just modified my Excel spreadsheet to tell me every time the calculations "rolled over", that is exceeded 32 bits and got truncated.
    In calculating the hashcode for "pollinating sandboxes" the math routines rolled over 36 times.

    Edit: 11:57 4 July, 13
    I refined my Excel spreadsheet and got rid of a LOT of inefficiencies.
    Now the sheet calculations only "roll over" 14 times when calculating the hashcode for "pollinating sandboxes" and the sheet is MUCH less complicated.

    Rollback Post to Revision RollBack

  • To post a comment, please login.

Posts Quoted:

Reply

Clear All Quotes