Jump to content

[WIN] KML - Persistence file editor


Mythos

Recommended Posts

Thanks so much for this tool Mythos!  Like so many others here I had a vessel which refused to undock in my modded 1.9.1 savefile so I:

  • made a quicksave in game with F5;
  • loaded the quicksave into KML;
  • right clicked on the warnings and selected repair docking connection for each one;
  • saved the file from KML as the new quicksave.sfs;
  • loaded the modified quicksave in game with F9 ...

and the problem was resolved!

So so much quicker and easier than editing the save file manually!

Link to comment
Share on other sites

  • 3 weeks later...

Just downloaded your app trying to figure out why fuel crossfeed failed on a mining/refining lander I sent on a complex Duna expedition. Turns out one of my five fuel tanks (one big central tank and four tall ones around it, each external with a docking port) reads as not being attached to the parent part... or to anything else!! This is good to know, but how do I actually fix the save to get things working again? Any advice?

(Yes, I tested a copy of the lander on the ground. No crossfeed issues. Apparently the kraken disapproves of using a double-docking-port system to increase stability on complex ships.)

Link to comment
Share on other sites

On 6/25/2020 at 12:26 AM, RedneckGaijin said:

Just downloaded your app trying to figure out why fuel crossfeed failed on a mining/refining lander I sent on a complex Duna expedition. Turns out one of my five fuel tanks (one big central tank and four tall ones around it, each external with a docking port) reads as not being attached to the parent part... or to anything else!! This is good to know, but how do I actually fix the save to get things working again? Any advice?

(Yes, I tested a copy of the lander on the ground. No crossfeed issues. Apparently the kraken disapproves of using a double-docking-port system to increase stability on complex ships.)

Never mind: I did some tinkering around and figured out where the code I needed to fix was.

Link to comment
Share on other sites

To be clear, I fixed the game save, not the app.

There are two points that had to be fixed: "att" had to be reset from 0 to 1 on the part, and the other was a glitch in the part of the code that defined the parent part. Since the glitched part had symmetry with another part, I copied over the part of the code that was different from the other part. Fixed it right up.

 

Link to comment
Share on other sites

  • 2 weeks later...

Could someone throw me a quick clue on where to start on getting this to run under linux?  I downloaded the source, am fairly familiar with C, C++, but C# is newish to me.  I did grab the mono dev env when I installed the debian awhile back so I think I'm mostly set to give it a go with maybe some other minor downloads.  Really, just some focused clues, I can go from there.  I just don't want to go down a garden path for a week when if I'd asked these questions I could have been going in an hour or less; the unobvious gotchas, that kind of thing.  Thanks in advance :)

Link to comment
Share on other sites

14 minutes ago, darthgently said:

Could someone throw me a quick clue on where to start on getting this to run under linux?  I downloaded the source, am fairly familiar with C, C++, but C# is newish to me.  I did grab the mono dev env when I installed the debian awhile back so I think I'm mostly set to give it a go with maybe some other minor downloads.  Really, just some focused clues, I can go from there.  I just don't want to go down a garden path for a week when if I'd asked these questions I could have been going in an hour or less; the unobvious gotchas, that kind of thing.  Thanks in advance :)

Nice commitment, but the problem is not C# running with mono under Linux. The problem is the GUI using WPF, that is not accessible in Linux. See https://github.com/my-th-os/KML/issues/2. You could write a completely new GUI, though :D Could try this Avalonia thing, if that still exists, or some more old-school wxWidgets.

I still lack the time to do larger changes on KML. Well, it's working. Although I'm sorry for my bad decision excluding Linux users. If I could, before just rebuilding the GUI, I would rather rebuild anything. Time will show, whether some tool like this could be used for KSP and KSP 2 in parallel, having a more modular thing would help with that.

Link to comment
Share on other sites

5 hours ago, Mythos said:

