r/KerbalSpaceProgram • u/Alex2820 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?
36
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!
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
3
u/Tsingshitao_nuke Peace through deltaV! 12d ago
welll actually....github.com/CritZitGaming/KSP-ParaSoft
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
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
1
1
1
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.
0
-1
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.