Jump to content

[Script] AutoPruner v1.1 - Prune those parts that suck up your RAM! (2015/018)


Felger

Recommended Posts

I already remove-delete all the tanks parts, stock parts, or mod parts that I dint want it..

This mean the cfg files and the model file.

If I use this mod then I would not have any increase on performance, dont you?

That's correct. All this script would do is remove those same parts.

Link to comment
Share on other sites

Awesome stuff! Yeah, if you hit alt+f12 it'll open up the debug console, pretty sure it's got a list of all loaded parts in there somewhere. Otherwise you might just have to check the outputlog...

I want to be sure of what files (models and textures) to remove from GameData after I remove the part's configs...So something that not only shows the files that are loaded, but rather the files that are not being used despite being loaded...

(Blame Squad's derp method of loading stuff [load it all and keep it loaded at all times regardless of use or necessity]...which is the reason we have to do such painful memory-footprint management in our modded KSP installs in the first place)

Link to comment
Share on other sites

  • 3 weeks later...

I'm having an issue with 1.1. This is the first time I've ever used AutoPruner and it's for SETI.

I downloaded all the mods for SETI into a fresh, brand new folder d:\ksp_90_seti

All the mods are correclty installed in d:\ksp_90_seti\gamedata

I downloaded Autopruner and installed it in d:\ksp_90_seti\PRNLs such that pruner.exe is in d:\ksp_90_seti\PRNLs\pruner.exe along with lots of prnl files.

I put the SETI.prnl file into that same drectory.

When I run the program, though, it states it couldn't do anything an does not seem to know where my ksp directory is:


d:\ksp_90_seti\PRNLs>pruner -prune SETI.prnl
Found nothing to prune...
==================================================
Pruning files matching SETI.prnl:
Squad/SPP/Wings
Squad/Parts/Aero/advancedCanard
Squad/Parts/Aero/aerodynamicNoseCone
Squad/Parts/Aero/protectiveRocketNoseMk7
Squad/Parts/Aero/standardNoseCone
Squad/Parts/Aero/standardCanard
Squad/Parts/Aero/wingletAV-T1
Squad/Parts/Aero/wingletDeltaDeluxe
Squad/Parts/Aero/tailfin
Squad/Parts/Electrical/z-200Battery
Squad/Parts/Electrical/z-1kBattery
Squad/Parts/Electrical/z-4kBattery
Squad/Parts/Engine/solidBoosterBACC
Squad/Parts/Engine/solidBoosterRT-10
Squad/Parts/FuelTank/fuelTankJumbo-64
Squad/Parts/FuelTank/fuelTankOscarB
Squad/Parts/FuelTank/fuelTankT100
Squad/Parts/FuelTank/fuelTankT200
Squad/Parts/FuelTank/fuelTankT400
Squad/Parts/FuelTank/fuelTankT800
Squad/Parts/FuelTank/fuelTankToroidal
Squad/Parts/FuelTank/fuelTankX200-16
Squad/Parts/FuelTank/fuelTankX200-32
Squad/Parts/FuelTank/fuelTankX200-8
Squad/Parts/FuelTank/RCSFuelTankR1
Squad/Parts/FuelTank/RCSFuelTankR10
Squad/Parts/FuelTank/RCSFuelTankR25
Squad/Parts/FuelTank/RCSTankRadial
Squad/Parts/FuelTank/RCStankRadialLong
Squad/Parts/FuelTank/xenonTank
Squad/Parts/FuelTank/xenonTankRadial
Squad/Parts/Mk1/mk1structural.cfg
Squad/Parts/Mk1/mk1structural.mu
Squad/Parts/Mk1/mk1fuselage.cfg
Squad/Parts/Mk1/mk1fuselage.mu
Squad/Parts/Mk1/mk1fuselageFuel.mbm
Squad/Parts/Structural/adapterSmallMiniShort
Squad/Parts/Structural/adapterSmallMiniTall
Squad/Parts/Utility/decouplerSeparatorTR-18D
Squad/Parts/Utility/decouplerSeparatorTR-2C
Squad/Parts/Utility/decouplerSeparatorTR-XL
Squad/Parts/Utility/decouplerStack2m
Squad/Parts/Utility/decouplerStackTR-18A
Squad/Parts/Utility/decouplerStackTR-2V
Squad/Parts/Utility/largeAdapter
Squad/Parts/Utility/largeAdapterShort
NASAmission/Parts/MassiveSRB
NASAmission/Parts/Size3Decoupler
NASAmission/Parts/Size3LargeTank
NASAmission/Parts/Size3MediumTank
NASAmission/Parts/Size3SmallTank
NASAmission/Parts/Size3To2Adapter
BahaSP/Parts/spotlightTurret
BahaSP/Parts/sRadialEngine/part.cfg
BahaSP/Parts/trrEngine/part.cfg
BahaSP/Parts/retractableEngine/part.cfg
DeadlyReentry/Parts/DRE_0625HS.cfg
DeadlyReentry/Parts/deadlyReentry_1.25Heatshield
DeadlyReentry/Parts/deadlyReentry_3.75Heatshield
DeadlyReentry/Parts/UP_decoupler_2/part_1_25M.cfg
DeadlyReentry/Parts/UP_decoupler_2/part_2M.cfg
DeadlyReentry/Parts/UP_decoupler_2/part_3M.cfg
DeadlyReentry/Parts/UP_decoupler_2/part_4m.cfg
ProceduralFairings/deprecated
StationScience/Parts/StnSciAttachOTron
ThunderAerospace/TacLifeSupportContainers
ThunderAerospace/TacLifeSupportHexCans

Proceed (up to 0 files to rename)?

[ Y / N ]?y
-----Executing-----

Can't chdir('D:\GameData'): No such file or directory at script/pruner.pl line 93

d:\ksp_90_seti\PRNLs>

Link to comment
Share on other sites

That's a bit odd, to make sure you're installing it in the right place, does your file structure look like:

~~~/GameData/Mods

~~~/AutoPruner/PRNLs/

~~~/AutoPruner/StartThis.bat

Also, what operating system are you using? Looks something like a windows operating system, but the folder names look a bit for a typical windows install.

Link to comment
Share on other sites

That's a bit odd, to make sure you're installing it in the right place, does your file structure look like:

~~~/GameData/Mods

~~~/AutoPruner/PRNLs/

~~~/AutoPruner/StartThis.bat

Also, what operating system are you using? Looks something like a windows operating system, but the folder names look a bit for a typical windows install.

Aha, no it's just right off of gamedata, d:\ksp_90_seti\PRNLs\ not d:\ksp_90_seti\AutoPruner\PRNLs\

And yeah it's windows. I didn't touch the SETI.prnl file, it came with / instead of \

I'll try putting it in AutoPruner and see if that does the trick.

EDIT: That did it! Thanks!

Edited by 5thHorseman
Link to comment
Share on other sites

You should work with sarbian to get your excellent pruner into module manager. Currently, MM removes parts from the game, but the game still loads their resources.

We've talked about it, and unfortunately due to the way KSP launches and loads, it loads plugins after loading assets into the game, there isn't an easy way to do that. I am looking at options, though, potentially looking at how Load On Demand did its thing and implementing that sort of methodology.

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
When I try to prune something on Linux I get "/pruner.pl: Permission denied" (using ./pruner.pl -prune FASA_Tanks.prnl command)
That likely means you have permissions set wrong on the file. Run "chmod 775 pruner.pl" on the terminal in the directory with pruner.pl, this should fix it.

Thank you so much, can this be added to the readme or something? I had the same issue! And there are more and more of us linux users.

Link to comment
Share on other sites

The script does't work if you have 0D 0A (hex) as line breaks. It only prunes the last line. Just 0A works.

Just for someone who might run into the same problem and hasn't an hour to figure it out ;)

Link to comment
Share on other sites

  • 4 weeks later...

Thanks so much for this tool Felger! I'm just wondering if this tool will be updated to KSP 1.0, because it would be great if it was.

Thanks for your work!

Link to comment
Share on other sites

  • 2 weeks later...

This is such a cool mod.

Thank you for writing it

LGG

- - - Updated - - -

Thanks so much for this tool Felger! I'm just wondering if this tool will be updated to KSP 1.0, because it would be great if it was.

Thanks for your work!

This isn't specific to a KSP version, since it's only renaming files.

Link to comment
Share on other sites

Is there a way you could work with the CKAN coder who is doing the "PartManager" plugin? It would be great to have this work with that. At present time, I think they are using an MM.cfg of some sort, whcih still oads the resources (RAM bloat) instead of your solution with prevents the RAM bloat.

Link to comment
Share on other sites

pruner -unprune 000_Global.prnl

That should do it! Otherwise, you could make a .prnl that searches for "pruned" and use that.

This doesn't work anymore. I'm guessing it may be because you are now starting in Gamedata already.

Replace the text in the file with the following:


pruned

and it will work.

LGG

Link to comment
Share on other sites

Wildcards don't seem to work anymore. I know you removed the regex functionality, but how, for example, can I remove ALL the MiniAVC.dll files.

I tried the following, none worked:


MiniAVC.dll


*/MiniAVC.dll


.*/MiniAVC.dll


MiniAVC

the only think that worked was if I specified the path before, such as:


ContractPacks/KerbinSpaceStation/MiniAVC.dll
GCMonitor/getRS

It seems to look for a match on the first part, and if that matches, then it does the prune. For example, the second line above actually prunes the following:


Pruning GCMonitor/getRSS_OSX_x86.so..
Pruning GCMonitor/getRSS_src.zip...
Pruning GCMonitor/getRSS_x64.so...
Pruning GCMonitor/getRSS_x86.dll...
Pruning KerbalEngineer/MiniAVC.dll...

Link to comment
Share on other sites

Wildcards don't seem to work anymore. I know you removed the regex functionality, but how, for example, can I remove ALL the MiniAVC.dll files.

I tried the following, none worked:


MiniAVC.dll


*/MiniAVC.dll


.*/MiniAVC.dll


MiniAVC

the only think that worked was if I specified the path before, such as:


ContractPacks/KerbinSpaceStation/MiniAVC.dll
GCMonitor/getRS

It seems to look for a match on the first part, and if that matches, then it does the prune. For example, the second line above actually prunes the following:


Pruning GCMonitor/getRSS_OSX_x86.so..
Pruning GCMonitor/getRSS_src.zip...
Pruning GCMonitor/getRSS_x64.so...
Pruning GCMonitor/getRSS_x86.dll...
Pruning KerbalEngineer/MiniAVC.dll...

Hmm, it should work. I'll take a look at how I'm matching stuff and see if there's an easy fix.

The Perl packager that I used before to make the last release is super finicky, and I haven't been able to get it to work on my windows machine since my hard drive went belly up.

In any case, I'm actually hoping to get some kind of combined functionality with night's ckan part manager. That'd be the most fitting solution imo

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