Jump to content

[WIN] Plan-o-Tron = Mod Manager, Mission Preparation


Recommended Posts

Plan-o-Tron is my attempt to avoid KSP program crashes when I try to launch with too many mods installed.

Plan-o-Tron analyzes your persistent file, your list of mods (put them all in a separate directory), and what ships you intend to use. It will then install only the parts necessary to fly your mission and launch KSP for you.

You may select several ships as well as additional mod parts (ie, so you can build new ships and add to existing ones).

In addition, you can have the Plan-o-Tron remove persistent objects selectively, so you can get rid of annoying space junk whilst keeping the good stuff flying.

It's a Windows GUI program, your KSP data will not be touched until you hit the \'Launch\' button. Nevertheless, please back up your KSP directory just in case something goes wrong.

Version History:

v1.0: First Release

v1.1: 'Flying' persistent objects weren't recognized properly

v1.2: Internal version, not released due to my being distracted by KSP .16

v1.3: 'Splashed' persistent objects weren't recognized properly

v1.4: Updated to handle KSP .17 user saves location

Download:

v1.0: https://www.dropbox.com/sh/wwvkedyd3mbb7fz/77EMExIG5q/Plan-o-Tron%20v1.0.zip

v1.1: https://www.dropbox.com/sh/wwvkedyd3mbb7fz/0j3AwgBw86/Plan-o-Tron%20v1.1.zip

v1.3: https://www.dropbox.com/s/qi7hpl4x0epsl3v/Plan-o-Tron%20v1.3.zip

v1.4: https://www.dropbox.com/s/xvvt8rfixh00hp7/Plan-o-Tron%20v1.4.zip

Source Download:

v1.1: https://www.dropbox.com/sh/wwvkedyd3mbb7fz/XWrrkLu5RK/Plan-o-Tron%20Source%20v1.1.zip

v1.3: https://www.dropbox.com/s/0khqntia595xgjh/Plan-o-Tron%20Source%20v1.3.zip

v1.4: https://www.dropbox.com/s/sh385z6vna247sh/Plan-o-Tron%20Source%20v1.4.zip

Edited by bernierm
Updates to KSP .17
Link to comment
Share on other sites

Another one?

I started this one a few weeks ago, before the others started appearing. I was getting tired of continually shuffling mods just to avoid pre-launch crashes.

If I knew, I would have focused my efforts on other burning questions, such as \'why are there no female kerbonauts?\'

Let\'s hope they\'ll all be unnecessary in the next KSP release.

Link to comment
Share on other sites

Well just as long as we keep working together. The plan is that all mod managers will be able to handle mod packs (probably in *.KSPMM format) from all other mod managers. Just keep an eye on the other threads and I\'ll also let you know what we discuss via skype too. I actually thought my one was the first one that appeared. For mod management anyway. May 8th.

Link to comment
Share on other sites

What I love about this mod manager is that it allows me to launch KSP with only the exact parts I need for current ship and ships in orbit. Perhaps I\'m mistaken, but no other mod managers let me do that. It\'s something I did manually for a while, but it took too much time / energy, so I quit bothering and now play almost 100% stock, with some parts I never use deleted.

Link to comment
Share on other sites

  • 4 weeks later...

I couldn't launch KSP from Plan-o-Tron at first, but after messing with the mod files (dragging them from the KSP_win\mods\*mod folder*\parts to KSP_win\parts and back it suddenly started working. Also, I backed up and deleted my persistent file.

Now it's great help when building specific spacecraft and sending them on missions.

Thanks, I needed this one :)

Link to comment
Share on other sites

Nice work -- just what I was looking for, thanks! I was thinking of programming something just like this until I found yours.

However, there are a few issues to address: Most importantly, you get an out-of-range exception when there are a huge number of available mods/parts. ("System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.

at PlanoTron.AddInData.ScanAddInData(String kspLoc, String addInLoc) )

You should probably increase the capacity by a factor of 10 or so to be safe. Also, it would be nice if the ability to handle the plugin dll's was added. Finally, please post the source code so others can contribute. As for me, I've been a .NET / C# developer for about a decade and would be happy to help. Again, great job!

