Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Idk what constraints you decided to use when programming the physics from scratch--but they are good ones implemented well! Doing this in a single weekend is even more impressive!

No engine deals with solving perfectly, thanks to delta-time, and from what I've seen in GDC talks, the most graceful undesired behavior is objects under constant collision slowly pushing into each other... as opposed to source engine boxes going crazy, skyrims ragdolls shooting into space, or at worst, no-clipping out of bounds. The fact you're getting 0 no-clips at the framerate of my poor old computer in a web browser is amazing honestly.

Funny story, I wanted to make a pinball game. If you run our game, you can see a cartridge called "Balatzee" on the shelf in the top left. Similarly it will spawn balls that drop and only wall collisions are implemented. The frame rate issues with love.js and my own amateur coding of constraints with 0 research meant having the game function well in a week would be impossible. You got waaaaaay farther than I did in less time! Seriously awesome job!

(+1)

This is my first time making anything resembling a game (unless you like playing with engineering simulations), so I appreciate it! 

I started with a pretty naive implementation where normal/tangential impulses are applied to velocity only, followed by a single position update which integrates velocity at each time step. This probably would've worked better for very small time steps, but at 60Hz it caused all sorts of no-clip issues, balls slowly sinking, balls being pushed through walls by other balls, etc. 

Apparently a solution for this is called sequential impulses, where you update velocity/position multiple times each frame to iteratively separate colliding entities, but obviously it hurt performance (I don't think it helped that I was using float64 for everything either). I ended up just adding a step right before integration where any two objects still intersecting will have their normal velocities clamped to 0 (I only did ball-wall intersections for the submission, but ball-ball also ended up working pretty well).

Your game looks so much more polished and like a game, can't believe you had time to squeeze my game into yours :P

(+1)

Thanks for the thorough explanation! I'll have to give it another go later. Maybe I can fix my broken sim and make it as cool as yours! :)