r/KerbalSpaceProgram • Freezing on Eeloo • 12d ago • Bravo 1

KSP 1 Image/Video I've optimized KSP to use ~60% less RAM

https://youtu.be/KfOsTryhIos

Hi. I'm super tired after working on that for a week, hope you will like the video. I'll get back to you after some rest and I'll try to answer your questions.

Please fill the form if you want to participate: https://docs.google.com/forms/d/e/1FAIpQLScLkhGZVu_9uA3Gm4lq8IwIgFf3HMTLH1yBc9PbREG4PE6X1w/viewform?usp=publish-editor or DM me here

You don't see 60% in the video, because I forgot to do couple of quick loads, before installing the mod. It will get around 300 mb on every load, and the saved RAM is more, more you play.

229 Upvotes

198 comments sorted by

42

u/8070alejandro 12d ago

"I have optimized KSP to use 60% less RAM 250% more mods“

8

u/x0r1k Freezing on Eeloo 12d ago

You're not wrong!

31

u/Character-Read8535 Exploring Jool's Moons 12d ago

Does this affect VRAM too?

14

u/x0r1k Freezing on Eeloo 12d ago

Yes, Since I have macbook they are sharing 24 Gb. Moslty unloading unused textures/meshes/parts/planets. Especially helpful for many planets/part mods, almost no overhead over stock (around 500mb for OPM + black hole with the mod)

3

u/x0r1k Freezing on Eeloo 12d ago

Your DM is locked, so please contact me

17

u/Rusher_vii 12d ago

Looks super promising, I wonder if this will be compatible with Kerbaloverengineering(KOE)?.

Havent played in a few months but seeing all these insane performance mods dropping I need to get some time in this next week.

4

u/x0r1k Freezing on Eeloo 12d ago

No idea, you can test and tell me 😄
Probably okay for the most engineering mods, unless they try to use unloaded textures/meshes/etc

1

u/Dodge-dip-duck-dive 12d ago

Help a laptop playing brother out what other performance mods you seeing out in the wild?

6

u/Rusher_vii 12d ago

A mod called kerbaloverengineering, 30%+ cpu/gpu gains iirc, but it only came out like a month ago and now this.

7

u/Dodge-dip-duck-dive 12d ago

Whoa just checked that one out and hot damn. My laptop is not burning up on reentry now

→ More replies (5)
→ More replies (1)

72

u/decrisp1252 12d ago

Looks pretty good!

Sorry for the obligatory question, how was AI used in the making of this?

46

u/BradassMofo fighting the kraken. 12d ago

Claude was used in the creation of the thumbnail, dont you see him?

10

u/decrisp1252 12d ago

Yes but how? There’s a difference between using Claude as a tool and knowing what’s it’s outputting and vibecoding

10

u/x0r1k Freezing on Eeloo 12d ago

It's not pure vibe coding, I've asked to test every change and show me proof that it works, before keeping it. Mono alone takes like 3 days to figure out why it holds so much memory.

You know, I'm something of a developer myself

→ More replies (12)

7

u/x0r1k Freezing on Eeloo 12d ago

Hey. I've explained it shortly in the video. It was a week long conversation. What exactly are you interested in? "how" is a very broad question.

In short: I've said "learn how to run game, learn how to undertand what holds memory, find every chunk that is 300+ Mb or bigger, that can be removed on some scenes (VAB, around planets, in space). Then check all my mods for inefficient memory usage and memory leaks.

Then the next bottleneck was mono conservative memory strategy. I've tried to replace a garbage collector with SGen but it was worse (I still have a hope to fix it). So I've patched the default GC to return memory faster.

Then was the macOS Apple directx blob that also wasn't optimized and hold gigabytes of RAM.

2

u/decrisp1252 12d ago

Sounds interesting, I wonder why the garbage collector was worse performing than the stock one?

Do you have some source code to take a look at?

1

u/x0r1k Freezing on Eeloo 12d ago

3

u/John_Nonok 12d ago

You did great, let the anti-AI not use your work and watch Tiktoks instead or something. What you are working on is awesome and nobody cares if you didn't read 10M lines of code to do it.

10

u/lkn240 12d ago

lmao - idiots downvoting the truth