Link to comment
Share on other sites

It's working for me now and I have to say, it's a great tool. My KSP runs a lot more stable now that I can reduce the number of parts loaded.

However, I have to agree with carolyn, while the game itself barely crashes anymore, the mod manager sure does. And as far as I can tell, only deleting the persistent-file fixes this.

So yea, if you could fix that with the next update, this mod manager would be pretty much perfect ;-)

Link to comment
Share on other sites

Same thing as carolyn and Syrus, I got a out-of-range exception when I had KW Rocketry, Kosmos and NovaPunch installed to KSP_win/mods. Combined, the 3 of them contain over 300 parts, while all other mods I have have less than half.

-snip- wrote stuff that wasn't correct

Edited by heikkik
Link to comment
Share on other sites

Sorry for the long delay, I've been having a hard time getting logged onto the new forum, but it's all better now.

I've seen the same crash myself; even though it looks like a capacity issue, I think the problem has to do with a slight difference in the way that some of the older component's config files were laid out. I'll have a look at it tonight if I get a chance.

Carolyn, the source should be in https://www.dropbox.com/sh/wwvkedyd3...rce%20v1.1.zip, let me know if it doesn't work. I'd love to know if (and which) they used a .NET class to read/write these files, my hand-written method is primative and explod-y.

I haven't figured out a way to only copy the DLLs when needed. I had kind of assumed that the DLLs were only loaded by KSP when a module called for it, so they were probably not the main problem behind KSP's crashes (I just copied all of my DLLs into plugins and left them there). I'll have to write a test DLL to see how KSP calls them.

I'm happy to see that some people are using this!

Link to comment
Share on other sites

I've put up a new version; I've tried to replicate the out-of-range exception with the three mods you've mentioned, it appears to work okay. If you still experience crashes, see if you can send me your persistent file and if possible a screenshot, I think the problem may lie in the persistent file.

Link to comment
Share on other sites

Bernierm, even before reading your reply, I took a closer look and came to the same conclusion: it seems it's not a capacity issue after all. It just looked that way because (1) the error given was an "index out of range", and (2) the error occurred when I put everything I had in my AddOns folder, and "everything" happened to include a couple misbehaving parts that I didn't use much anyway. You get this error if the directories / .cfg's are not 100% setup correctly for every part.

Perhaps helping the user out by checking for this and giving a helpful error/warning pointing to the naughty Part would be the best thing for this program right now. At least you could check if the directory structure was right and that the part.cfg file exists and has a good "name =" entry. I'd suspect bad file setups are causing most if the crashes users are experiencing. Btw, I haven't tried the latest update, nor looked at the source yet, so maybe you've already addressed some of this.

As for issues with the persistent file, it hasn't seemed to give me any problems so far, but I tend to keep mine quite clean. Perhaps after getting your update, I'll try cluttering it up to see if anything happens.

