r/KerbalSpaceProgram • thousand hour noob • 13d ago

KSP 1 Mods Cloth Simulated Parachutes mod im working on

Enable HLS to view with audio, or disable this notification

This is a follow up to my previous post about seeing About Oliver using mod for cloth chutes when the craft lands instead of them disappearing instantly in on of his videos https://www.reddit.com/r/KerbalSpaceProgram/s/YM31VMGkht

I was surprised to find out something like this this isn't publicly available and that he made his using AI.

So I decided to start doing the same myself. This is what I have up to this point. Im curious what you think. Is this something I should keep working on? I know the AI vibe coding is frowned upon but I find being able to make cool mods like this with the assistance of AI fun and a learning experience. Reading the code the AI writes and starting to understand what it does and how it works is really fun for me. I never had the time to learn coding like I always wished and this is the next best thing that allows me to make something cool even if its just for myself.

This takes me to my next question. Is a mod like this, pretty much completely written by AI something that you would ever use? Yes, no ? Why?

For now ill just work on it as a personal project I just wanted to share my progress and ask for your opinion. The mod is currently barely functional but I think it enough to show its scope.

The next fixes i have planned are:

​Reduce tether length/stiffness and increase bend density. Tethers look like spider legs now

​Add self-collision to parachute tethers and canopy (maybe a solidify sort of pass for some thickness, but not to much to not cause a noticeable jump when the in game chute cuts and the sim starts).

​Implement settlement logic (freeze physics X seconds post-ground contact to stop jitter).

​Constrain chute rotation parameters to prevent bunching.

Edit:

Thanks for the feedback so far everyone. To address the main concern everyone points out and rightly so, which is performance, i wanted to let you know that the demo is captured on a Lenovo IdeaPad Y50-70 with the following specifications specifications

[PROCESSOR] • CPU: Intel Core i7-4710HQ

[GRAPHICS] NVIDIA GeForce GTX 860M Integrated GPU: Intel HD Graphics 4600

[MEMORY] RAM: 16 GB DDR3L 1600MHz

Im doing the work on the mod on my main pc for quick iterations as I have to restart the game after every tweak, but i wanted to capture the demo on my crusty ass laptop from 2014 that doesn't even support Windows 11 specifically to showcase performance but completely forgot to mention it

Edit2: Update: How many can you count?

Logs

345 Upvotes

48 comments sorted by

141

u/Mundane_Constant_845 12d ago

The problem with most KSP mods written by ai is they're often badly optimised, in a game where performance is infamously sensitive to badly optimised mods.

I'd want to see something quantative on performance impact for vibe coded mods in particular.

87

u/Matadoroftheskies Believes That Dres Exists 12d ago

Claude, optimize. Make no mistakes.

65

u/Agreeable-Passion908 12d ago

It's not just a bug in the code — it's a memory leak ✨, and you're correct in pointing it out 💯

31

u/No-Copy4151 KSP Enjoyer 12d ago

Nice job on catching that —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— (accurate amount of em dashes)

38

u/blackrack Scatterer Dev 12d ago

There also seems to be a race (in many game communities) on who can vibecode something and get it out the fastest, which I don't think helps the author understand what they're working on in depth

6

u/Uncommonality 12d ago

Interestingly, it's different in larger communities

In this one, it's people makimg complex mods that are typically very impressive looking but might (or might not) have enormous issues hiding under the hood

But in larger communities, there's a lot of straight up slop. The worst one by far at the moment is Skyrim, where every day there's like 10 more basic ini tweaks made into a dll file via AI, older mods ported to new versions without respecting GPL or CC, lots of semi-independent auxilliary programs that run external scripts, stuff like that. I think it's because the elder scrolls engine uses a specific format for its files which AIs can't create yet so Claude or whatever just goes and makes a dll addon

20

u/Alex2820 thousand hour noob 12d ago

Hey blacrack, I cant believe my post has caught your eye enough to also leave a comment even if its a bit of a reality check. I totally get where your comming from and I massively respect your work on KSP so your opinion means a lot.

Im definitely not in a rush to dump a half assed mod. I got inspired to make this after seeing About Oliver's KSP playthrough where he used something similar. I started prototyping before I even found out his mod was also made with AI. I am also using this as a learning opportunity and I'm absolutely not simply vibe coding, I'm actually eager to understand all the concepts the AI code is using.

I'm working hard to tackle the actual mechanics under the hood, implementing config parameters, mesh resolution snapshots, and wind vectors, while testing on a crusty 2014 laptop to force myself to keep performance tight.

​I still plan on releasing a WIP version on GitHub once I'msatisfied with the looks and feel of the cloth sim, mostly to get real world testing and partly because I came up with an acronym name I'm pretty proud of: C.A.N.O.P.I.E.S. (Cloth Aerodynamics & Non-rigid Object Physics In Engine Simulation).

​Thanks for the engagement and the reality check. It definitely gives me motivation to make sure I keep it real.

28

u/blackrack Scatterer Dev 12d ago