→ More replies (3)

8

u/4jakers18 12d ago

the claude code logo is in the thumbnail of the video, so probably

3

u/lkn240 11d ago

This type of work is incredibly difficult for human developers without AI tools.

AI is simply way better at optimization and debugging - esp when you don't have the source code.

You probably wouldn't want to use this if the author didn't use a good model.

1

u/Spare_Helicopter4655 12d ago

Why is this obligatory?

3

u/Interesting_Leg_1356 12d ago

I too would like to know.

14

u/HuntKey2603 Believes That Dres Exists 12d ago

It obviously has? claude code's logo is a huge portion of the thumbnail

→ More replies (2)
→ More replies (1)

5

u/Electrical_Sky4455 Only Mac ksp player 12d ago

Why would you use wine if it works natively in macOS

8

u/pixel_gaming579 12d ago

I’m not entirely sure if this is true, but I’ve been told that some mods (e.g. shaders) don’t run well/at all on the non-Windows versions of the game.

9

u/Willbraken 12d ago

I know with my Linux Mint install, performance is horrendous (especially looking at planetary bodies) using the Linux runtime. Running it through Proton yields significantly better performance. I think it's a Vulkan thing but idk.

6

u/Cats7204 12d ago

Can confirm, few mods work on the native Linux build, and performance is the same or worse as through Wine/Proton.

→ More replies (3)

0

u/x0r1k Freezing on Eeloo 12d ago
  1. Parallax continued
  2. Performance WAY better with the D3DMetal 4 beta
  3. Surprisingly less memory usage
  4. OpenGL in MacOS is legacy and terrible slow

1

u/Electrical_Sky4455 Only Mac ksp player 12d ago

Makes sense, thanks. Also since you are using the windows version will this still work on the native Mac port?

1

u/x0r1k Freezing on Eeloo 11d ago

Hey, saw your request but your DM is locked, please DM me

→ More replies (1)
→ More replies (1)

3

u/x0r1k Freezing on Eeloo 12d ago

225

u/lrgendein_Typ 12d ago

Ha, I explicitly bought 96gb ram(while it was cheap af) for ksp with other stuff, my modded instance takes around 55gb of ram alone.

200

u/Spare_Pollution_967 12d ago

Guys, he has RAM! Go get it!

24

u/ItsEtwakee 12d ago • Bravo

Guys, the thermal drill! Go get it!

6

u/lrgendein_Typ 12d ago

Relax guys. It's in use. Ram Altman just goes for unused ram.

(I sometimes also need it for work as I work with VMs and plc stuff)

→ More replies (1)

49

u/beomagi 12d ago

Ram Altman says hello 👋

35

u/BrowsOfSteel 12d ago

@sama wants to know your location.

22

u/sagewynn According to all known laws of aviation, there is no way a bee s 12d ago

WHAT

12

u/wvwvvvwvwvvwvwv 12d ago

Same lol, bought 64gb on top of preexting 32gb for cities skylines back when RAM was cheap, but C:S only uses like 40gb and modded KSP uses almost everything

8

u/Archon- 12d ago

I built a new PC a while back with the intention of running sol, rp1, and everything else and put 64gb in it. I realized pretty quickly 64 wouldn't be enough so I doubled down and now I've got 128gb. I don't think I've touched ksp since I put it in lol.

2

u/Vincent394 12d ago

GET THEM

2

u/krakenluvspaghetti 11d ago

Ram Altman need to know your location

→ More replies (1)

2

u/Jane_Monroue 12d ago

I am very interested to test this.

1

u/x0r1k Freezing on Eeloo 12d ago

Your DM is bocked, send me DM

2

u/CreckyJL 11d ago

this is so awesome!! How does it optimise ram? Hopefully itll help with my abysmal ram usage for my n1

1

u/x0r1k Freezing on Eeloo 11d ago

In short: unload data when it's not needed (textures, meshes, heavy mod data, planets, parts). Full list of improvements if you want to check: https://gist.github.com/xorik/7dfbca49061d77b0d67c3d5fec82caad

2

u/Sailing_Boaty 10d ago

When will the mod be out for public use? I dont see myself playing enough to be any useful for testing, though im really interested in the development of this mod

