Jump to content

Help removing a bugged strut via the persistance file


Recommended Posts

Hey guys,

I'm still running 0.90.0 but I'm hoping someone can help me out here. I've got a ship with a strut connector that's hanging off into the middle of nowhere. Might be a leftover from the original build, might be a problem with the undocking, but it's causing me all sorts of havoc.

What I'm hoping is instead of being handed a fish, someone can help me learn to do it... because the other ship (mirrored) has similar issues.

I'm in the persistence.sfs (backup copy made) and I can find the strut connector part. The problem is I only understand maybe a third of what I'm looking at in here. Am I looking for a strut that's srfAttach = Parent? Can anyone help me out with what I need to locate in here? There are other struts on the craft I do need to keep, so I can't just rip them all off.

Link to comment
Share on other sites

It's at Duna and is one of my main research vessels I just arrived with. It's worth the risk to me to try to keep coherency in my Let's Play. If the choice is detonate the ship, or try to fix it and if it fails miserably then detonate the ship, I'm willing to put in the effort for the latter option.

Link to comment
Share on other sites

Editing a craft in a persistence file by hand is difficult at best. The problem comes from the way that parts are organized in the sfs file. The entire ship is just a list of parts with relationships identified by their placement in that list. The first is part 0, second is 1, and so on. Each part, except for the first, has a parent object to which it is connected (the first has itself as a parent.)

First - if your ship is very large and has lots of parts, you may be out of luck as far as manual editing of the sfs file goes. Someone may have come up with a program to help do it in flight, but by hand it's just not going to happen.

The first challenge is identifying the problem part:

You would identify it by what it is (or is not) connected to. Struts are unusual in that their parent is the object that their second connection touches. If your vessel is relatively simple (i.e. few remaining parts) you can search through it for all of the struts and look for one that is attached in the way that your problem strut is. Your strut also might have some crazy number as its parent. Any properly placed strut is going to have parent = (some number) and srfN = srfAttach, (same number as parent).

If none of the struts is obviously broken, you can see which parts are correctly connected by struts, find them in the list of parts, and identify the problem strut by process of elimination.

The second challenge is removing the problem part:

It may be that you get lucky and can simply delete the offending strut. If it happens to be near the bottom of the list in the vessel and none of the parts after it are connected, you can just delete it and all of the parts after that will be renumbered without effect. If there are connections among those parts though, you will have to identify their part numbers (by counting, one at a time, part by part through the vessel) and rebuild the ship's connections by hand. You'll need to change parent numbers and attachment numbers for any affected parts. It's a pain for a small ship and absolutely brutal for a large ship (honestly, you'll mess up and it just won't work if there are dozens of parts involved, save your time.)

A much easier solution that may or may not suit your needs is to replace the offending strut with another part. Build a vessel with the same root object as in this ship (whatever the very first part in the vessel is.) Place a small object in an out of the way spot on its surface (like a thermometer) and launch it. Copy the entire PART section of the thermometer from that vessel and paste it over the entire PART section of the problem strut. Problem solved.

Edited by Jason Patterson
Link to comment
Share on other sites

Editing a craft in a persistence file by hand is difficult at best. The problem comes from the way that parts are organized in the sfs file. The entire ship is just a list of parts with relationships identified by their placement in that list. The first is part 0, second is 1, and so on. Each part, except for the first, has a parent object to which it is connected (the first has itself as a parent.)

Well, that answers one of my major questions I was having trouble deciphering. For this alone, thank you. The rest, thank you a LOT. :)

The first challenge is identifying the problem part:

You would identify it by what it is (or is not) connected to. Struts are unusual in that their parent is the object that their second connection touches. If your vessel is relatively simple (i.e. few remaining parts) you can search through it for all of the struts and look for one that is attached in the way that your problem strut is. Your strut also might have some crazy number as its parent. Any properly placed strut is going to have parent = (some number) and srfN = srfAttach, (same number as parent).

If none of the struts is obviously broken, you can see which parts are correctly connected by struts, find them in the list of parts, and identify the problem strut by process of elimination.

None of them are obviously broken unfortunately.

The second challenge is removing the problem part:

It may be that you get lucky and can simply delete the offending strut. If it happens to be near the bottom of the list in the vessel and none of the parts after it are connected, you can just delete it and all of the parts after that will be renumbered without effect. If there are connections among those parts though, you will have to identify their part numbers (by counting, one at a time, part by part through the vessel) and rebuild the ship's connections by hand. You'll need to change parent numbers and attachment numbers for any affected parts. It's a pain for a small ship and absolutely brutal for a large ship (honestly, you'll mess up and it just won't work if there are dozens of parts involved, save your time.)

