Jump to content

Editing persistent.sfs for fun, profit and lag reduction


Recommended Posts

Hello,

After flailing about trying to edit persistent.sfs and generally making a mess of things I figured I'd write a quick how-to guide so that others might learn from my mistakes. We'll cover how to edit it without wrecking it, changing crew names, resurrecting dead crew, clearing bugged parts, clearing orbital junk and naming the stuff in orbit.

First off, get yourself a text editor that won't screw up your persistent.sfs file. DO NOT USE WORDPAD. It will change all the EOL characters from Unix to Windows and KSP won't be able to load it. I used a free program called 'Notepad ++'.

If you've already loaded it into wordpad and wrecked it, then you need to get Notepad++ and load your persistent.sfs file and then go to Edit ->; EOL Conversion and select 'Unix'. Save, and things should be fixed.

I haven't tried it yet, but you probably shouldn't edit persistent.sfs while KSP is running.

First off - renaming crew. Once you've got your persistent.sfs loaded into your text editor of choice the first thing you'll probably notice are your crew. Each one has a name, some stats and a state. Changing a name simply requires typing a new one after 'Name = '. Keep in mind that Jeb, Bob and Bill get their orange jumpsuits because of their name. If you change Bob Kerman and Bill Kerman to say, Douglas Turbo and Vincent Carducci, then they'll be put into New Guy Silver.

Now, if you've been playing the game properly, you've probably killed a few of them. Resurrection is as simple as changing their state from 3 (dead) to 0 (alive). State 1 is used for Kerbalnauts in orbit and I haven't figured out what state 2 is yet. You should also change the ToD (Time of Death) to 0.

Below the crew are a series of entries marked 'VESSEL'. These are all your various spacecraft and random orbital detritus. If you are deleting a VESSEL entry you need to make sure that you get everything from 'VESSEL {' down to the closing '}', which will be the line above the next VESSEL entry.

Clearing bugged parts. Several folks have been complaining about excessive lag that is only cured by deleting your persistent.sfs file. You may have also noticed parts on the tracking screen that appear to have landed, but don't get cleared away. There's a cure for this. Load up your persistent.sfs and search for 'NaN'. Basically that means that whatever value that is is bugged and causing problems. So if you find a bunch of debris that has 'NaN' for it's various data values then you should delete it.

Clearing orbital debris. Much like the above, but you need to be a little more careful about what you're deleting. The first entry in each VESSEL is it's name. Most of it will be things like 'Porkchop Express Debris'. These are the various rocket parts that you've left in orbit. After the name, there will be a series of PART entries that let you know what each piece of debris is made of. Unfortunately, everything separated from your rocket is labeled as 'Debris', so if you've been launching satellites you'll need to be careful to differentiate between 'Debris' that is random boosters and fuel tanks and 'Debris' that is actually your Eye of Kerberus spy satellite. You can usually get a good idea of what's what by checking the various part entries. Once you've found those two dozen pieces of fairing you left in orbit you can simply delete their entire VESSEL entry to get rid of them. It's not keeping it real, but it's certainly easier than trying to match orbits with each of them and de-orbit them manually and maybe you just want to have fun with rockets instead of having to play Planetes: The Game.

Now, speaking of the Eye of Kerberus, you carefully launched your satellite into a nice polar orbit and tracking keeps referring to it as 'Porkchop Express Debris'. By simply changing the 'name = ' entry under VESSEL you can give your satellites proper names. Do Not Change the 'name = ' entries under parts, that tells the game what the vessel is made of, not what it should be called on the tracking screen.

For further study:

What is crew state 2? What is ToD?

Edited by Unistrut
Fixing /'
Link to comment
Share on other sites

You can modify the .sfs file while in the VAB or space center with no problems (or at least you could in .14), I haven\'t tried while looking at a ship or in the tracking station yet though.

Link to comment
Share on other sites

Could state '2' refer to Kerbals who are in a ship that has landed? I know I've seen it mentioned that the game differentiates for vessels.