Nice commitment, but the problem is not C# running with mono under Linux. The problem is the GUI using WPF, that is not accessible in Linux. See https://github.com/my-th-os/KML/issues/2. You could write a completely new GUI, though :D Could try this Avalonia thing, if that still exists, or some more old-school wxWidgets.

I still lack the time to do larger changes on KML. Well, it's working. Although I'm sorry for my bad decision excluding Linux users. If I could, before just rebuilding the GUI, I would rather rebuild anything. Time will show, whether some tool like this could be used for KSP and KSP 2 in parallel, having a more modular thing would help with that.

There is a possible middle ground where the focus would be to just get it to the point of running under wine on linux I suppose: https://ccifra.github.io/PortingWPFAppsToLinux/Overview.html  Most linux users are familiar with it as a compromise and while they wouldn't wan't to run KSP under wine, a file editing tool would be perfectly normal use of it.  It will be interesting to see what KSP2 reveals in many regards.  I'm wondering if it will still be hard in 2 for mods to prevent propagation of clicks to windows underneath.  It boggles me that is a problem in a major game in the year 2020; that is like a 1993 kind of problem when even cool techies were still vexed as to whether "gooey" or "Gee You I" was the proper way to say GUI

Link to comment
Share on other sites

8 hours ago, darthgently said:

There is a possible middle ground where the focus would be to just get it to the point of running under wine on linux I suppose: https://ccifra.github.io/PortingWPFAppsToLinux/Overview.html  Most linux users are familiar with it as a compromise and while they wouldn't wan't to run KSP under wine, a file editing tool would be perfectly normal use of it. 

The guide states, that it would be good to port to .NET Core first. I have no personal experience with wine, but I thought it is used to run any Windows app in Linux. So what exactly happens if you run KML in wine? Does it just work or does it need some adjustments?

Link to comment
Share on other sites

On 7/16/2020 at 4:55 AM, Mythos said:

The guide states, that it would be good to port to .NET Core first. I have no personal experience with wine, but I thought it is used to run any Windows app in Linux. So what exactly happens if you run KML in wine? Does it just work or does it need some adjustments?

I have yet to get wine going on this build but I could give it a shot in the next week or so and report back

Link to comment
Share on other sites

I'm curious what the top use cases are for a persistence/craft file editor are for different KSP players.  I know what my top goals are:

.craft file editing:

1. Ability to remove (maybe even upgrade to newer similar part in same step) obsolete parts, en masse with a few clicks.

2. Remove parts that are causing exceptions or errors, perhaps replacing them with procedural structural elements and healing all attachments affected with the stub as a placeholder.  Or maybe just removing the modules from the parts that are specifically causing the problem (for me lately it is RemoteTech AYA stuff)

3. Duplicate contents of one full KIS container on a vessel to multiple empty containers on the vessel without having to drag and drop each item into each container in the editor

4. Tuning RCS placement and angle algorithmically in the file outside of the game rather than in the editor

5. More convenient editing of Action Groups

6. Finding and dealing with those "lost" parts buried in the clipverse under the skin of craft

7. Audit a craft for what parts and mods it relies upon.  So one can know the impact of removing a particular mod

8. Audit a craft for part clipping/overlap issues

9. Audit a craft for weak joints relative to forces from engines, drag, and torque

10. Re-establish symmetry for parts that have been removed from symmetry for one reason or another

11. Select a set of parts based on a regular expression of part names, nameTags, ... and then apply any number of operations: tweakscale, thrust/yaw/pitch/roll/translate toggles,  autostrut on/off, etc to all at once

.sfs file editing:

1. Countering the Kraken.  I think it is fair play to set the SMA of your Dres satellites by hand in the sfs when after hours of doing things by the book, during your last satellite deployment in the system, it, and your deploying ship, gets nuked by the Kraken simply because it got annoyed by time warp (the errors and exceptions in the log were all from Farram Aerospace and the satellite, in space around Dres, was rattling and shaking like it was descending through atmo to the surface of Eve (ship effects mod), then it exploded, so yeah, big problem there, but not my problem).  When KSP and mods play by the rules, so will I.  I only do sandbox anyway until I get a combo of KSP and mod versions that is mostly stable and predictable; which hasn't happened for me yet