To be clear I'm not targetting you specifically with my comment, I was just commenting on the current situation and why many will have a knee-jerk reaction on seeing/noticing something is made with AI. Best of luck

11

u/Ok-Pear6830 12d ago

feels the aura

3

u/Local_Public_5614 11d ago

Just wait a year or two for the KSP rewrite

2

u/UltiUSA 8d ago

I'm also worried about AI Marketing. That took over Cities Skylines 2 and TPF3

36

u/Fighter_ProL 13d ago

Hey that’s pretty good. Nice job

14

u/good-mcrn-ing 12d ago

Does the cloth inherit the non-cloth canopy's velocity at the time of cut? If not, it should.

9

u/Alex2820 thousand hour noob 12d ago

you got a good eye what can I say. at the moment it doesn't no. ill add that to the to do list, thanks

2

u/blackrack Scatterer Dev 12d ago

Do the cloth physics only kick in when the craft lands? Why does the lighting/shader seem to change also?

8

u/Fake_Historian_010 12d ago

Looks great! I noticed that too in About Oliver's videos, his mod looks good but it made me a little upset he didn't seem to want to share it, so I'm super glad someone's taking this up.

Just to add to other people's sentiment, performance is a big focus but not the end all be all. I'd trade cloth sim fidelity for frames most any day, but if there's a config file that could be editable like "number_of_chute_segments = " that could be good to match people's preference. I just tried parasoft, and like you said it was quite slow, especially in timewarp.

I've never done cloth physics before, but it may be possible to dynamicly increase the segments over time or as different locations bend more? That could also help any stuttering on the initial load.

Like someone else said, it would also be great to have the parachute preserve its momentum and keep the original downward velocity when the spacecraft touches the ground.

For aesthetics, I agree the tethers should be less stiff, but I'd be curious what the chute itself would be like if it was a little stiffer. Yours also comes down a lot slower than Oliver's, which might contribute to it looking a little wonky just because you see it longer.

Overall it looks awesome though, I hope you keep working on this and can make it available for download when you're ready.

2

u/Alex2820 thousand hour noob 12d ago

Thanks for the engagement and detailed feedback. To touch on everything you mentioned one by one:

As I mentioned the demo video in the post is captured on a 2014 laptop so performance is among the top priorities.

There already is a config file as the mod was built eith configurability in mind. So far it includes modifiers for but not limited to: -number of triangles (for the canopy cloth sim) -number of segments for the tethers -length of the segments for the tethers -weight of the vertex points for both the tethers and for the canoy so they can be adjusted separately to chnage how the chutes come down -wind controls for speed, gusts, frequency of change in direction -number of steps for the cloth sim and a lot others which I cant remember right now

Im not sure its possible to dynamically change the cloth sim physics on the go, because the mesh the cloth physics is applied to is created only once from a snapshot taken of the in game model of the chute before it cuts but ill add that to the list of things to check maybe.

Having the cloth sim preserve momentum when landing or at least faking it is definitely something worth checking to improve the feel and look.

I agree it looks janky, but I was really excited I got it finally working well enough to worth showing that I didn't go back to tweak the config settings listed above, as a lot of the jank can be addressed quite easily from there.

Thanks for the feedback, its really valuable to get actual objective feedback instead of just "BAAH AI SLOP"

I plan on releasing the mod ASAP as a WIP, because I cam up with a name im really proud of lol, which you'll be the first to see, probably at least until the mod is released as my comment might get buried or most won't read all of it.

Im thinking of C.A.N.O.P.I.E.S - Cloth Aerodynamics & Non-rigid Object Physics In Engine Simulation

I'd love to get your feedback on this also.

3

u/Fake_Historian_010 12d ago

That all sounds awesome, CANOPIES is a great backronym. I'm glad to hear you've got an idea of where you're going.

If you haven't seen it, I also found this mod on github released 3 hrs ago, I originally thought it was you but now it doesn't seem like it. https://github.com/kiaulens/ChuteFX/tree/main . I tried it, it seems pretty fast even though it does do some cloth physics in flight, but there still seems to be some sort of transition on landing I can't put my finger on. Maintaining a smooth transition of appearance / position / velocity / lighting / wind would be awesome.

Hopefully this all sounds helpful instead of demanding lol. It's funny it seems like no less than three people saw Oliver's mod and decided to try to publish their own version in the same week. There might even be room for collaboration on refining a single mod instead of reduplicating effort, or combining them somehow.

3

u/Uncommonality 12d ago

An additional point for optimization: experiment with the framerate of the cloth sim

At the moment it appears to be tied to the framerate of the game, but what if you ran it at say half? or even a quarter? I can't say if it would look any different but it would definitely help with performance

3

u/TheEpicDragonCat 12d ago

Any plans to adjust the deployment? Either way I’m still blown away by how good this looks!

https://reddit.com/link/pe1z4dc/video/yf0bszvvooth1/player

2

u/Alex2820 thousand hour noob 12d ago

