2D Physics on Roblox

Yeah well, some people (@magnalite and I) have had so much free time in their hands that they created a 2D physics simulation via GUIs on Roblox:

First Half of Gifs

https://i.gyazo.com/1c7f8caf75d747eafb2183ce225adfc0.gif

Second Half of Gifs




https://i.gyazo.com/1b3484c6cc9375d8edbf5be2169493a0.mp4

It currently has:

  • Constraints (Rope, Ball and Spring)
  • Static and Dynamic Friction
  • Full GJK + EPA
  • Primitive Collision Detection for optimization
  • Spatial Hashmapping

Magnalite used GJK for collision detection so you can put any arbitrary shape for collisions. She made the detection part and I made the resolution part of the system.

In future, I’ll add sleeping parts and recursive collisions.

72 Likes

This reminds me heavily of incredibots

4 Likes

jaw dropped

6 Likes

That’s incredible! Really cool work :o

2 Likes

that was my first thought as well :stuck_out_tongue:

Seeing the problems is easy. But solving them is the hard part. Do you have solutions for the problems?

1 Like

Thank you for this actually, I was about to create some GUI related particles (upwards to like maybe 50 on the screen at a time? maybe more?) and I wanted to ask what the overhead for something like this is (ie, how expensive is it to calculate all this math as frequently as you are) and when do you start seeing it slow down?

Ok, so particles are a whole different story as they actually don’t interact with each other, there are no collisions which is what the most of the math is about in a 2D physics engine.

Which means, 1500 particles;
https://i.gyazo.com/274a97e4289920b6218a81b55aab6148.mp4

Longer mp4

https://puu.sh/sVwlP/cb194636f3.mp4

6 Likes

I optimized the engine even further and 361 active parts:

11 Likes

With the new lua vm and even more optimizations, it can now run 2500 active parts smoothly:
https://i.gyazo.com/8348d083c0f0682a7a2825c57e47da3d.mp4

18 Likes

Way to stick with it after 3 years! Lol cool to see your still putting in work. It’s looking good

5 Likes

This is really nice work! I wonder what it could be used for… maybe a spaceship game where you avoid the colliding meteors?

Can you make Hill Climb Racing with this?

1 Like

You can pretty much make any 2D game with this.

1 Like

I know I’m late but darnnnn. It’s amazing what math can do. You did this for fun? My head would explode.

Also you haven’t made a game with this?

9943D6E3-6D3E-4E2D-A9A0-5957390675FF

6 Likes

This looks epic!

Small question: Will this ever be publicly available?

1 Like

No it won’t, but if you want you can buy it.

3 Likes

May I ask what the price is/would be?

I’ve been looking everywhere for something like this. Ashamed its not public, because this is awesome!

There is another 2d game thats uncopylocked, I don’t remember what it’s called though.