Valheim

Valheim

Way to change save world location?
For the dedicated server. It defaults to

C:\Users\<<My Username>>\AppData\LocalLow\IronGate\Valheim\

Is there a way to move this?
< >
Showing 1-15 of 18 comments
Skade Feb 2, 2021 @ 9:18am 
Hello,

Just make a link, for example in C:\Users\<<My Username>>\AppData\LocalLow\

mklink /J "C:\Users\<<My Username>>\AppData\LocalLow\IronGate" "path_destination_of_your_choice"

:)

Last edited by Skade; Feb 2, 2021 @ 9:19am
HumanGenome Feb 2, 2021 @ 1:29pm 
Would be great if they made this a server launch param
Olderine Feb 2, 2021 @ 10:26pm 
Open an elevated command line cmd.exe, not powershell, and create a symbolic link by typing mklink /D "location game is saving to" "location you want it to save to". Hopefully they will create a configuration file system with more options including save location :)
Last edited by Olderine; Feb 2, 2021 @ 10:30pm
Frog Mar 5, 2021 @ 11:19pm 
Originally posted by HumanGenome:
Would be great if they made this a server launch param
there is a -savedir launch parameter actually
={cXn}= SlikRick Mar 5, 2021 @ 11:19pm 
Is there a Solution to actually change the save location? This method only works if you don't want the general Data saved there to be saved there or simply want it Sync'd somewhere else.. This wont work for changing an Individual save location, like if you had multiple copies of the game but 1 was modded and you don't want that data to be Cross-Effected.
Last edited by ={cXn}= SlikRick; Feb 8, 2022 @ 7:24pm
Wariat117 Mar 5, 2021 @ 11:51pm 
It's possible, go to file
\Steam\steamapps\common\Valheim\valheim_Data\Managed\assembly_valheim.dll

Class: public class World
Method: private static string GetWorldSavePath()

Just change the path it returns, and it will be the new path to save files
If you do it only on dedicated then dedicated saves will go there
If you do it in mod, then it will send saves there only when you use mod
If you do it directly in game files, then it will send all saves there
={cXn}= SlikRick Mar 6, 2021 @ 7:49pm 
What is the Encoding to Read it or what do I use to edit it? I'm don't know much about editing files like that, but I tried Notepad++, Hexeditor, Visual Basic 2008. I'm Having Trouble where to find the actual path or where to edit, in Hexeditor and Visual Basic. Notepad++ Can't Read it off the drop-down Encodings.
Wariat117 Mar 6, 2021 @ 10:55pm 
I'm using "dnspy" to read and edit .dll files
I have heard that some people use "visual studio" with C# extension, but that didn't work for me

But generally any program that allows to edit C# should do the job for you
Keep in mind there are programs that allow only reading (iirc it was called ILspy)
={cXn}= SlikRick Mar 6, 2021 @ 11:50pm 
That did the Trick! Thank you!! Do you happen to know where to edit the Char save as well?
Locuust Mar 7, 2021 @ 12:04am 
@Tea Lizard - Cool, thanks for that I was thinking I might try moving my saves to my NVME to see if it could help with the autosave lag I get somewhat.
Wariat117 Mar 7, 2021 @ 12:06am 
Originally posted by ={cXn}= SlikRick:
That did the Trick! Thank you!! Do you happen to know where to edit the Char save as well?
I didn't try this, but it seem to depend on which file you edit~~

assembly_utils.dll
If you edit it there then characters will be saved in Path/characters/ (aka game will automatically create "characters" folder and save stuff inside)
BUT it will also change the world saving location, screenshots saving location, list of admins/banned/whitelist (potentially logs other stuff too)


Class: public static class Utils
Method: public static string GetSaveDataPath()

Just remove everything from method and do
return Path;
for example
return "C:\Users\User\AppData\LocalLow\IronGateEA\Valheim0.146.11\";

I didn't mention this one previously because I thought you want to change only the world's location
Changing this Path will literally replace
C:\Users\%username%\AppData\LocalLow\IronGate\Valheim\
With whatever Path you insert there, all stuff that was originally in this folder should start to save in the new Path