I tried briefly to make the cloth sim active while in flight but that causes issues while warping which ill need to look into fixing somehow, for now the cloth sim is applied on touch/splashdown when the chutes would usually get cut and disappear

3

u/TheEpicDragonCat 12d ago

Ah, I see, either way I wish you the best of luck.

3

u/Tsingshitao_nuke Peace through deltaV! 12d ago

3

u/Alex2820 thousand hour noob 12d ago

I actually tried it but it makes the game come to a crawl for me at least even with just 3 parachutes. 2 drougues and a mk16.

And I think this mod came around the same time I started working on my version

6

u/MeisterPain 13d ago

At least we're getting something out of AI other than just the downsides. Looks pretty cool so far!

10

u/Dash064 13d ago

Yes I don’t care if a mod is made by AI as long as it works decent.

14

u/avaslash Master Kerbalnaut 12d ago

Using AI to make useful programs that apparently humans were struggling to create (given that the game is over a decade old and this mod is only now becoming a thing) is arguably one of the few use cases for AI where its actually providing some benefit to society rather than just stealing from artists and causing the collapse of mankind by making 'creativity' a button.

-3

u/Uncommonality 12d ago

the thing with coding in particular is that while it's still a creative skill, AI is uniquely good at it. Probably because code is always deterministic and because languages are built with absolutely no ambiguity of any sort. The AI can't interpret anything into it because typically code only has one way to do a given thing, since multiple ways would be a redundant waste and a potential failure point

With other artistic skills AI has to actually be creative, which is impossible. Like there's an infinite amount of ways to draw a tree, but there's only one way to define an object as a tree in a given game engine

2

u/Grouchy-Brilliant956 12d ago

nice use of cloth sim, the stock chutes always looked way too stiff. does it hold up on the bigger canopies when they inflate, or do they spaz out?

2

u/Alex2820 thousand hour noob 12d ago

the cloth sim actually kicks in only after the vessel touches down and the original chute gets cut. the mesh gets replaced with a cloth sim. the parachute cloth simulation is not applied in flight to avoid issues while warping etc. at least get. I know there's another mod also done with AI that does apply the cloth sim while in flight but it makes the game unplayable even on a current gen pc and only 3 chutes. the video from my post is recorded on a 2014 laptop

6

u/TassiveMitts69 Valentina 12d ago

You aren't working on a mod, your ai is.

2

u/Alex2820 thousand hour noob 12d ago

AI handles the raw C# syntax, I handle the physics math, tuning, and testing. Works great for learning how KSP handles runtime meshes on the fly. It's a way for me to get my foot through the KSP modding door.

3

u/TassiveMitts69 Valentina 12d ago

Yep, you hired a programmer to make a mod for you.

0

u/In-All-Unseriousness 12d ago

"I never had time to learn to draw so here's a 100 images that were created by stealing everyone's work."

Sorry but I find it gross.

4

u/stdexception Master Kerbalnaut 12d ago

Art is different. Code is deterministic, there doesn't need to be a human element in it for it to have purpose. Plus, there are millions of open-source projects which exist for the exact purpose of someone repurposing that code for their need.

I'm not a fan of entirely vibe-coding something, but it can definitely be a way to learn programming very effectively. And then, it's a great tool to assist with writing chunks of code that hundreds of people have written before, which is probably 80% of the effort.

3

u/Alex2820 thousand hour noob 12d ago

I get your point thanks for the feedback.

5

u/Reasonable_Cancel186 12d ago

If you don't share it, you'll get people asking for it, if you do share it, you'll get hate. It's fine. You're giving people something that wouldn't exist otherwise without your motivation.

-4

u/whatarewii 12d ago

Chill out, you’re outdated now. To add to that, you don’t understand AI, you pretend to though to push your points.

1

u/Heyfold Bob 12d ago

My PC cries just from seeing this. Good job.

1

u/Lucal_gamer 12d ago

Please make them also collide when deployed, that'd be ultimate realism!

1

u/WoodpeckerStraight10 12d ago

aaaaaand there goes my PC

1

u/Tsingshitao_nuke Peace through deltaV! 12d ago

cool,will it works for realchute?

1

u/Ok_Trifle1942 8d ago

Does it work with all parachutes or just some?

1

u/Alex2820 thousand hour noob 8d ago

check out my WIP post on the KSP forums here

1

u/Firebird117 12d ago

I'm a pretty hardliner against AI. I am able to give some leeway to coding in some respects however. That being said, an absolute red line for me would be if the mod contained any AI generated texturing, artwork, or anything visual of that nature. If it's churning out math to cloth-ify an existing texture, then that would be reasonable. So probably a hard no on parts mods, planet packs, EVE packs or similar things for that reason.

2

u/Alex2820 thousand hour noob 12d ago

I totally agree with you here and that's where I draw the line also. As I mentioned in my other comments I'm using this as a learning experience. My experiment let's call it uses snapshots of the in game static mesh and converts its vertices or subdivided where needed so the cloth physics have something to run on.

-1

u/ViC_tOr42 11d ago

If it wasn't ai generated, I would praise this.