Icecovery

[WIN]Game Data Switcher - GDS [V1.0.5]

Recommended Posts

On 2018/3/23 at 12:22 PM, demibear said:

So the program is incompatible with steam installations?

For some permission problems, yes. You can move the game folder to other paths and use. I'm trying to solve this problem...

Share this post


Link to post
Share on other sites
On 1/31/2018 at 10:29 AM, Icecovery said:

CmQ2Zd4.png

 

Game Data Switcher - GDS

Do you want to play stock and RSS game at the same time?

Do you want a clean GameData to debug your Mod?

Are you worried about wasting too much disk space if you copy all game files?

Here is the solution:

Game Data Switcher can help you manage your Mods, it can create more than one GameData so you can choose one of them and launch the game.

But wait, there is more:

This light tool(Only 607 612KB!) can also allow you quickly choose a launch argument form three options, make your game faster.

New: Now support quick switch different language

New: Now allow you choose window mode form LaunchKSP

New: Now LaunchKSP setting will be saved.

New: Automatic backup all Log

New: Support CKAN

New: Clone GameData

Note: Do not use the GameData that created by the previous version of V1.0.2.

Please copy all the mods and save to somewhere else, delete old GameData and Saves and re-create new GameData by V1.0.2!

ZUaflS2.png

UI of V1.0.3

How it works:

Note: GDS can process different Saves folder now, don't need to worry about choosing the wrong to save and damage the vehicle there anymore.

Game Data Switcher is developed using C# and a little bit VB, it uses a simple method to switch between many GameData.

Here I have 25 GameData folders in a game root folder at the same time. But KSP will only read the Mods in folder "GameData".

GDS will save the NAME of this folder in a file under this folder called "GameDataData.data", and add "_NAME" at the back of the name of all non-default GameData folders, so they will not be read by KSP.

When a GameData set as the default GameData, GDS will remove the "_NAME" from the back of the selected folder name, and add "_NAME" back to the previous folder.

7SUPEPP.png

^Main window of GDS, with 25 GameData Folders

risJYbb.png

^GameData Folders in the File Explorer

nnDjmwX.gif

^This GIF shows how to Rename a GameData folder and how to set the default GameData folder.

About creating a new GameData, GDS will create a new folder call "GameData_NAME" under the game root folder, and create "GameDataData.data" file under this new folder. At last, it will copy the "Squad" folder from the default GameData folder. Starting V1.0.5, GDS will also copy the DLC file (if present).

dDSMXo6.gif

^this GIF shows how to create a new GameData folder and rename it(The part of copying Squad folder has been cropped, the actual time may be longer(Depends on your hard drive speed))

About launch KSP part, the three arguments will force KSP launch by using Direct3D 11, Direct3D 9 Or OpenGL, they can make your KSP use less memory.

If your system is in 32bit or you are playing a KSP version before 1.2.2, x64 option will be unavailable.

 

Download: 

Spacedock: click here

 

To Use:

Put the GameDataSwitcher.exe under KSP root folder, and run it.

It will automatically create "GameDataData.data" file under the original GameData folder.

If you already have GameData created by your own, change the name of the folder as "GameData_YOURFOLDERNAME", and create "GameDataData.data" file under each GameData folder, the content should be only one line with the following format.

GameDataData.data:


YOURFOLDERNAME

Then, change the name of "saves" folder as "saves_YOURFOLDERNAME", If you don't have multiple yet, please create a folder and name it as "saves_YOURFOLDERNAME", and copy stock scenarios and training folder to this new folder. 

 

Author:

Development: @Icecovery
Logo design: @01010101lzy
Final Check: @Acea

 

Changelog:

  Reveal hidden contents

V1.0.5 - 20180314

GDS will now copy the DLC file (if present) when creating a new GameData

Add option to choose whether to make backup logs

Add delete logs button

 

V1.0.4 (Unpublished)  - 20180313

Merged pull request #2 (Thanks linuxgurugamer)

