Jump to content

[1.12.x] End your parts list nightmare - Introducing The Janitor's Closet


linuxgurugamer

Recommended Posts

12 minutes ago, linuxgurugamer said:

I think you meant to look at OnGUI, not OnWindow (putting this here for reference for other people)

You are indeed correct.  OnWIndow is called from within OnGUI, but the implementation is not in OnWindow in any case. :)

Link to comment
Share on other sites

7 minutes ago, Papa_Joe said:

You are indeed correct.  OnWIndow is called from within OnGUI, but the implementation is not in OnWindow in any case. :)

And just so you know, I'm in the middle of releasing the next version with the fix.

Thanks

Version 0.0.4 is up on Github and Spacedock

Edited by linuxgurugamer
Link to comment
Share on other sites

Amazing. Just what the doctor ordered. As this is something I see activated not too frequently (useful as it is, don't get me wrong, but it's "set it and forget it"), could perhaps adding a short instruction "alt+click to block part" be added to the window that pops up when you click the janitor button in the VAB/SPH?

Link to comment
Share on other sites

23 minutes ago, Kerbart said:

Amazing. Just what the doctor ordered. As this is something I see activated not too frequently (useful as it is, don't get me wrong, but it's "set it and forget it"), could perhaps adding a short instruction "alt+click to block part" be added to the window that pops up when you click the janitor button in the VAB/SPH?

Good idea, I'll see what I can do

21 hours ago, nightingale said:

Be careful with the way you've implemented the perma-prune - deleting/renaming files will play havok with CKAN users (unless CKAN has changed, but last I checked it would freak out when uninstalling/updating a mod when all files it expected to be there weren't there).  You may be better off writing a LoadingSystem mod that executes after GameDatabase (or better yet, after ModuleManager) and before PartDatabase.

That being said - cool idea!

I was able to get some code which worked with the LoadingSystem, but realized that it won't do anything beyond what the soft block is already doing.