As for .dll manipulation, I guess it isn't a huge deal because they take up relatively little memory. It's really more of a clutter issue. The tricky part of doing this (as you've no doubt realized) would be examining each .dll to see what module(s) they handle -- if that's accomplished, the rest is straightforward.

Keep up the good work!

P.S.: I just tried your source code link, and it's broken... FYI. Cheers!

Link to comment
Share on other sites

  • 4 weeks later...

Mabe you can help me, i got an issue when loading the "add-ins". they are unpacked and structured like this example:

"ksp main folder" (also includes ksp game folder)

->"mod collection"

-->"mod name"

--->"parts/plugins/etc"

---->"part folder/plugin.dll/etc"

Text i got from the error-console:

Unhandled exception has occurred in your application.

If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately

Index was out of range. Must be non-negative and less than the size of the collection.

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

at System.ThrowHelper.ThrowArgumentOutOfRangeException()

at PlanoTron.AddInData.ScanAddInData(String kspLoc, String addInLoc)

at PlanoTron.PlanoTronForm.ScanAddIns()

at PlanoTron.PlanoTronForm.bnScan_Click(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.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.0.30319.239 (RTMGDR.030319-2300)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

----------------------------------------

Plan-o-Tron

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/HansPHO/Desktop/KSP_win/Plan-o-Tron.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.235 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.1 built by: RTMRel

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.236 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Xml

Assembly Version: 4.0.0.0

Win32 Version: 4.0.30319.233 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.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.

Link to comment
Share on other sites

Mabe you can help me, i got an issue when loading the "add-ins". they are unpacked and structured like this example:

-snip-

By the looks of that error report. The collection was to small, and the program tried to read the next item, but that item would be outside of the collection. Which would result in a crash. (Unless he had a error handling on it, but since you got that error. I doubt it. :sticktongue:)

It might be because it's unpacked? I thought they where supposed to be packed.

Just to clarify, I'm not affiliated with this program in any way. Just trying to be helpful. :)

Link to comment
Share on other sites

Mabe you can help me, i got an issue when loading the "add-ins". they are unpacked and structured like this example:

"ksp main folder" (also includes ksp game folder)

->"mod collection"

-->"mod name"

--->"parts/plugins/etc"

---->"part folder/plugin.dll/etc"

Text i got from the error-console:

Unhandled exception has occurred in your application.

If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately

Index was out of range. Must be non-negative and less than the size of the collection.

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

(I cut out some of the not-so-useful debugging stuff). I'd guess that either your mod folder struct isn't quite right or you've got a part.cfg file that's a bit wacky. First I'd verify the mod structure. For example, say I've got NovaPunch and MMI, I have this:

c:\KSP\mods:

-> NovaPunch

--> Parts

---> NP_1 to 2 metre frustrum fairing

---> NP_1 to 3 metre frustrum fairing

---> many more

-> MMI

--> Parts

---> MMI Com 01 - Satellite Dish

---> MMI Pod 01 - Satellite Command Module

---> a few more

You don't really need the plugins folder, just parts. Contents of modules' plugins should just go into KSP's plugins folder. I don't think the plugin DLLs are a big part of KSP's memory issue, so Plan-o-tron doesn't shuffle the DLLs around for you.

If your directory structure looks good, I'd try clearing it out and adding mod sets one by one (trying the scan after each add), and see if it's a particular mod set. If so, let me know and I'll try it myself. I use about 20 mod sets, there's a lot I don't have. I seem to remember that some of the really old mods had an odd format part.cfg file, maybe it's one of those.

Link to comment
Share on other sites

Since 0.17 has changed the paths for the persistent files and the saved ships, is there any chance that you'll update the program to deal with this?

I hope so, because it's really awesome and useful :)

Yeah, and it looks like I can still crash it if I go nuts with mods. I did a quick fix where I prompt for the saves file so that I could find the persistent file and then realized tonight that that your saved ships aren't saved in the old location. So I need a bit more work.

I'll see what I can do, but it's hard because I really want to launch a probe to one of the new planets.

Link to comment
Share on other sites

...If your directory structure looks good, I'd try clearing it out and adding mod sets one by one (trying the scan after each add), and see if it's a particular mod set...

thanks for this idea (and pointing me to my own stupidness), there was a single one folder structure mistake. got it now. will try it first with plugins inside mod-collection, if it wont work well i follow your further instructions...

duna, im comming...

Link to comment
Share on other sites

plan-o-tron works now almost fine, it starts ksp (and way faster than before) plus, after dropping the plugins manualy and your v1.4 update, saving and mod-functionality works, too.

but a new, quet weird bug happens now: if im building a ship and taking a connected assembly of 2 or more parts of from my command module, i cant drag it anymore, instead, everytime i click on it, my commandmodule gets activated. also i was able to drag a part from the (transparent, not to the command module connected) assembly of parts.

second bug is, if i load a ship, or leave to spaceport and go back to VAB, ksp finds no parts, even if the ship it self is loaded (but now transparent at all). also i cant leave the VAB after this, load new or use escape.

the worst thing is, this happens now even if i start kerbal without the mod manager.

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