r/valheim • u/Melichorak • Oct 17 '26
Discussion Namescumming 2: Electric Boogaloo
I am the author of the yesterday's post that exploded on how to exploit the names to reach any quality level, as long as you have idols.
The tool in question: https://melichor.github.io/ValheimSaveParser/
Let me clear one thing up. This tool allows you to find upgrade paths indefinitely, as long as you have idols, you can upgrade without a chance of breaking, if you do everything correctly.
Since the first post was sort of brief and changed as people pointed out things that made me realize the exploit goes even further than I originally thought. So this post explains how it works internally, the bug that is there, and my thoughts onto how to fix it so that the devs might be satisfied and how I think it should be fixed so that the game is actually fun.
How random works in games:
True random is really hard to do, and if the universe is deterministic, you can't achieve true random, so we fall back to pseudorandom, and if needs be, we have "true random" in form of quantum patterns and data from space. But that is highly impractical so pseudorandom is definitely the way to go in games. Pseudorandom works by performing math operations, that transform a number so that the results seem random. The big issue is how to determine the starting point of this, this is called "Seed". The issue with seeds, is that once you know the seed, you know every RNG roll that is sequential to this. This can be mitigated (please note, mitigated, not countered), by using a current time as a seed, however a case can be made for using seeds that are not time dependent and are deterministic.
For ease of understanding, you can imagine a seed as a sequence of numbers that you can reference, that seem random. They are NOT a sequence of numbers, seed is a singular number, but functionally it works like a sequence of numbers for this purpose.
I didn't investigate how it worked before exactly, just that there wasn't a seed stored in the save file. But since it was completely random, some seed was probably initialized internally and used to determine the RNG rolls of not only the forge, but of other things as well, making it appear random.
Let's discuss a hash function. A hash function takes a sequence of letters (string in programming) and transforms it into a number. This is extremely useful for multitude of reasons, but for this purpose it is useful, because you can use a string to create a seed. In Unity the seed is started as a 32-bit number (the most common size in programming, I would have reservations against using 32-bit for hashes and seeds, using 64-bit would probably be better, and it is actually possible with Unity, although a bit unintuitive, but the bug that is there would be resolvable with 32-bit as well). Later it is transformed into a 128-bit number that can be modified.
Credit where credit is due, they at least wrote their own GetStableHashCode function, because GetHashCode from .NET is not stable between runs, on the other hand, if they used that function, it would make everything more complicated, not impossible, but complicated.
Now, we are getting to the interesting part.
Everytime you attempt to upgrade a weapon, the game looks into your character, if the seed exists for the item name and the quality you're trying to reach. If not, it generates one. That means that for every step of the upgrade path, the randomness does not influence other upgrades, but it influences subsequent retries for the same quality upgrade.
Let's assign them a numbers so that you understand what I am saying
Upgrade 3->4 gets a sequence of numbers [1, 2, 3]
Upgrade 4->5 gets a sequence of numbers [4, 5, 6]
Upgrade 5->6 gets a sequence of numbers [7, 8, 9]
That means, that if you attempt upgrade 3->4 the first number is extracted and used for probability, and you are left with:
Upgrade 3->4 gets a sequence of numbers [2, 3]
Upgrade 4->5 gets a sequence of numbers [4, 5, 6]
Upgrade 5->6 gets a sequence of numbers [7, 8, 9]
Meaning the other probabilities weren't touched at all.
The intent behind it was obvious, make save scumming impossible. Except it didn't succeed in preventing save scumming either and it made the new method possible.
How can you still save scum? As I said, the seeds are saved to the character, so if you duplicate an item, you are bound to get a successful roll for that quality eventually. You just must be sure to not reload the character, just dupe the item.
How the exploit works? Pretty easily, knowing how the seed is generated I can try a lot of combinations of seeds to find which one I want. So let's get how the seed is generated.
You hash the character name into a 32-bit number, you hash the item name into a 32-bit number and you add the all together along with the target quality
seed = hash(character_name) + hash(item_name) + quality + 1
So once I know the seed, I can just try many different combinations to find out the longest sequence of successes. But hold on, why does it allow only 8 sequential successes until you break an item for the first time? Because there is a bug. In Unity sequential seed numbers used for random are correlated, and if you look at the seed generation, the only difference between seeds for the same item type and character is quality, that increases by one. This is a bug, and very easily fixable, they just need to use a seed mixer first, that would remove this correlation.
How to fix this so that the devs are satisfied? Tie the seed to the item, not to the character. This sucks, but achieves what the devs were attempting to do. Basically once you upgrade the item once, the game will essentially lock the potential of the item, it will still be readable, so you still know exactly how far you can take the item (That part isn't avoidable if they want to avoid save scumming), but it won't allow you to infinitely upgrade the item. You still need to change the seed generation for that one. Drop the entire seed per quality, just one seed per item, and make it dependent on time, not on any static text.
Now we move onto my opinion:
Do I want it to be fixed that way? No. I want FoP to be completely reworked, and there are many ways to do that.
My favorite one is Weapon XP. It goes along with the core idea of the grind in the game, you use a weapon, the weapon gathers weapon XP, and once it reaches enough XP, you can take it to the FoP, use an idol and upgrade it. You may or may not have a maximum level for that. It may also take increasing number of idols and weapon craft resources to reach higher levels. This exactly serves what FoP was meant to do, allowing you to carry your FAVORITE items you created before to higher biomes. The best part is that the moment you take it to the FoP is a grand moment of accomplishment, not to mention finding the totems wouldn't be: "Eh, there's something I found for a mechanic I don't want to use." it would be: "Oh, I wanted to upgrade my weapon, and now I found what I was missing to do that."
42
u/cok3noic3 Oct 17 '26
This sounds like cool information. Can I get an ELIgreyling?
9
u/17scenes Oct 17 '26
I'm going to assume that you're a developer of some sort in school/in your career. You clearly know what you're talking about. Are you going to consider making a mod for your suggestion? Based on historic evidence, there's a high likelihood that the devs are going to ignore/reject your suggestion. If you're not going to do it, I might do it.
4
u/kkngs Oct 17 '26
You do realize they're gonna start salting the hash if they ever read your post, right?
For your weapon xp id... they could probably tie the item xp id to adrenaline earned while its equipped. This would work with both weapons and armor, then. I'm not sure the devs are gonna be keen on adding additional state variables to every equipable object in the game, though. They'd also need new UI elements for how the forge works then, too.
5
u/SuperPursuitMode Oct 17 '26
Love the work and dedication you put into this game, much appreciated!
As for the weapon xp thing, this would just cause meta players to use the same exp farms used for skill maxing more, which would mean even more immersion breaking meta gaming grind.
As for the forge, I would like to see it useable for cosmetic effects in the future. Playing around with glow color and intensity and hopefully being able to change color patterns on existing armor pieces would be awesome and could provide a crafting use for the new gems from the Deep Northand provide us with a money sink for all that endgame gold by maybe having to buy some mats from the traders too.
2
u/likes_almonds Oct 19 '26
Does this still work?
115
u/whatanHPoP Oct 17 '26
I really like your suggestion for a reworked Forge!
Whatever gets me fighting more is a win in my book.
29
u/Figorix Oct 17 '26
Bro casually dropped best rework idea i've seen on this sub at the end of lengthy technical explanation most people wont read 🥲
23
u/tophergraphy Oct 17 '26
Weapon XP sounds like a decent avenue, but how does armor work?
76
u/derpster_phil Oct 17 '26
I gave you a hard time on your post yesterday. I'm sorry. You're really putting a lot of work into this.
Your suggestion to improve the forge is the best I've heard, and is definitely a mod I would use if it existed.
26
u/SuddenBumHair Explorer Oct 17 '26
Very interesting read that went right over my monkey brain.
The weapon xp thing is the best idea ive heard
11
u/Independent_Vast9279 Oct 17 '26
Thanks for the suggestion on a new FoP system. This is a rare actually helpful post. Instead of just saying “don’t like it, don’t use it”, I wish more people could use some imagination to suggest improvements.
Your system would be amazing. RNG applied to crafting is a blight and never works well. Having a goal to work toward and then definitively accomplishing it is the whole of these games. The systems should reflect that.
Bravo
8
u/0x1f480 Oct 17 '26 edited Oct 17 '26
If they wanted a random chance at upgrade that isn't cheatable (without mods/external software), why worry about a seed at all? Why not just use a pseudorandom math function based on the least significant digits of the computer's clock at the time of upgrade attempt?
But I agree with your overall design critique at the end. The current system is bizarrely badly designed. Weapon exp would be fine. I also like the idea of upgrades that are capped based on the idol + the quality of the item, so for example silver idols could get frostner to +4 (maybe +6), plains(?) idols could get it to +8, and so on. This would serve the same purpose of letting you keep older weapons relevant. Alongside this, upgrades would always succeed, or have no penalty, or just downgrade 1 level, since finding the idol is most of the challenge and they can't make you really OP.
Nice job with the tool and thanks for the writeups.
4
u/CCRogerWilco Oct 17 '26
A lot of people are familiar with seeds for a random generator, as the map uses a random seed as well.
Using the same seed gets you the same map.
4
u/half-OP Oct 17 '26
For me , i think the forge of potential place shouldn’t be fixed. It should act like the leviathan. You randomly find it in the ocean while exploring.
If you find the FoP island, you have 1/2 upgrades before the island sinks. It’s always guaranteed! You still need idols!
More exploration = more spawned islands
That’s harder to spam, and requires exploration all whilst being safe.
3
u/ElectricLego Oct 17 '26
Love the weapon XP idea. I hope that gets implemented. At least modded in
4
u/MQ2000 Oct 17 '26
I still like the idea of you have to fight in an arena with enemies to upgrade the item, getting harder each level
2
u/eltarah Oct 17 '26
Would it not be kinda easy to create a mod with the weapon experience idea of how the FoP should work? I really dig that one!
2
u/Shalvan Oct 17 '26
That's a really cool idea actually
2
u/Curious_Positive7126 Builder Oct 17 '26
Very nice but how do you all have so many idols? I'm still even looking for 1 wooden. I think I've been to every meadows biome and combed them
2
u/Fun_Magazine_2671 Oct 17 '26
That’s a fantastic study—I’m really impressed!
I don’t think I’ve fully understood everything, and I don’t think this is the best solution, but what about using the world seed instead of the character name as the seed value?
To ensure that equipment is enhanced, you’d have to switch worlds instead of switching characters—but since that’s more trouble than switching characters, I think it would significantly reduce the number of people who would actually try to do it.
I think this method would make it easy to make corrections, but why do you think they chose not to do that and instead used the character names as seed values?
2
u/ifiwasiwas Happy Bee Oct 17 '26
You're a legend man. Thank you!
2
u/untiedgames Oct 17 '26
Since everyone's posting their ideas for a rework, here's mine.
The idols are already pretty rare, so why not use those as a limiting factor of sorts instead of breaking your weapon/armor? Maybe they could be required for the upgrade but not consumed on success. As you upgrade further, the chance to break the idol goes up. Maybe a gold cost could also be introduced to balance the pacing of the upgrades- Haven't gotten to the deep north myself yet but have heard that players could use a way to spend the gold they're getting.
Some other ideas, take your pick:
The sky is pretty much the limit, I feel like there are tons of unexplored options for an upgrade mechanic here. The way it's implemented now is not making me want to use it at all.
1
u/Piqued_a_Pack Oct 17 '26
Your suggestion is incredibly elegant and flavorful, I truly hope that the development adopt it. If they don't, I'm sure the fantastic heroes in the modding community will take it up!
1
u/NuclearAnt Oct 17 '26
Good job. Have never used the forge at all since I dont go above tier 2 for most things but I see the work you put into it and appreciate that.
1
u/Ender_arrows Oct 17 '26
I dunno what spurred you to go through such thorough lengths for this post, but good job. Also great forge rework idea.
1
u/Jolly-Potato-7327 Oct 17 '26
You’re a very smart individual. Well done.
1
u/ArvaroddofBjarmaland Oct 17 '26
This is a lovely tool--thank you!
1
u/DigiToss Oct 17 '26
Do you have any idea how invasion locations work, is there some sort of way to manipulate their location?
1
u/Serious-Elderberry65 Oct 18 '26
I also found that you can use new characters and boost an item, then go one upgrade at a time till you are able to check your main character file and see it will get an upgrade on the item. No way to prove you didn’t do it on ur main because it will have ur mains name on the item
1
u/wasuu Oct 19 '26
There is so much ideas for FoP rework. I kinda like the one that depends on amount of bosses defeated - so the further you progress in the game the more max level for weapons/armors from subsequent bioms is raised.
Weapon XP would work great for weapons, but what about armors? They are used passively so thy only way I can think about is accumulating XP with time.
That being said it wouldn't be a bad idea to have some forum or somewhere where different ideas can be submitted, discussed (and updated after discussion) and then voted for.
Reading others ideas is actually a lot of fun for me.
1
u/tenuousemphasis Oct 19 '26
I was inspired by your item XP idea so I vibe coded a mod to implement it:
https://thunderstore.io/c/valheim/p/Nerdtastic/EquipmentExperience/
It's makes minimal changes to the Forge code so that future updates shouldn't break it, but I will fix it if they do.
-3
u/eljimo Oct 17 '26
This is amazing, so you can create an item, look up a name, make a new char to pass item to, upgrade 8 times, then make another new char with specific name to upgrade 8 more items guaranteed using your tool?
It's incredible the length that people that can come up with to not play the way the Devs intend us to play lol.
-10
u/lctdmf Oct 17 '26
That's a lotta words
-7
u/BozzoBurgess13 Builder Oct 17 '26
This forge of potential conversation is exhausting.
Im sure gamers just love to complain about something, honestly the game is still awesome, the forge isnt even needed
-12
u/ElBasham Oct 17 '26
I ain't reading all that
I'm happy for you tho
or sorry bout your gay guy diet
1
u/OGXanos Viking Oct 17 '26
The weapon xp idea is perfect. I have one suggestion for it. Xp only comes from kills. Otherwise we'll just end up with people infront of T.W.I.G. like for skills. Xp could scale by mob type, biome, and of course stars.