The problem is that in addition to renaming the config files when I do a PermaPrune, I also rename all the assets used by that part (as long as it isn't being used by any other part).  The idea being to both prevent it from loading, saving time and memory.  If I do it in the LoadingSystem, it will already have loaded the configs, and quite possibly will also load all the assets just because they are there (images, mostly).

The code is safe enough, and deals properly with files if it tries to rename a file and there is a copy already there.   CKAN also deals well with missing files, and ignores any files which aren't in the mod list.

One thing I still need to do is to have it deal properly with a mod after it's been updated.  Right now, you won't see the updated parts, but they will be loaded anyway because of the update.  I need to add a module which will go through the list of renamed parts, and check to see if any have new copies there, if so, it will rename them automatically.  This, I will probably put into the loading system, and make it the first so that the parts won't get loaded.

Link to comment
Share on other sites

15 minutes ago, linuxgurugamer said:

I was able to get some code which worked with the LoadingSystem, but realized that it won't do anything beyond what the soft block is already doing.

The problem is that in addition to renaming the config files when I do a PermaPrune, I also rename all the assets used by that part (as long as it isn't being used by any other part).  The idea being to both prevent it from loading, saving time and memory.  If I do it in the LoadingSystem, it will already have loaded the configs, and quite possibly will also load all the assets just because they are there (images, mostly).

Right that's why you have your LoadingSystem execute between GameDatabase and PartLoader, and then you remove the stuff you don't want included anymore from GameDatabase.  PartLoader uses GameDatabase to decide what to load.  Texture are trickier because they are loaded in GameDatabase, but your best bet may just be to free them after they've been loaded.  Regardless of how you're doing it, you want to be super careful with textures - as a texture may be shared between multiple parts.

Link to comment
Share on other sites

1 hour ago, nightingale said:

Right that's why you have your LoadingSystem execute between GameDatabase and PartLoader, and then you remove the stuff you don't want included anymore from GameDatabase.  PartLoader uses GameDatabase to decide what to load.  Texture are trickier because they are loaded in GameDatabase, but your best bet may just be to free them after they've been loaded.  Regardless of how you're doing it, you want to be super careful with textures - as a texture may be shared between multiple parts.

The way I do it right now, is that I search all loaded parts for any which use a texture in a pruned part.  If it is used anywhere else, it doesn't get renamed.

I understand what you are saying, but the whole idea behind the PermaPrune is to avoid loading the stuff at all.  With that caveat, I do not recommend using PermaPrune unless someone has a memory issue.

I just released 0.0.5, which adds the needed code to rename any updated parts that can show up from a mod or Steam update

Edited by linuxgurugamer
Link to comment
Share on other sites

Just thought I would mention, for texture sharing testing purposes, Probes Plus might be a good one to try... @akron is a master at optimizing and sharing textures.. That whole mod only uses, like 5 or 6, main textures... Plus, he has texture switching included, with 4 or 5 different textures... So yeah, maybe a good one to test, to make sure the Closet handles texture sharing correctly...??

Edited by Stone Blue
Link to comment
Share on other sites

4 minutes ago, Stone Blue said:

Just thought I would mention, for texture sharing testing purposes, Probes Plus might be a good one to try... @akron is a master at optimizing and sharing textures.. That whole mod only uses, like 5 or 6, main textures... Plus, he has texture switching included, with 4 or 5 different textures... So yeah, maybe a good one to test, to make sure the Closet handles texture sharing correctly...??

Thanks, I'll do some more testing this evening with that

Link to comment
Share on other sites

13 hours ago, linuxgurugamer said:
13 hours ago, Stone Blue said:

Just thought I would mention, for texture sharing testing purposes, Probes Plus might be a good one to try... @akron is a master at optimizing and sharing textures.. That whole mod only uses, like 5 or 6, main textures... Plus, he has texture switching included, with 4 or 5 different textures... So yeah, maybe a good one to test, to make sure the Closet handles texture sharing correctly...??

Thanks, I'll do some more testing this evening with that

Works nicely!

Gave me an idea for something though, I need to think about it.

Link to comment
Share on other sites

Just to be clear, permaprune reduces ram usage and load times the same way autopruner does right? Because I have over 100 mods, most of them part packs(1.1 yaaaay) and my game uses over 6 gb of ram (no problem here) and takes the better part of an hour to title screen. Removing like 500 (without exaggeration) completely redundant fuel tanks would be a pain in the ass with any other method. 

Link to comment
Share on other sites

  • 2 weeks later...

It seems you've specifically bound this to the alt key. Is there a way you could instead bind it to KSP's definied mod keys? Not all of us use alt, and for some of us, alt is reserved by our window managers in such a way that alt doesn't work with KSP.

Link to comment
Share on other sites

  • 2 weeks later...
On 9/29/2016 at 4:54 AM, Jovus said:

It seems you've specifically bound this to the alt key. Is there a way you could instead bind it to KSP's definied mod keys? Not all of us use alt, and for some of us, alt is reserved by our window managers in such a way that alt doesn't work with KSP.

You are correct.  I'm fixing it, should have a new version up in a hour or so.

sorry it took so long to respond, I've been busy with RL and two other mods I'm writing

Link to comment
Share on other sites

54 minutes ago, linuxgurugamer said:

You are correct.  I'm fixing it, should have a new version up in a hour or so.

sorry it took so long to respond, I've been busy with RL and two other mods I'm writing

In my book, you never need to apologize for not updating a mod. You've done a huge service to the community (especially the RO/RSS community) just by releasing this thing in the first place.

Link to comment
Share on other sites

What happens with files i permaprune or block and a update through ckan is incoming?

Will these parts be there again or does this mod check and log the files i set to permaprune/ blocked and do the same with the new incoming?

Edited by LeLeon
Link to comment
Share on other sites

On 10/16/2016 at 4:51 PM, LeLeon said:

What happens with files i permaprune or block and a update through ckan is incoming?

Will these parts be there again or does this mod check and log the files i set to permaprune/ blocked and do the same with the new incoming?

It tries to be smart and do the same with the new incoming

 

Edited by linuxgurugamer
Link to comment
Share on other sites

3 hours ago, Torih said:

Hi. appears that the permaprune option is bugged again. softblock is fine but when trying perm the window opens where to used to rename, but its blank. Checked the files and they have not been modified.

https://www.dropbox.com/s/daj60p8z9e4lasx/output_log_Prune.txt?dl=0

I see the problem, but it's going to be a while until I can fix it.  Something changed in the internals and I need to figure out what.

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