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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.