Imagine you wanted to make a massive simulation game with 100,000+ bodies such as Dwarf Fortress or Rimworld, or a massively multiplayer game. The JS Physics Engines out there right now aren't going to get you there because they're focused on realistic simulations. To get there you have to cut out the bloat. Typically JS Physics Engines made for games are called "Arcade" Physics Engines. When I ran MatterJS, arguably the most popular JS Physics Engine, I could only simulate 6,000 bodies before falling under 60fps.
ENTER: SKALE Arcade Physics Engine. 100,000+ simulated bodies at 60fps.
Because I am making a massive simulation game, none of the existing Physics Engines were meeting my requirements. Games like Dwarf Fortress and Rimworld don't need a lot of the bloat that slows those engines down, such as joints, compound colliders, or collision resolution involving complex shapes (those games only use AABB Rectangles and Circles), and much more. So I removed all that for scalability and used a data oriented design.
SKALE Physics is in Alpha but it works great for "Dwarf Fortress-like massive simulation games with only rectangles and circles". If you peruse the repo and browse the code you might also find it a useful barebones learning experience to create your own physics engine or fork SKALE Physics and extend it. Eventually I will improve it beyond an Alpha state but for now I'm on hiatus. The important part is it is already suitable for that SPECIFIC genre of game, seems to have no bugs, and is the fastest physics engine in all of javascript land even though it's a bit of a false comparison to compare it to physics engines bent on realistic simulations. The core is there but the API needs many more helper functions for ease of use.
https://github.com/Gabriel-xyz/SKALE-Physics
Clarification: I know Dwarf Fortress and Rimworld specifically don't have actual "physics", but imagine if you were making a game like those but wanted it to have actual physics but also a huge amount of entities. That's SKALE Physics.
Top comments (0)