-Fixed error with missing slash when trying to rename Gamedata directory(Issue #1)

-Fixed errors when one of the buildID.txt or both of the files is missing

-Fixed error with renaming the buildID.txt files where complete path was being passed in the second argument

bug fixed

 

V 1.0.3 - 20180219

Add Clone Button

Fixed bug about CKAN

 

V 1.0.2 - 20180208

Can save LaunchKSP setting now

support CKAN

backup all log

support switch language

Optimized code

Added a lot of notes

Improve the UI

Allow change window mode at LaunchKSP setting

Maybe Something else but I forget

V 1.0.1 - 20180201

Compressed logo in about folder, save more memory.

Add a function make it can process different Saves folder now. Don't need to worry about choosing the wrong to save and damage the vehicle there anymore

V 1.0.0 - 20180131

Release.

2

 

Known Issues:

For some reason(rights or readonly), GDS cannot change the folder name if the folder is under /steamapps path. To fix it, please move the game to another path that is not under /steamapps. If a possible solution is found, I will fix it soon.

 

I believe there are many other issues with this application(I only spent a day to develop it), you can report the issues you found on this topic or GitHub issues report page.(There is also a link in the application)

 

Donate:

If you like this application, you may wish to try to donate me a cup of coffee and make me have enough energy to keep study in my high school class after making these things! Thank you! :D

 

Source Code:

Github: click here

 

License: 

Game Data Switcher was released under GNU General Public License v3.0

[GPLv3 Logo]

ok so whats this and how do i fix it? 
"

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'J:\Steam\steamapps\common\Kerbal Space Program\GameData\GameDataData.data'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at GameDataSwitcher.MainWindow.MainWindow_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
GameDataSwitcher
    Assembly Version: 1.0.5.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///J:/Steam/steamapps/common/Kerbal%20Space%20Program/GameDataSwitcher.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box."

 

Share this post


Link to post
Share on other sites
On 11/21/2018 at 11:29 AM, mattthenub said:

ok so whats this and how do i fix it? 
"

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'J:\Steam\steamapps\common\Kerbal Space Program\GameData\GameDataData.data'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at GameDataSwitcher.MainWindow.MainWindow_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

You didn't need to quote the entire OP... ;I

There's something fishy with "..\GameData\GameDataData.data"   

Are you trying to create / clone a new GD with the name "GameDataData?" What are you doing that prompts this message?

Share this post


Link to post
Share on other sites
Posted (edited)

New issue! 

"create new GD" only copies in Making History dlc, not Breaking Ground / all.  Just an FYI to the creator and anyone else using this> 

Never Mind-- was confused/distracted by the "Serenity" folder. Even though they didn't go with that name -- I rather enjoy it :)

Edited by Beetlecat

Share this post


Link to post
Share on other sites

I want to try this. It is exactly what I am looking for.

One question and one request:

Does CKAN work with this (and how)?

I have one folder where I keep my personal patches and stuff, is there a way to have it static between the different saves? So when I would switch to a different save, this folder GameData/Goo/* would stay put?

Share this post


Link to post
Share on other sites
Posted (edited)
On 6/12/2019 at 10:43 AM, zer0Kerbal said:

I want to try this. It is exactly what I am looking for.

One question and one request:

Does CKAN work with this (and how)?

I have one folder where I keep my personal patches and stuff, is there a way to have it static between the different saves? So when I would switch to a different save, this folder GameData/Goo/* would stay put?

This works like a breeze with CKAN. It tracks (duplicates and properly renames subdirs) each GameData's installed mods and saved games perfectly well. The only thing that isn't duplicated is the download cache, because why? :D

You'll have to just manually dump your /Goo/* dir between each named GameData -- Though I like that option as a "default mod" of sorts.

Also have to remember to swap between all active games to update to the current patch/KSP versions, since anything but the current one won't get updated. ;)

Edited by Beetlecat

Share this post


Link to post
Share on other sites

 

2 hours ago, Beetlecat said:

You'll have to just manually dump your /Goo/* dir between each named GameData -- Though I like that option as a "default mod" of sorts.

thank you. will try.

two feature requests:

  • 'static' or 'default' mod that stays put between saves.
  • add option to include "-mmdump" to command line.

Share this post


Link to post
Share on other sites

Shoot. @Icecovery hasn't been around since this time last year. These may just be dream ideas for the time being >:)

Share this post


Link to post
Share on other sites
On 6/19/2019 at 5:14 PM, Beetlecat said:

Shoot. @Icecovery hasn't been around since this time last year. These may just be dream ideas for the time being >:)

Quote

Icecovery liked a post in a topic: [WIP] Universal Fleet Solutions - A Modular FTL Spaceship Project November 6, 2018

but, yeah.

Share this post


Link to post
Share on other sites
On 6/19/2019 at 5:14 PM, Beetlecat said:

Shoot. @Icecovery hasn't been around since this time last year. These may just be dream ideas for the time being >:)

found a way! a way to have multiple games running the same installation and or multiple installations using the same GameData/goo/ folder....

mlink - I knew there was a way, just been so many years since used it. (Win based machines)

so you have all your personal patches in one folder... and that folder can be anywhere on your system... haven't tried it yet over network (even cloud) but should work over them as well.

go into your GameData folder with cmd or pshell...

"mklink /d  full path to symbolic\gamedata\goo full path to real \goo"

Spoiler

the actual one I used for this system was:

mklink /d  c:\Games\KSP\gamedata\goo C:\Games\Dev\GameData\goo

am confident it works /ymmv/ and in fact am thinking of using it this way:
 

Quote

 

\KSP\ <--- real hard installation (base)

\$KSP1$\ <--- symbolic link with its own saves/mods

\$KSP2$\ <--- symbolic link with its own saves/mods

\$KSP3$\ <--- symbolic link with its own saves/mods

 

only one installation - and when you update it - all games are automatically updated.

am confident also can be extended even further. So say you want toolbar/toolbarcontroller/unblur/ in everyone but only want one copy ?

hope this makes sense.

 

Share this post


Link to post
Share on other sites
On 7/2/2019 at 10:41 PM, zer0Kerbal said:

PS - phase one (shared /goo/) working flawlessly. :)

 

This is great!

It's such a useful "stupid PC trick" anyway, but this application of it is perfect.

The game data switcher itself could manage this at some point (hint to the universe) but thank you for trying it out. Will definitely save on some disk space and management of file versions.

Share this post


Link to post
Share on other sites
On 7/4/2019 at 2:52 PM, Beetlecat said:

This is great!

It's such a useful "stupid PC trick" anyway, but this application of it is perfect.

The game data switcher itself could manage this at some point (hint to the universe) but thank you for trying it out. Will definitely save on some disk space and management of file versions.

works perfectly for /goo/ but not for the entire game - because change anything in any copy and will change for all copies. Still, works awesomely for this - and for working on projects so don't have to manually copy from githome and back again. If I feel up to it, might right a forum thread on it - but if somebody beats me to it... I won't complain.

Share this post


Link to post
Share on other sites

Wow. This thing looks amazing. I'm going to download this right instant....... but I have a mac. Is there a mac version of this? If not, are there any alternatives?

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, Yeet_TheDinosaur said:

Is there a mac version of this?

Not that I can see. Porting it to *nix may be possible, but the mention of VB makes me for one utterly disinclined to try.
 

3 hours ago, Yeet_TheDinosaur said:

are there any alternatives?

I don't see any comparable GUI applications, but the core functionality shouldn't be difficult to implement with shell scripts and symlinks or union mounts/fuse etc. The primary function of GDS - making GameData point to some other directory - is fairly trivial to implement with symbolic links.

For reference, my GameData setup looks like this:

steve@perdition ~/KSP_Linux_1.7.3 $ stat -c '%N' GameData*
'GameData' -> 'GameData_Main'
'GameData_Main'
'GameData_Stock'
'GameData_Testing'

steve@perdition ~/KSP_Linux_1.7.3 $ stat -c '%N' GameData/Squad
'GameData/Squad' -> '../GameData_Stock/Squad'

For each new setup I create a link to the stock Squad directory (to save disk space), and to switch between them I simply change the target of the GameData symlink in the game root to point to the GameData_foo I wish to use, this is made more user-friendly by a little bash script.
The same works just as well for saving space used by mods and managing saves, KSP can't tell a symbolic link from a real directory and a symbolic link can point to any other file or directory on the same disk. Hard links are cool too, and can be very useful for making space-efficient backups.

I don't have a mac to play with, and my script is both too ugly and likely too Linux-specific to share. A little reading up on your shell of choice (what does MacOS used these days anyway, bash? zsh?) is all that is required to cook one up though.

Ed. Just for fun, here's a kinda-one-liner to pick between the available GameData_foo directories with a kinda-GUI menu, symlink the selection to GameData, then launch KSP.  :P
Bash, GNU find and KDE dependent, 'cause that's what I got:

ln -srfT $(kdialog --menu "Select GameData to use" $(find . -maxdepth 1 -type d -name "GameData*" -print0 | while read -d $'\0' file; do echo "${file}" "${file#./}"; done)) ./GameData && ./KSP.x86_64

 

I had more, but this post editor is broken.

Edited by steve_v

Share this post


Link to post
Share on other sites

@Beetlecat

found a nice little mklink gui here ( Last Updated July 26 2019, Version 3.9.2.5 )

also - should be using /j (junction) instead of /d

Share this post


Link to post
Share on other sites
Posted (edited)

A question about using this: Does it still run the game via Steam and allow the use of the Steam overlay? 

I have a system of running the game via a RunViaSteam.cmd file that I found on Reddit, but it requires each version of the modded game to have its own folders (whole installation) and then it does a link back to the original steam folder so it keeps everything in tact. I want to use this as it seems a bit neater. 

Just read more of the thread. Guessing there's still not fix to the steamapps problem?

Edited by madindehead

Share this post


Link to post
Share on other sites
Posted (edited)

Consider this: If you provided the ability to choose an arbitrary path for the alternative GameData folders, they could be placed in a RAMdisk. This would make your tool the fastest KSP loader in they universe.

You could even integrate the ramdisk directly into your tool if you implemented something like the tiny tool CacheFolder. That would be awesome.

(Just to be clear: a RAMdisk doesn't make the first game launch faster, only the subsequent ones -- which happens often for people trying out mods)

 

CacheFolder URL : https://www.overclock.net/forum/132-windows/1477527-tool-preload-windows-cache-11.html#/topics/1477527?page=11

 

You really need to investigate symbolic links. Two birds with one stone : 1) a folder path that actually points to another physical location (that arbitrary GameData location in was suggesting) , and 2) that "shared" Goo folder contained in every other GameData, that gets updated everywhere, whenever it's changed in any of its potential locations.

 

And since I feel crazy, one more idea: if your source code acts as an interface between the game and the data, and if you are now in charge of the location and shape of that data (which is read-only), then why not hold it compressed? Get rid of the billion XML files and replace them with binary, zipped resources inside larger blob files? When you notice that the timestamp of the "real" file in GameData has changed, only update this one in your blob. Boom, your loader is now even faster and the ramdisk uses a tiny fraction of ram.

EDIT: Look at this, mate! You won't even have to sweat it: use this as your underlying system for accessing files and manipulating symbolic links. https://dokan-dev.github.io/

The best sample I've found is this one: it mounts zip files as file systems! It directly addresses the compression idea I suggested. https://github.com/antiufo/Shaman.Dokan.Archive:

 

Edited by jeancallisti

Share this post


Link to post
Share on other sites
5 hours ago, jeancallisti said:

RAMdisk

5 hours ago, jeancallisti said:

CacheFolder

5 hours ago, jeancallisti said:

use this as your underlying system for accessing files and manipulating symbolic links

5 hours ago, jeancallisti said:

it mounts zip files as file systems!

LoL, all these third-party tools you Windows users need... ramdisk/tmpfs built into the kernel, any filesystem in userspace via fuse... All right there ready to use on GNU/Linux. :P
All good ideas though, why reinvent the wheel in a standalone application when you can leverage other people's backends. :)

 

5 hours ago, jeancallisti said:

why not hold it compressed?

Again a good idea. Then again, I just run transparent compression globally on my filesystems and forget about it, CPU's are fast and so is LZ4.
 

5 hours ago, jeancallisti said:

You really need to investigate symbolic links.

Indeed. Save space and make manipulating the GameData copies near-instantaneous. Making real copies of everything is kinda wasteful IMO.

 

Share this post


Link to post
Share on other sites
14 hours ago, steve_v said:

. Making real copies of everything is kinda wasteful IMO.

 

Wasteful yes but sometimes you have to be wary of systems that are too smart for their own good -- human mistakes and unnecessary complications ensue.

Share this post


Link to post
Share on other sites
4 hours ago, jeancallisti said:

Wasteful yes but sometimes you have to be wary of systems that are too smart for their own good -- human mistakes and unnecessary complications ensue.

Links aren't "smart", nor are they complicated. They're a basic feature of any remotely modern filesystem, and one that follows quite naturally from the way those filesystems work internally.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.