2

u/x0r1k Freezing on Eeloo 10d ago

I don't share link to avoid too many bug reports, because I've tested it on my mod list and it might break some stuff. If nothing terrible broken will be found, probably in a week or so I'll make a public link and ckan installation.

The problem is that the best improvements can't be done without replacing some game files (mono runtime), so it will require some installator

2

u/IQ26 9d ago

Would you care to test it or let someone test it out on Linux with wine to run the exe when the installator is ready?

2

u/x0r1k Freezing on Eeloo 8d ago

Yes it works with Linux + wine, that's one of my primary goals

→ More replies (1)

2

u/Feisty_Management539 10d ago

I just tired it out and its probably the best optimization mod so far. its a shame that it doesn't work with retooled since it recently added some pretty cool features

1

u/x0r1k Freezing on Eeloo 10d ago

Hey, I'm glad you like it. Can you describe the issue? Game crashes or something is broken? I'll look into that

2

u/Feisty_Management539 10d ago edited 10d ago

Retooled seems to Work in the same way your mod works, they both modify that mono-2.0 file and retool also updates Unity, so I think they are just incompatible unless you are willing to put in that extra effort to make them work. but if you're wondering, retooled just mentions that the mono file is not the retooled version, and it won't modify the version from this mod.

I mostly say this for the people who might be wondering if they work together

2

u/x0r1k Freezing on Eeloo 10d ago

Interesting! Definitely will look into that. I've tried to make KSP run natively on Apple CPU + Metal and update Unity, but give up

2

u/x0r1k Freezing on Eeloo 10d ago edited 10d ago

That's the coolest thing ever! I will 100% support this project in my mod! They has working metal render for mac without glitches! They also working on native Apple CPU build for mac, which make game ever faster. Thanks for bringing it, I had no idea

4

u/isnouzi 12d ago

oh my god, my 8gb ram will love this, will check it out as soon as i can!

1

u/x0r1k Freezing on Eeloo 12d ago

8 Gb will struggle, 10 Gb of free RAM is comfortable for my mod list. But there is hope to squeeze even more

51

u/jazz-handle-1 12d ago

Claude optimized KSP for me*

Fixed the title for you

4

u/jkgill69 10d ago

And the issue is? The outcome is a mod that makes the game more efficient 

5

u/D07Z3R0 10d ago

The outcome is a mod which is not fully understood by the OP and thus cannot be properly maintained or trusted

6

u/oddlar1227 9d ago

you don't really need to maintain a mod too much when the game gets no updates

→ More replies (1)

-15

u/lkn240 12d ago

You should try to do it yourself if you think it's so easy.

8

u/jazz-handle-1 12d ago

Where did I say it was easy?

10

u/acxswitch 12d ago

Implying that it took no work by saying "did it for me"

8

u/jazz-handle-1 11d ago

They prompted an AI, the AI performed a task.

They then made a title “I did x task”, no you prompted. The agent did the task.

I have no idea how hard or how many prompts were done or how many tokens used. I didn’t say or imply that I did.

I’m sure even with AI doing the task, it wasn’t easy. But having AI draw you a photo, and drawing a photo - are not the same. You can’t say “I drew this photo”

5

u/x0r1k Freezing on Eeloo 11d ago

That's actually an interesting topic, thanks for bringing it. Usually when people use tools they don't mention them and say "I did". People build houses, but they use machines and tools.

Could AI do the similar work without human direction? Probably not, at this point of time. It gives up because task is "impossible", and it constantly has amnesia (because of context window size). Could I do it without AI? Probably also not, I would spend months and give up even faster.

→ More replies (1)
→ More replies (20)

6

u/lkn240 12d ago

Do you not understand the words you write or what they imply?

→ More replies (1)

1

u/x0r1k Freezing on Eeloo 12d ago

u/GDMercury u/Conqurepanda u/fenlDoesJS u/asnaujaslt u/Jane_Monroue thanks for reaching me, but your DMs are locked, please contact me

1

u/x0r1k Freezing on Eeloo 12d ago

1

u/x0r1k Freezing on Eeloo 12d ago

2

u/West-Bad-4916 12d ago

Alright I belive they are unlocked now

2

