Why does *this* seed generate a drunk world in Terraria?

Yes – it is in fact true that if you enter “shit 
egypt forth” into the seed input in Terraria,   the game will generate a drunk world. Huh.
This isn’t unique to this seed, either – other   examples like “crap economy bath”, “Vewlfr”, or 
“pimp daddy faithexploration co” also work. Yeah.  So… why is this the case? Isn’t the drunk world 
supposed to only occur on the seed 5162020? Well,   technically speaking, it does – look at the 
code, and bam, it’s right there – the only   condition for it. Clear as day. However, as it’s 
clear that this isn’t STRICTLY true… so, why?  The answer lies in strings. Note that when 
we entered these seeds, we only entered in   strings – that is, text. However, Terraria 
seeds are internally interpreted as numbers.  Therefore, if a string seed is entered, 
Terraria simply converts the text to an   integer. These conversions are done by sending 
the string through the CRC32 hash algorithm.  CRC32 just takes some data and spits out a 32-bit 
integer based on that data, so Terraria just feeds   the strings into it to get some integer which 
it can then work its worldgen on – a quick   way to get strings to work as numerical seeds.
Knowing this, given that all strings are just   converted to integers, it makes sense that 
if we just find what strings are converted   to 5162020 by the CRC32 hash, we can 
find strings that generate the drunk   world – and yes, people can and have done that.
Since CRC32 only has 4 billion possible outputs,   it is pretty easy for a modern computer to find 
strings like this by just brute force trial and   error’ing all the combinations. For example, my 
computer with a 5-year-old mid-to-high-end GPU   can manage about 7-8 billion hashes per second, 
allowing me to find a couple strings per second   simply by brute force. It’s a bit slower if you 
work with dictionaries to try and find phrases,   but overall, it’s not difficult at all 
to find these strings. I found quite   a few in just a short bit, including 
the ones I’ve featured in this video.  Since there are an inconceivable amount of strings 
compared to the amount of 32-bit integer values,   there are an unthinkable amount of strings 
that, when seeded, create a drunk world.   You just need to go out and find them.
Once you have a string or strings that   matches the correct CRC32 hash of 5162020, 
enter it into Terraria and it should convert   and generate a drunk world, just like that.
Another funny tidbit about the Terraria   integer seed conversion is how it deals with 
negative numbers – which is, it doesn’t. There   are no negative Terraria seeds. It just takes 
the absolute value of all negative numbers.  This means that if you enter in -5162020, 
you’ll also get a drunk world, and strings   that hash to that number also generate a 
drunk world, which is certainly interesting.  Well, that’s it for this short 
video about Terraria worldgen.  Hopefully some cryptography nerd 
doesn’t beat me to death because I got   one detail wrong – I’m no expert here, haha.
Oh, and by the way, this whole shabang works   the same on the celebrationmk10 seed, which 
works on the seed 5162011 [or 5162021] – it’s   just a different number, and I 
didn’t feel like repeating myself.  If you enjoyed this video, consider 
subscribing, as only about a third of   you are. If you enjoy these kind of Terraria 
internal dives, my Inside Terraria series of   videos may suit you – the playlist is on the 
right. An algorithmic video is on the left.   Either way though, thank you for watching, and 
good day and good bye. See you next fortnight!

Why does *this* seed generate a drunk world in Terraria?
SIKE! It’s computer shit.
Discord: https://discord.gg/yJrCt9YFz5

Chapters:
0:00 Introduction
0:41 CRC32 and string conversions
1:35 Finding seed strings
2:20 Putting the string in & other tidbits
2:57 Conclusion & outro

Music:
OMORI – Remember to be Patient
OMORI – H20:HCL
Vanilla Calamity Mod Music – “serene tides”

Mods and Packs:
Foundry & Alchemy (Pack) – https://steamcommunity.com/sharedfiles/filedetails/?id=2440505684
Fancy Lighting [Ultra Preset] (Mod) – https://steamcommunity.com/sharedfiles/filedetails/?id=2822950837
Stanberry Font (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2559652586
Stormdark UI (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2448259079
DragonLens (Cheat Mod) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2939737748
Better Zoom (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2562953970
Character Stats (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=3033200611

Why does *this* seed generate a drunk world in Terraria?

49 Comments

  1. so,does that mean other secret seeds also get converted into strings?

    if so then is it possible to do the opposite and type in the string directly to generate the seed

  2. This reminds me of the Family Feud TAS where people just try to find the funniest ways to write things while meeting the requirements of the code

  3. a similar thing happens in minecraft! using strings is actually the only way in java edition to generate a world with the seed 0 !

  4. I knew this was probably dealing with Hashing algorithms. By the halfway point, I was skeptical that there were quite a lot of collisions, but you covered this as I wasn't familiar with CRC. Rather, I didn't know it was 32 and technically signed but converted.

    I love this series. We out here teaching the populace elementary computer science topics.

  5. Reminds me of using "creashaks organzine" to access seed 0 in minecraft, since 1 digit seeds in minecraft are treated as empty strings to be randomised but inputting a string that gets converted into that digit can still allow access.

  6. kinda wish red would give us some way to access specific "seeds" in secret seeds, since some can spawn with pretty cool world gen

Leave A Reply