Okay, I finally had some time to play and state 2 is not for Kerbalnauts who are in a splashed vessel. Next stop: the mun!

Edit: Okay. State 2 does not stand for 'trapped on the moon due to a botched landing'. As persistent.sfs does not seem to realize that they are probably doomed and merely records their vessel as LANDED, it probably doesn't stand for a kerbalnaut in a landed vessel either.

Edited by Unistrut
fixing /'
Link to comment
Share on other sites

We know that Jeb and the Bs get recycled if they die or end a mission;

Could 2 be a special 'oops Jeb died' flag or something so they can be flagged for recycling? Or perhaps a state of \'cooldown\' on them where they won\'t be used.

Link to comment
Share on other sites

Guest GroundHOG-2010

Okay, I finally had some time to play and state 2 is not for Kerbalnauts who are in a splashed vessel. Next stop: the mun!

Edit: Okay. State 2 does not stand for 'trapped on the moon due to a botched landing'. As persistent.sfs does not seem to realize that they are probably doomed and merely records their vessel as LANDED, it probably doesn\'t stand for a kerbalnaut in a landed vessel either.

Try sub orbital.

Link to comment
Share on other sites

Eye of Kerberus spy satellite

This made me LOL.

Oh yeah, gold nugget of a post, too. Extra-large thanks!

By the way, I\'ve somehow gotten away with editing persistent.sfs in WordPad all this time. I didn\'t know about the Unix EOL thing until now. But I\'ve only made a few deletions. So I wonder if it\'s EOL characters that are typed into WordPad that don\'t work properly?

I also edited a .craft file once. It was hard, but the only way to build the ship a certain way. The hack worked! But the ship design failed in its own right.

Link to comment
Share on other sites

By the way, I\'ve somehow gotten away with editing persistent.sfs in WordPad all this time. I didn\'t know about the Unix EOL thing until now. But I\'ve only made a few deletions. So I wonder if it\'s EOL characters that are typed into WordPad that don\'t work properly?

I didn\'t think I had added any EOLs to my file, but who knows, hitting 'Return' is an instinctive enough action that I may have done it without noticing. Are there different versions of Wordpad?

Sorry I haven\'t been doing much further research, things have been busy around work and home for the last two weeks. Glad to hear this post has been helpful!

Link to comment
Share on other sites

I just opened a .craft in Notepad. Love the warning: \'do not edit this file by hand. There are no cheating opportunities here. Go away.\'

What did you achieve in particular by editing the .craft file?

It\'s been a while, so I don\'t quite recall anymore. The gist of it was to reattach the bottom fuel tank and engine of the center stack. There were six stacks connected directly to the side of the top center tank. I wanted fuel hoses to feed the center stack from the longer radial ones. The only way to connect them was to disconnect the center stack in the middle, look up from the floor to connect the hoses, then reconnect the center stack.

Unfortunately, there is no way to make that last connection. So I put it on the bottom of one engine, and then hacked the X-Y-Z location, connection, and linkage to put it in the right place.

To figure out the Z coordinate, I first found the length of a fuel tank and then added that figure to the Z coordinate of the one I wanted to attach to. Somehow I did the math wrong on the first attempt; the poor thing had two overlapping fuel tanks and would immediately explode on the launch pad. Once I fixed the overlap, the thing actually did fly. But it sucked in more mundane ways. I\'ll see if I can find the .craft file.

Link to comment
Share on other sites

Hi guys,

have anyone figured out what\'s with kerbalnauts\' bravery? It seems not working yet ... I\'ve tried to put in values ranging from almost zero to 9999999 and my Bruce Dickinson \m/. :D seems to be the same coward (sorry real Bruce) all the time.

Any findings or suggestions ?

Link to comment
Share on other sites

You can also recover individual ships that you accidentally ended, provided you have any backups or previous versions of your Persistent file that has the specific Vessel saved in it.