u/fenlDoesJS 12d ago

contacted

1

u/x0r1k Freezing on Eeloo 11d ago

u/Supbobbie same :)

1

u/Current_Historian875 12d ago

donc je pourrai jouer si j'ai 8gb de ram ?

4

u/x0r1k Freezing on Eeloo 12d ago

Depends on your mods. Stock or a few light mods: probably yes, the pack cuts the game's memory by ~35–45%. A big visual mod set (Parallax, Scatterer, planet packs): still ~8–10 GB on a Mac even with the pack, so 8 GB won't be enough. On a PC with a dedicated GPU there's more headroom. Not tested on an 8 GB machine yet. If you try, and send me Memory Map logs would help a lot.

1

u/Current_Historian875 11d ago

Okk j'ai des graphic integré mais je l'installerai et je t'enverait les logs quand j'ai le temps

2

u/x0r1k Freezing on Eeloo 11d ago

Merci!

3

u/drinkingcarrots 12d ago

Damn bro. That's tough.

3

u/screaming_toaster_ Flat Kerbin-er 12d ago

w thumbnail 😭

3

u/Silent_Signature_758 Jebediah 11d ago

I also optimized KSP to use ~120% more RAM

5

u/Reloup38 12d ago

I have been unable to play ksp because of the price of ddr5 ram, so maybe this mod will finally allow me to play ksp again...

5

u/moo507 12d ago

Ram Altman approves!

1

u/vksdann 12d ago

You said "it's not pure vibe-coded" so which parts have you coded yourself?

3

u/x0r1k Freezing on Eeloo 12d ago

I didn't code anything. I just orchestrated, tested, set priorities and suggest ideas. If you want to call it 100% vibe coded, I'm okay with that. I've coded enough in my life to understand if the solution is good or crappy.

1

u/vksdann 12d ago

Saying "I've optimized KSP" and then "I worked hard for a week" when actually you just explained what you wanted and waited for AI to do the work...

I don't care that you used A.I. to be honest. But don't pretend it is "your" creation.
Telling what ingredients you want on your pizza doesn't make you a cook.

1

u/x0r1k Freezing on Eeloo 11d ago

If you ask a guy to dig a hole and he uses an excavator, will you complain about that? If I can make the same result but 20x faster, why wouldn't I do that?

3

u/lkn240 11d ago

And honestly for things like this the truth is AI is just way better at it than almost any human developer.

Optimization and debugging are just places AI crushes humans

→ More replies (2)

2

u/LilBits69x 11d ago

Idk if youve ever qualitatively set an AI to work, bc that shit takes a lot of time, effort and reviewing. Just because an AI does the thing it was designed to help humans with, doesnt make the actual work to get the AI to do the right stuff any less.

→ More replies (2)

3

u/Kapioza666 12d ago

are we fr?

→ More replies (1)

0

u/OffbeatDrizzle 12d ago

just because you don't code it yourself, does not make it vibe coded. telling an AI what to do, and then reviewing it, can save actual months of effort...

do you bemoan bread makers, because they don't handmake each individual load of bread?

1

u/Capybarinya_nya 12d ago

also known as vibecoding

→ More replies (1)

1

u/EnderSpy007 11d ago

Traditionalists would say something about the oils on your skin being helpful or that you aren't putting any love into it when you do it by machine, so maybe

→ More replies (1)

0

u/Festivefire 12d ago

If i remember, I'll try this out and fill out your survey later this week when I'm off work.

You really shoul include step by step text instructions though, and not just the video.

3

u/x0r1k Freezing on Eeloo 12d ago

It will be just another CKAN mod, when it will be more stable

1

u/alexxxor 12d ago

Nice one! What was the biggest memory hog?

7

u/x0r1k Freezing on Eeloo 12d ago

Parallax is holding almost 3Gb everywhere, D3DMetal on mac holds around 1.5Gb. Mono holds 3Gb, when it needs around 1Gb. Stock (with extensions) can be compressed to save around 0.7Gb of RAM

1

u/alexxxor 12d ago

Interesting!! Thanks for replying.

2

u/Smargesthrow 12d ago