I was afraid you'd say this. I have a feeling I'm going to have to bring it into a different save file just to locate the problem part.

A much easier solution that may or may not suit your needs is to replace the offending strut with another part. Build a vessel with the same root object as in this ship (whatever the very first part in the vessel is.) Place a small object in an out of the way spot on its surface (like a thermometer) and launch it. Copy the entire PART section of the thermometer from that vessel and paste it over the entire PART section of the problem strut. Problem solved.

Makes perfect sense.

Thank you VERY much for this. You've given me enough to be able to root out the problem at least, and enough insight into how it's built to try to figure myself out.

Link to comment
Share on other sites

First - if your ship is very large and has lots of parts, you may be out of luck as far as manual editing of the sfs file goes. Someone may have come up with a program to help do it in flight, but by hand it's just not going to happen.

... I had REALLY hoped you were exaggerating on this. I've got backups of the persistence file, but... yeah. Wow. Even part swaps are causing significant structural failures. I'm not ready to give up but I'm finally understanding why there's no good information on hacking this file out there other than for one-off values. There's no good way TO hack this file.

I think I'm going to have to start at the beginning. One object, determine what the settings mean (cid, uid, mid, istg, sgor, etc). Ho boy.

Link to comment
Share on other sites

... I had REALLY hoped you were exaggerating on this. I've got backups of the persistence file, but... yeah. Wow. Even part swaps are causing significant structural failures. I'm not ready to give up but I'm finally understanding why there's no good information on hacking this file out there other than for one-off values. There's no good way TO hack this file.

I think I'm going to have to start at the beginning. One object, determine what the settings mean (cid, uid, mid, istg, sgor, etc). Ho boy.

It's horrible, isn't it? I'm surprised that a part swap is giving you issues though - typically if a part like a strut is replaced by another part at the same location in the save file, you'll lose the strut but it won't cause everything to go to pieces... If you'd like to post a copy of your save file I can try to have a look at it. I don't know whether I'd have any better luck than you have, honestly.

Ooooh, completely different option C here:

Replace the entire vessel with a duplicate. I know you're working on a Let's Play with this save, so I can only assume you want to be honest with your save as much as is possible. Go through and record fuel, RCS, and oxidizer amounts in the tanks, and the identity of the crew in the vessel, then build a brand new copy of your ship and launch it. You shouldn't have to actually fly it, but make sure it's not clamped to the ground. To make your life easier, fill only the seats in the new vessel that are occupied in your broken vessel. Save the game and go into the sfs file. Find the new vessel and copy all of it from its first PART to the last brace of the last PART. Paste this over the corresponding section of the broken vessel. Do not delete the new vessel yet. Don't mess with either vessel's flight state information or ORBIT information at all. You would then go through and edit the new vessel's crew identities to match the original (Find all of the Kerman's and change their first names, basically.) Edit any fuel tanks to the correct amounts. At this point you should be able to load the game, end the new mission normally, and your existing mission should function as intended.

ETA: Or better, because I wasn't thinking clearly, build the new ship in a completely separate savegame, then it won't mess up your hiring/firing in your Let's Play. You'll still have to edit in the correct crew, of course.

Edited by Jason Patterson
Link to comment
Share on other sites

Following along with the idea of replacing the vessel, I pushed the vehicle into a unique save and located the problem struts. By hand. It was annoying. Also reset all the parents.

However, I've come to a very interesting result from that. The RCS and SAS control groups no longer function. Their values don't make sense to me offhand in the final section of the vessel info. Does anyone know if there's a reference for the control group values?

In particular, I'm trying to figure out what these values mean/do:

ACTIONGROUPS

{

Stage = False, 4902501.15629362

Gear = True, 0

Light = False, 0

RCS = True, 9874925.55323911

SAS = True, 4901838.39952709

Edit:

I am relatively sure these are timestamps, after exploring a new session. I shall expore that idea.

Edit2: Hah hah! Yes, they are timestamps as to the time of activation and their state. It's done in # of seconds for the game length. If your timestamp is after the current gamelength (IE: you transported an old ship into a new file) you won't be able to adjust the state of the actiongroup.

one more oddity down. :)

Edited by WanderingKid
Link to comment
Share on other sites

Jason, wanted to thank you again for your help in this. You gave me enough information and ideas to resolve that I was able to eventually work out a solution and save a portion of my Let's Play. I won't say I flew them well after fixing them, but that's a WHOLE different problem. :blush:

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...