2. I don't have a 2 for .sfs  I am mostly concerned with .craft file editing at this time.  But I'm thinking of diving into this aspect of the KSP code support community and maybe trying to help out with some mods so am wondering what the main reasons are that people want to edit these files are as I'm sure they aren't exactly the same as mine.  There are too many possibilities to cover all, so I want to focus on what is useful

Link to comment
Share on other sites

  • 2 weeks later...
On 7/19/2020 at 4:50 PM, darthgently said:

I'm curious what the top use cases are for a persistence/craft file editor are for different KSP players

My use cases would be Countering the Kraken and things like removing a rescue contract Kerbal from a pod without a hatch (when I forget to install Rescue Pod Validator on a new install).

Link to comment
Share on other sites

  • 3 months later...
3 hours ago, XCaligulaX said:

Maybe I'm a fool, but I downloaded the zip today and KML.exe is not included in the file.  Is this an oversight or did I miss something?

This is the link to the GitHub releases: https://github.com/my-th-os/KML/releases 

This is directly to the latest one: https://github.com/my-th-os/KML/releases/download/v0.8.2/KML_v0.8.2.zip

Maybe you clicked on the "preview build" link in the OP? There is currently no one, so this should lead to a 404 page.

I hope its not false positive from some virus scanner again?

Actually the KML.exe is the only file in that zip. So is a zip without any file a thing? :confused:

If you have other files, you probably downloaded the source code.

Link to comment
Share on other sites

  • 4 weeks later...

Hi, I'm having an issue in my ship where undocking isn't working, and I'm trying to use KML to fix the problem. KML recognizes that there are problems in the persistant.sfs, but when I try to correct the issue with "Repair docking connection of this and connected part" I get:

Quote

VESSEL (GillyLander25, Ship, ORBITING) -> PART [90] (smallClaw): Grappled (same vessel):
Couldn't reset docking node, there are sub-nodes missing.
You should copy a MODULE node from a functional state 'Ready' part.


VESSEL (GillyLander25, Ship, ORBITING) -> PART [36] (mk2DockingPort): Ready:
Dock part is docked to parent dock part. Docking state should be 'Docked (docker)' or 'Docked (dockee)' but is 'Ready', parent dock: PART [35] (smallClaw): Ready

VESSEL (GillyLander25, Ship, ORBITING) -> PART [35] (smallClaw): Ready:
Dock part is parent of other dock part. Docking state should be 'Docked (dockee)' or 'Docked (docker)' but is 'Ready', other dock: PART [36] (mk2DockingPort): Ready

VESSEL (GillyLander25, Ship, ORBITING) -> PART [90] (smallClaw): Grappled (same vessel):
Grappling part grappled attached part. Docking state should be 'Grappled' but is 'Grappled (same vessel), attached part: PART [89] (dockingPort2): Ready

VESSEL (GillyLander25, Ship, ORBITING) -> PART [90] (smallClaw): Grappled (same vessel):
Grappling part grappled attached part. Docking state should be 'Grappled' but is 'Grappled (same vessel), attached part: PART [89] (dockingPort2): Ready

I'm not sure why KML is struggling with this one as it seems its solved other peoples' problems. I get this problem in two places on the vessel (two ships docked to the station with claws).  The phrasing of "You should copy a MODULE node from a functional state 'Ready' part." isn't very clear to me (first time using KML), as I've tried copying and pasting in the tree viewer to replace part 36, but it just created a new part (47) and I wasn't able to delete part 36 to replace it.