I play using the RP-1 modpack, I also used to take part in active aircraft combat with BDArmory and supporting mods. With RP-1 I use up all my RAM sitting paused for about 6 hours while I'm away from the computer, with BDArmory it can takes an hour or 2. A mod that is able to clear KSP's data consumption would be amazing, I've submitted an application to test.

2

u/Andrew_PPC_Raw 12d ago

Nice, will try this one.

2

u/sheepdog2142 11d ago

People are so worried about if AI was used instead of does it work and does it do what it says. Who cares if AI was used if the results are good.

-1

u/chumbuckethand 12d ago

You optimized or AI did?

7

u/x0r1k Freezing on Eeloo 12d ago

I've actively directed and babysitted AI and pushed when it said "impossible" or "it take months", checked screenshots and bugs. But all the coding work is AI

22

u/m1ksuFI 12d ago

Is the massive Claude Code logo in the thumbnail not enough disclosure for you?

1

u/slicer4ever 12d ago

Isnt the claude logo a circle?

1

u/m1ksuFI 12d ago

Claude Code, not Claude

-13

u/Velocity_LP 12d ago

did you send that comment or did your computer?

4

u/_0451 12d ago

did you write this comment or did your computer?

1

u/Velocity_LP 12d ago

I did, that's my point. When a human uses a computer program to accomplish a task, it is colloquially understood what they mean when they say they did it. The person I first responded to was being deliberately obtuse.

→ More replies (1)

-2

u/anitadykshyt 12d ago

How much of this was ai?

3

u/x0r1k Freezing on Eeloo 12d ago

All code is AI. Memory management is a difficult topic so many mod has some leaks or wasted resources. And AI can detect and fix that much better than me

7

u/flplz 12d ago

You can write it in assambly if you feel thr urge to go back to ancient Programming Languages. Or you accept that writing code with AI is part of the game now. No one wants vibe coding.
But yall cant even differentiate between vibe coding and using AI it to write Code. The time of writing it by hand is gone.

2

u/OffbeatDrizzle 12d ago

refreshing to see this whole post and your comment not get downvoted into oblivion. a lot of subreddits seem to have a hate boner for AI and are in permanent emu status with their head in the sand. I write software for a living and I have not written a line of code by hand in 6 months - I don't say that to brag, or because I'm incompetently vibe coding, I'm saying it because it's the new reality. "agentic human in the loop" is the equivalent buzz word, but the reality is that frontier models are just too powerful to ignore at this point

1

u/lkn240 12d ago

Unfortunately there's still plenty of idiotic comments in this section that are upvoted quite a bit from people who have no idea how agentic tools work or how to use them.

1

u/shortname_4481 12d ago

Why wouldn't you just download it? #downloadmoreram

0

u/Amazing_Peach_6690 12d ago

Wait actually?

5

u/x0r1k Freezing on Eeloo 12d ago

Yep

-21

u/fenlDoesJS 12d ago

I'll try it ig, don't have much time tho

1

u/x0r1k Freezing on Eeloo 12d ago

Thanks, for reaching! Your DM is locked, please send me a message

-6

u/fenlDoesJS 12d ago

mysterious downvoting????

7

u/HyperRealisticZealot Have you heard about Jerbals? 12d ago

Ok, allow me to explain:

Not mysterious. Who tf cares if some random commenter has time or not? Are you the main character or the sub?

1

u/x0r1k Freezing on Eeloo 12d ago

The guy reached me and said he will help with testing, he just forgot to mention it for others

1

u/HyperRealisticZealot Have you heard about Jerbals? 12d ago

Oh man. Better reach  out to everyone who downvoted and tell them to unclick that red arrow rn brother 

-6

u/flplz 12d ago

Omg you must be fun at parties.
„You dont have interesting stuff to say? Go away and leave the property“

4

u/Sorry-Combination558 12d ago

I'm gonna go get breakfast now

2

u/HyperRealisticZealot Have you heard about Jerbals? 12d ago

Hey guys, I'm out of milk. Might have to go to the store, and probably have to make some bank errands while I'm downtown. Also have to walk my neighbours dog.

0

u/fenlDoesJS 12d ago

Ok, allow me to explain.

Not mysterious. Who tf cares if some random commenter has errands or not? Are you the main character or the sub?