Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

This was very fun to play! I'm curious how you created those wire physics, definitely a nice touch. I wish there were more levels!

(+2)

I came up with the idea for a game involving messing with circuits a couple weeks back, so I searched for rope physics. I found this post and a couple others talking about Verlet integration. The basic gist is that Verlet integration stores only the current position and the previous position and calculates velocity from that, as opposed to Euler integration which uses a stored position and velocity. This has a number of benefits including more accuracy, stability, and simpler constraint code. It’s apparently used in ragdoll physics.

In any case, the wires are just an array of points using Verlet integration, constrained to have a certain distance, and colliding against the terrain (I just use 1x1 AABBs to represent each point). If you want to know more details the code is up on github (the relevant details are in src/main.zig), though the code is fairly messy: https://github.com/desttinghim/wired

(+1)

Thank you for the detailed and thoughtful response! I've been looking for something  exactly like this, this gives me a fantastic head start. To apply gravity, I assume you also add a downward velocity to the Verlet integration? 

(+1)

I just add to the new position each frame (though I cap the velocity). This has the same result as manipulating the velocity but allows me to decouple velocity components and gravity components, though admittedly I didnt make use of this.

(+1)

That makes sense! Thanks for the clarification.