assembly_valheim.dll
If you edit it there then characters will be saved in Path you choose
(multiple methods in class to edit there, no quick "change once and go")


Class: public class PlayerProfile
Method: private bool SavePlayerToDisk()

Directory.CreateDirectory(Utils.GetSaveDataPath() + "/characters"); string text = Utils.GetSaveDataPath() + "/characters/" + this.m_filename + ".fch"; string text2 = Utils.GetSaveDataPath() + "/characters/" + this.m_filename + ".fch.old"; string text3 = Utils.GetSaveDataPath() + "/characters/" + this.m_filename + ".fch.new";

Changing those 4
Utils.GetSaveDataPath() + "/characters/"
into different Path should do the job for character saving



Class: public class PlayerProfile
Method: private ZPackage LoadPlayerDataFromDisk()
string text = Utils.GetSaveDataPath() + "/characters/" + this.m_filename + ".fch";
changing it there should do the job with loading character



Class: public class PlayerProfile
Method: public static List<PlayerProfile> GetAllPlayerProfiles()
array = Directory.GetFiles(Utils.GetSaveDataPath() + "/characters", "*.fch");
changing it there should do the job with getting list of your characters



Class: public class PlayerProfile
Method: public static void RemoveProfile(string name)
File.Delete(Utils.GetSaveDataPath() + "/characters/" + name + ".fch");
changing it there should do the job with deleting characters



Class: public class PlayerProfile
Method: public static bool HaveProfile(string name)
return File.Exists(Utils.GetSaveDataPath() + "/characters/" + name + ".fch");
changing it there should do the job with checking if character exists


Last edited by Wariat117; Apr 27, 2021 @ 2:15am
Locuust Mar 7, 2021 @ 12:13am 
ehhh? Am I missing something? Why go through the trouble of modifying DLL schema when a launch parameter seems to do it fine?? Wouldn't that also work for multiple instances as each could be run with different parameters??
Washell Mar 7, 2021 @ 12:14am 
The problem with editing DLLs in a game under active development is that updates can and will revert settings. If you're lucky not that often, if you're unlucky, every update.

The savedir parameter will stick, and is the far better option.
Last edited by Washell; Mar 7, 2021 @ 12:15am
Wariat117 Mar 7, 2021 @ 12:15am 
Originally posted by Locuust:
ehhh? Am I missing something? Why go through the trouble of modifying DLL schema when a launch parameter seems to do it fine?? Wouldn't that also work for multiple instances as each could be run with different parameters??
that was for the guy who asked
if game supports parameter to change it then nice
the .dll works for instances too ;D


Originally posted by Washell:
The problem with editing DLLs in a game under active development is that updates can and will revert settings. If you're lucky not that often, if you're unlucky, every update.
if you use mod then changing it once wil do the job, and the only time you would have to update mod would be when devs change saving system

if you edit directly in the .dll file... then you would need to update it each time game updates :D
the assembly_valheim is main code of game, so each update is going to change it~~
Last edited by Wariat117; Mar 7, 2021 @ 12:17am
={cXn}= SlikRick Mar 7, 2021 @ 1:42am 
Originally posted by Wariat117:
that was for the guy who asked
if game supports parameter to change it then nice
the .dll works for instances too ;D

This is Exactly the In-Depth technical solution I was looking for and needed!
It's nice when you get a solid answer like this, Thank you!
I just have 1 more issue.. I'm having trouble figuring out how Exactly to Edit that Method in assemble_utils.dll

public static class Utils { public static string GetSaveDataPath() { if (Utils.m_saveDataOverride != null) { return Utils.m_saveDataOverride; } return Application.persistentDataPath; }
I figure I delete everything from 'if' on except the last Bracket and replace with:
{
return path; ???
}
The 'path' is red and I'm unsure of the Code needed to set it to read the Path which I choose to be
C:\Users\%username%\AppData\LocalLow\IronGateEA\Valheim0.146.11\
as a quick easy example..
I'm sorry about the Minor Details, I'm not much of a coder..
Last edited by ={cXn}= SlikRick; Mar 7, 2021 @ 1:47am
< >
Showing 1-15 of 18 comments
Per page: 1530 50

Date Posted: Feb 2, 2021 @ 8:27am
Posts: 18