Sign in to follow this  
finscn

An old question: Which 2D Physics JS Engine is with better performance in 2018 ?

Recommended Posts

I know there are some discussions about this topic.

But they are  outdated & too old.

Now it's 2018 , and some physics engines have been updated , and there are some new engines.

 

So , let's talk it again.

Which 2D Physics JS Engine is with better performance in 2018 ?

matter-js

p2.js

box2d.js with liquid

box2d.ts

planck.js

or someone else ? 

Share this post


Link to post
Share on other sites
10 hours ago, GideonSam said:

Matter js for me

There is a test I created:

http://fatidol.com/phy-benchmark/

( NOTICE: There are many different box2d.js projects , I chose https://github.com/flyover/box2d.js (& ts ),
Because it includes Google's LiquidFun , I like this feature.)

 

Matter.js is the  worst , both performance & correctness

 

Share this post


Link to post
Share on other sites

I agree that box2d.ts worked pretty well, but when I tested it, the ranking was box2d.ts, matter.js, p2.js, and plank.js, which had like 8 frames per second. (I can't deal with constructors though, so box2d.ts is out of the picture.) Thanks for the test though, I was going to choose plank.js.

Share this post


Link to post
Share on other sites

I'd take benches with a pinch of salt, I tried this on my newer Macbook and got generally worse FPS than the ones mentioned on the page. For me, both box and p2 had similar fps, 40-50 (box slightly higher), planck was 10-20, matter reported 30-60 (yes, a wide range) but looked about the same as planck, both box and p2 looked super smooth. p2 was the only one that regularly 'glitched' 1-2 boxes into the circles.

Perf is only part of the overall pie though, and probably not a huge percentage of it.

For anyone starting a new project and needing some physics chops, take a look at the api, sample code, community and run a few of your own tests (as close as possible to what you're building) before jumping to conclusions.

Share this post


Link to post
Share on other sites

the problem is more of what kind of computer hardware do you target because results will be very different if your test machine is the average laptop with a crappy proc or a higher end dev machine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.