Jump to content

Facility to Merge Saves


Recommended Posts

On several occasions I would have found it handy to be able to transfer or copy a flight or flights from one save to another.  I know I can build a ship and copy the craft file into another save easily enough, but that's not what I'm suggesting.

Example... Say I have 2 saves, one save where I was experimenting for fun and finished up with (among a lot of other stuff) a pretty cool mining operation and refueling station around Minmus, and another save for my Jool expedition, for which I have several probes already in the Jool system.  I realise that my Jool mission could take advantage of my Minmus refueling station, but it can't because it exists in an alternate reality.  If i could copy the Minmus stuff into the Jool save (or vice-versa) then I could avoid needing to duplicate a lot of work I'd already done.

Ok...   IRL space agencies, like NASA, have lots of different missions and flights on the go at any one time, some may be related to some others and some not.  But say NASA decided (or was ordered) to re-purpose one of its cluster of weather satellites for 'other purposes'? Easy, after filling in the relevant documentation, they just hand over control to the guy in the secret 'other purposes office'.  Now in KSP I can't do that, because the 'other purposes office' is effectively in a different dimension.

So. A way to copy individual flights to other saves and/or merge two saves into one could be quite handy in circumstances like this.  Obviously, there would need to be some 'rules' that deal with time differences etc as no two saves will be at the same point in time, but is it a viable option and does anyone else think it could be useful?

Link to comment
Share on other sites

There's no "easy" facility as such, but you can move active ships from one save to another by editing the save file (persistent.sfs).

Open persistent.sfs and find the "FLIGHTSTATE" line, beneath which there will be the version number and the UT (time) of the current save.

After that information look for "VESSEL". Between the bracket following that and the corresponding closing bracket (indentation aligns, so it's easy enough to see where the block ends) is the information about an active vessel, including flight data and the part data and its corresponding action groups and modules. Copy that entire block from VESSEL { until the closing bracket into any other KSP save and your ship will (or should, mishaps permitting) be exactly where it was in the other save.

Just be aware that a saved ship from the persistent file is...er...quite long. The Orbiter from the Orbiting 101 tutorial scenario, for example, is just over 4500 lines.

Link to comment
Share on other sites

53 minutes ago, nikokespprfan said:

So you want to port your minmus station, with orbital characteristics and all, to another save?

Actually no, that was just an example of the type of thing it could be used for.  But I have had a few cases, with smaller probes, and flags, where it would have been handy to be able to do it.

I do realize that its not a trivial task, and that all the orbital info etc would need to be copied across somehow.  I wouldn't expect it to work out the exact position the ship would be in at the 'new' time, but put it in it's current position and inclination etc relative to the body it is orbiting.  I guess it could be easier for stuff that is landed, but still a fair bit of data.

I'm thinking along the lines of - copy it from one save and 'hyperedit' in to a new one, by maybe selecting it in the tracking station select the 'copy to hyperspace (or whatever)' option then opening a new save and paste in to into the tracking station there.  Rather than the inherently risky 'mucking about with the persistent file' option.

This is very much a 'that may be useful, is it feasible?' semi-hypothethical suggestion, to maybe open up a discussion, rather than being a full on request.

And thanks for the replies and suggestions, very much appreciated.

Cheers

Link to comment
Share on other sites

This actually wouldn't (shouldn't) be that hard to do at all. Just save the current vessel and its orbital parameters to a file, then load that up as a new vessel in the other save. Should be extremely simple, the hardest part would be providing an interface for it (I like the idea of just adding a button to the tracking station to "export" a vessel and another to "import" one). Handling where the vessel would be in time is already done by KSP: the orbital parameters give the orbit and the current location in the orbit is computed based on the current time (the joys of KSP's patched conics model, it's only a 1.5 body problem and is solved exactly).

There might be issues with Kerbals, so they might have to not be transferred over. There would also be issues if somehow you had different part mods (like you export the craft, then remove a mod and reload KSP, then import that craft). Both issues could be solved without too much trouble I think.

 

I can likely do this as a modlet, either tonight or tomorrow depending on how busy I am.

 

Edit: Alright, I went and made a mod for this. It works best without transferring kerbals too but is capable of it. If you try to load a craft with invalid parts it warns you and prevents loading the ship. Hopefully it works as well (or better) than you wanted!

Edited by magico13
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...