I'm happy to share my save file, as this seems like it might be a corner case, but I'm not sure the protocol for sharing on these forums as this is my first post. Thank you for your efforts on this tool, as docking problems have been happening to me for quite some time now.

Link to comment
Share on other sites

Hello and welcome to the forums. Sadly (that those bugs still exist) it's often problems like yours, that motivate people to join in ;)

9 minutes ago, cjl4hd said:

when I try to correct the issue with "Repair docking connection of this and connected part" I get: ...

Concentrate on the first entry in the response. The others just repeat, what else has been there before.

14 minutes ago, cjl4hd said:

two ships docked to the station with claws

There is a bit of an oddity going on with claws, try to avoid such solutions if possible. Also bad or even worse is this "same vessel docking", having more than one port from the same ship to the same station (or other ship) connected. And maybe you have simultaneous claw attachment going on? Or being clawed and also docked? Both might even be the worst.

19 minutes ago, cjl4hd said:

The phrasing of "You should copy a MODULE node from a functional state 'Ready' part." isn't very clear to me (first time using KML), as I've tried copying and pasting in the tree viewer to replace part 36, but it just created a new part (47) and I wasn't able to delete part 36 to replace it.

Well, if you look in the tree there is a child node to the part, that is called "MODULE". Or maybe there isn't, that might be the problem causing such a message. But have a look at a functioning claw or docking port. If you don't have one, build one, put it one the launch pad, save, and then load that state into KML. And then the idea of repair is to copy that "MODULE" node only, not the part. After having a module node under the broken claw/port, you should probably save and reload in KML, and then fix again. 

Those module nodes contain the information what the docked/grappled ship is called, what its root node is, what part it is attached to and so on. If that somehow got lost, you might end up with a generic name and root part being reassigned, when it finally does undock in-game.

30 minutes ago, cjl4hd said:

I'm happy to share my save file, as this seems like it might be a corner case, but I'm not sure the protocol for sharing on these forums as this is my first post. Thank you for your efforts on this tool, as docking problems have been happening to me for quite some time now.

Just upload your savefile somewhere and drop a link here. I might have a look tomorrow.

Link to comment
Share on other sites

Quote

Well, if you look in the tree there is a child node to the part, that is called "MODULE". Or maybe there isn't, that might be the problem causing such a message. But have a look at a functioning claw or docking port. If you don't have one, build one, put it one the launch pad, save, and then load that state into KML. And then the idea of repair is to copy that "MODULE" node only, not the part. After having a module node under the broken claw/port, you should probably save and reload in KML, and then fix again. 

This solved my problem! Thanks for the explanation! Copied the child module from another parent part. For some reason that didn't click for me until I read this. Awesome tool!

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
43 minutes ago, LUCINNDA said:

Hi. I need some help that help me to work with KLM. I dont undestand the "Atribute" abbreviations like: hgt, nrm, rot, CoM, stg... etc. Are there any guide about it?

Well, that's a general question of how does KSP store its data. There are lots of attributes, and what they mean mostly depends on the node type they are in. There is a set of attributes, that describe a part, and a different set of attributes to describe a vessel, a kerbal, a contract etc.

Often you can guess the abbreviations when you know the details of KSP. "rot" probably describes by a vector, in what orientation / rotation a part is mounted to it's parent, or in which general direction a vessel is currently looking. "CoM" is center of mass.

If you see something that you seem to understand, then change it to you liking (name of a kerbal, amount of ressource for some cheating, change path to flag for each individual part, ...). But you really should not mess around with those randomly, only when you have an idea what it is about :)

After all KML is just a wrapped text editor, and there can appear any string you like. You can even add your own attributes, but I have seen that KSP drops anything that doesn't belong there when it loads and later saves such a file.

The KSP API documentation is also not very helpful about this. Here for example a vessel: Kerbal Space Program: ProtoVessel Class Reference

Edited by Mythos
example KSP API doc
Link to comment
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.

×
×
  • Create New...