BlueSnakelet
Terrarian
I was messing around with the source code, and I was able to derive a simple formula that can be used to determine which ore will generate for any of the first four tiers (Copper/Tin, Iron/Lead, Silver/Tungsten and Gold/Platinum) in any given seed:
If the inequality holds true, the world generates with the older ore (Copper, Iron, Silver or Gold). Otherwise, it generates with the newer ore (Tin, Lead, Tungsten or Platinum).
For example: If you want to create a world with the seed
Of course, due to the huge numbers involved you can't calculate it by hand. But you can easily do it by copying an pasting it to an online calculator. Just searching the whole thing on Ecosia worked for me. This inequality is true, so the world will generate with Copper.
Alternatively, you can run an algorithm that calculates all four tiers at once. I wrote a short program in the Kotlin Playground that does just that. You write the seed, and the program says which four ores will generate in that world. For convenience, it supports text seeds and automatically converts them to numerical seeds.
The formula does not work with secret world seeds. Even if you could somehow choose the behind-the-scenes seed, the differences in world generation are likely to throw off the RGN, leading to an incorrect result.
Here's a program that generate random seeds with Copper, Iron, Silver and Gold. Just follow the link and click "▶ Run".
Here's a program that generate random seeds with Tin, Lead, Tungsten and Platinum. Just follow the link and click "▶ Run".
(seed * multi + base) % 2147483647 > 1073741823
seed
is the numerical seed. It is always an integer between0
and2147483647
.multi
is one of four constants, depending on the tier.1582116761
for the copper tier.1676571504
for the iron tier.1476289907
for the silver tier.1117239683
for the gold tier.
base
is one of four constants, depending on the tier.626863973
for the copper tier.1003550677
for the iron tier.1358625013
for the silver tier.1008269081
for the gold tier.
X % Y
is the modulo operator.
If the inequality holds true, the world generates with the older ore (Copper, Iron, Silver or Gold). Otherwise, it generates with the newer ore (Tin, Lead, Tungsten or Platinum).
For example: If you want to create a world with the seed
665517289
, and you want to find out if it will generate with Copper or Tin, you'd calculate like this:(665517289 * 1582116761 + 626863973) % 2147483647 > 1073741823
Of course, due to the huge numbers involved you can't calculate it by hand. But you can easily do it by copying an pasting it to an online calculator. Just searching the whole thing on Ecosia worked for me. This inequality is true, so the world will generate with Copper.
Alternatively, you can run an algorithm that calculates all four tiers at once. I wrote a short program in the Kotlin Playground that does just that. You write the seed, and the program says which four ores will generate in that world. For convenience, it supports text seeds and automatically converts them to numerical seeds.
The formula does not work with secret world seeds. Even if you could somehow choose the behind-the-scenes seed, the differences in world generation are likely to throw off the RGN, leading to an incorrect result.
Here's a program that generate random seeds with Copper, Iron, Silver and Gold. Just follow the link and click "▶ Run".
Here's a program that generate random seeds with Tin, Lead, Tungsten and Platinum. Just follow the link and click "▶ Run".