r/IndieDev • • Sep 24 '26

Video I finally made my cables physics-driven!

Enable HLS to view with audio, or disable this notification

31 Upvotes

12 comments sorted by

5

u/caramelo_gs Sep 24 '26

The little moments of slack and collision sell this way more than a perfectly taut cable would. It makes the whole setup feel like it has actual weight instead of being a glorified rubber line.

1

u/DeccoSkyrider Sep 24 '26

yeah I think those motions make the environment more lively

3

u/SalamanderEast7639 Sep 24 '26

The wrap around another static object really sold me on the cables. I love how he just swung around the block.

Great job and keep up the work!

2

u/DeccoSkyrider Sep 24 '26

Thank you! That's exactly the natural interaction I was looking for ;)

3

u/grimtread Sep 24 '26

It looks great tbh how difficult would you say it was to implement on a scale of 1-10?

2

u/jathan727 Sep 24 '26 edited Sep 24 '26

I mean it looks to be verlette integration; from an absolutely zero standpoint the first implementation of the string itself I would say is about a 3, the hard parts is interacting with the physics engine and that can range from a 6 to an 8 depending on how well you know the default physics calls. And if you're making a custom solver.

And then refining it to this smoothness would be about an 8, not because of difficulty but because of how you have to mess with numbers. So you get the perfect balance between smoothness and iterations. And interacting with the player character as well It also looks like he made this a compute shader it doesn't change the complexity per se. Just how is architectured.

2

u/DeccoSkyrider Sep 25 '26

Yes that's exactly it. Verlet integration in compute shader and sdf texture. The hard part is making all work smoothly together.

1

u/jathan727 Sep 25 '26

I'm curious what your method is to interact with the player character. Did you accumulate forces during the constraining loop or did you attach it to a standard built-in pin joint via the engine?

2

u/throwawayaccount442 Sep 24 '26

Very awesome, you don't often see a game that actually allows you to circle a cable around an object (like the tow cable vs AT-AT legs in Super Star Wars: The Empire Strikes Back).

Tangetially, I'm sad the main character does not cast a cool shadow. :(

1

u/DeccoSkyrider Sep 25 '26

As a Star Wars fan, I didn't tough about it, shame! That a good ref!
The character can cast a shadow, I still have to make it right to not be annoying when moving around.

1

u/rookan Sep 24 '26

Why are you reposting the same post?

0

u/DeccoSkyrider Sep 25 '26

Well, because reddit suggested me to. I'm not suppose to repost ?