All you need to do is open the backup or previous version (Found by right clicking > Restore Previous Versions on Win7) and finding your Vessel using Ctrl+F. Each vessel is saved in the form of text after the word VESSEL, followed by it\'s name. Search the backup for the Vessel you are trying to recover.

When you find this Vessel, copy it from the first V in the word VESSEL all the way to the last } before the next VESSEL. Then simply paste it in your current persistent file like you saw it in the backup and voila! Good as new.

You could also use this method to share specific vessels already in-orbit with other players!

Link to comment
Share on other sites

I didn\'t think I had added any EOLs to my file, but who knows, hitting 'Return' is an instinctive enough action that I may have done it without noticing. Are there different versions of Wordpad?

Sorry I haven\'t been doing much further research, things have been busy around work and home for the last two weeks. Glad to hear this post has been helpful!

Well now it doesn\'t work anymore. All I did was change the name of a ship, and now the sky is completely clean. :\'( It\'s happened twice in a row. I did not type the enter key, but it broke down anyway. So maybe it is the Unix EOL thing, like you said. Fortunately, I can still restore a backup copy of persistent.sfs, if I have one.

Link to comment
Share on other sites

  • 2 weeks later...

Can you RESET you Persistent file??? That\'s what I like to know!

Is that possible? To start with a clean one?

My best regards, Kodiak.

You just delete the persistent file, and the game will generate a clean one on next start.

Link to comment
Share on other sites

So I\'ve decided to mod some parts and make a friction-less orbiter. (See this thread for why I would want to.) I\'m using Tosh\'s cart mod, and R4mon\'s MechJeb and Muon scanner, otherwise only stock parts: half fuel tanks, LFE3s, struts, hoses, parachutes. I don\'t know why, but the thing seems to have more friction than normal, and is difficult to control if airspeed is greater than terminal velocity.

Has anyone made a frictionless craft for atmospheric orbital use? Any suggestions?

Link to comment
Share on other sites

Has anyone made a frictionless craft for atmospheric orbital use? Any suggestions?

I\'ve done this, in a much earlier version of KSP, but I don\'t think the drag physics has changed. I just set all the drag values in all the relevant part.cfg files to 0.

Link to comment
Share on other sites

I\'ve done this, in a much earlier version of KSP, but I don\'t think the drag physics has changed. I just set all the drag values in all the relevant part.cfg files to 0.

That\'s what I did. I made copies of the parts first, and made these changes:

maximum_drag = 0
minimum_drag = 0
angularDrag = 0

...but for some reason, the thing seems to have more drag now than the stock parts. Could it have something to do with the mod parts?

Link to comment
Share on other sites

Check to make sure that when you make copies of the part, you not only put it in a new folder (obviously), but you also (not so obviously) change the name of the part (in its cfg file) to something different. For example, the normal liquid engine is just called liquidEngine. This is defined not by the folder name (although the folder is named that to avoid needless confusion) but by the name value in the cfg file.

Link to comment
Share on other sites

Check to make sure that when you make copies of the part, you not only put it in a new folder (obviously), but you also (not so obviously) change the name of the part (in its cfg file) to something different. For example, the normal liquid engine is just called liquidEngine. This is defined not by the folder name (although the folder is named that to avoid needless confusion) but by the name value in the cfg file.

I think this was one of my problems; I had forgotten to change the name on one of the parts. The other problems were likely related to the late hour at which I had done the changes. ;) After starting over with fresh copies of the parts, everything works properly now, and I have a detector in 24km orbit.

The detector doesn\'t like the name change, though. The new part appears in the VAB greyed out, with a note that it is not supported. I figure this is because the name is referenced in the mumech.dll somewhere. Not wanting to mess with that, I just altered the main part.

Link to comment
Share on other sites

Ah. Change the name, and not the module. The module type is what the game uses to determine whether the part is compatible. That is the \'part type\'. If it isn\'t a known type, you can\'t use it. Make sure that value stays the same as the original part. For example, with the liquid engine, you want to change this line:

name = liquidEngine

but NOT this one:

module = LiquidEngine

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...