Space Engineers

Space Engineers

Not enough ratings
How to Switch Between Steam Branches
By Gwindalmir
Explains how to keep multiple branches of Space Engineers (or any game), in your Steam library, and switch between them without re-downloading the content changes every time.
   
Award
Favorite
Favorited
Unfavorite
Introduction
This was copied from the KeenSWH forums here: https://forums.keenswh.com/threads/how-to-easily-switch-between-steam-branches-for-modding.7385481/

For anyone that has had to switch between multiple Steam branches for testing or modding, you typically have to either constantly switch branches and re-download the changes, backup/restore, or manage multiple steam installs.

There's a much easier way, all it requires is some set up.
Preparation
  1. Start with a branch initially, we'll use the default branch as an example (Public internally)
  2. Make sure the game is up to date.
  3. Go into Steam\SteamApps\common, and make a copy of the entire SpaceEngineers directory.
  4. Rename the copy from Space Engineers - Copy to SpaceEngineers.default
  5. Go up a level to SteamApps
  6. Create a copy of appmanifest_244850.acf
  7. Rename that copy to appmanifest_244850.acf.default
  8. In Steam, go back and switch to another branch, we'll use publictest
    • Check the next section below for help if you don't know how
  9. Once updated, EXIT STEAM
  10. Rename the SpaceEngineers directory to SpaceEngineers.publictest (do not copy)
  11. Go up a level again, and Rename the appmanifest_244850.acf to appmanifest_244850.acf.publictest (do not copy)
  12. Now you have both branches ready. Continue below to see how to switch
How to Switch Branches in Steam
If you don't know how to switch branches in Steam at all, do the following:

  1. Right click on the game in your library, and click Properties.


  2. Select the Betas tab, and select the branch you want to switch to. Keep in mind the branch you want may be at the bottom and require scrolling.
    Once you see it, select it and click OK.
Switching Branches
To switch between the two branches at this point, I have two batch scripts I use. One for each branch.

Steam must not be running. I recommend exiting steam completely (don't just close the window).
The script will kill steam if it's still running, but I recommend exiting safely.
It's very important that Steam is not running. If you switch branches while Steam is running, it will get confused and corrupt the branch.

  1. Exit Steam, or let script kill it
  2. If you are on Public/default, and want to switch to publictest, run switchtopublictest.bat
  3. If you are on publictest, and want to switch to Stable, run switchtodefault.bat
  4. Relaunch steam (if the batch script doesn't for you).

Both versions of the game will continue to stay up to date automatically as you switch back and forth. So no need to worry about that.
There's a lot more this could do (like automatic branch detection), but for simplicity, I didn't go down that route. You are welcome to do that.
Scripts
Place both of the following files in Steam\SteamApps\common:

switchtodefault.bat
@echo off setlocal set BRANCH=default taskkill /t /f /im steam.exe 2>NUL taskkill /t /f /im SpaceEngineers.exe 2>NUL taskkill /t /f /im SpaceEngineersDedicated.exe 2>NUL rmdir SpaceEngineers mklink /j SpaceEngineers SpaceEngineers.%BRANCH% :: Swap the steam manifest del ..\appmanifest_244850.acf mklink /h ..\appmanifest_244850.acf ..\appmanifest_244850.acf.%BRANCH% :: Uncomment/comment the following line to toggle autostart steam (:: are comments) start "" "%ProgramFiles(x86)%\Steam\Steam.exe"

switchtopublictest.bat
@echo off setlocal set BRANCH=publictest taskkill /t /f /im steam.exe 2>NUL taskkill /t /f /im SpaceEngineers.exe 2>NUL taskkill /t /f /im SpaceEngineersDedicated.exe 2>NUL rmdir SpaceEngineers mklink /j SpaceEngineers SpaceEngineers.%BRANCH% :: Swap the steam manifest del ..\appmanifest_244850.acf mklink /h ..\appmanifest_244850.acf ..\appmanifest_244850.acf.%BRANCH% :: Uncomment/comment the following line to toggle autostart steam (:: are comments) start "" "%ProgramFiles(x86)%\Steam\Steam.exe"
Conclusion
A keen eye will notice the two scripts are identical, except for the set BRANCH= on line 3. Just change the part after the equals sign to match the extension you chose above.

To keep this system flexible, this uses junctions and hardlinks in Windows. The technical details don't matter, all you need to do is create more directory and appmanifest copies, and batch scripts if you want to enable more branches (eg. CTG), following this same pattern.

There's no limit to the number of branches you can have, except your disk space.
1 Comments
luckz Jul 26, 2024 @ 4:58am 
2024:
This .acf approach doesn't work.
Any changes to the .acf need to be made to the original .acf.%BRANCH%.
With a hard link, the .acf file is overwritten, the hard link is broken, and the .acf.%BRANCH% stays unchanged.
With a symlink, the .acf symlink is overwritten with a new .acf file, and the .acf.%BRANCH% stays unchanged. (Plus with default Windows settings, for dumb reasons, UAC consent is needed to make a symlink.)


So to work nicely with Steam game updates, you can either

- keep track of the previous branch to copy the .acf back to .acf.%BRANCH% before copying the other .acf.%BRANCH% to .acf

- just use a different Steam install folder for a different branch

- separate the different game installs with folder names that are reflected in the .acf, and read the old .acf's folder name to know which branch it is, then overwrite that branch's .acf.%BRANCH%