Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

HTML5 best physics engine for mobile


Salah
 Share

Recommended Posts

Hi,

 

I started developing a HTML5 game with Box2d (without using editors), after I have developed 16 levels of the game (from total of 40 levels),

 

I found that the performance is slow on many mobile devices, I heard that Phaser physics engines are excellent on mobile, but I am

 

a little confused, should I redo the whole game on phaser framework? or I can just use the P2.js physics engine from Phaser to take

 

advantage of the code structure that I have built? or I can refine my box2d game performance without using any other framework,

 

any advice?

 

Thank You,

Salah Jaber

Link to comment
Share on other sites

P2.js is not the "physics engine from phaser". It's a separate Physics engine that happens to also be included in Phaser. Here is the link to the p2.js website: https://schteppe.github.io/p2.js/

But I don't think it will be better on mobile. Depends on how many objects you have and what collision events/detection you want.

Link to comment
Share on other sites

Are you certain that the slow performance is due to the physics - and not something else (e.g., rendering?) 

 

The reason I'm saying that is -- Phaser also has a Box2D physics engine and I'm pretty sure it works well on mobile.

I think the problem is due to physics, I have tested it without rendering, and it gives me the same FPS on Google Chrome mobile browser..

Link to comment
Share on other sites

P2.js is not the "physics engine from phaser". It's a separate Physics engine that happens to also be included in Phaser. Here is the link to the p2.js website: https://schteppe.github.io/p2.js/

But I don't think it will be better on mobile. Depends on how many objects you have and what collision events/detection you want.

Thank you for information, then, you think that the main problem is from the scene complexity, and not from the physics engine I have used, right?

Link to comment
Share on other sites

I think the problem is due to physics, I have tested it without rendering, and it gives me the same FPS on Google Chrome mobile browser..

 

I think regardless of whether it's Google Chrome's mobile browser, or some other mobile browser, rendering could still be (and I suspect probably will be) the bottleneck. For example, if you are rendering lots of different sprites on the screen without a sprite batch, the draw calls itself will probably cause a massive slowdown.

 

One thing you could do is try to do a stress test between your current implementation and Phaser. Maybe a few hundred objects of different images spinning around (or doing whatever computation you are using in your game) and compare and see if Phaser provides a performance boost. I suspect that the performance boost will not be from the physics engine (since it does use allow Box2D too).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...