Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native chipmunk integration #145

Closed
melonjs opened this issue Dec 12, 2012 · 16 comments
Closed

Native chipmunk integration #145

melonjs opened this issue Dec 12, 2012 · 16 comments

Comments

@melonjs
Copy link
Collaborator

melonjs commented Dec 12, 2012

I was discussion the point as well with Noel, but what about directly integrating chipmunk into melonJS ?

That will for sure break some APIs here and there, but this will bring the benefits of a complete and robust physic engine to manage collision, and has been proven as good enough to provide very satisfying performances (if you followed what @parasyte has been working on since last months).

Furthermore, this should (by side-effect) fix or help with current bugs and limitations like ticket #16, #38, #50, #103

@melonjs
Copy link
Collaborator Author

melonjs commented Dec 13, 2012

@Tokyonono
Copy link

I also recommend reading this article, it is really well written : http://nine-software.com/2012/12/box2d-vs-chipmunk-html5-games/

@parasyte
Copy link
Collaborator

Lots of updates to Chipmunk-js since I last used it: https://github.com/josephg/Chipmunk-js/commits/master

@parasyte
Copy link
Collaborator

parasyte commented Apr 7, 2013

With CocoonJS supporting native Box2d, we might consider using Box2d instead of Chipmunk. But I would actually rather have Chipmunk, because @Tokyonono makes an important observation in his article; Chipmunk is updated more often, and probably better optimized since it is directly ported from C. (And not a port-of-a-port)

I would be ok with writing a wrapper around CocoonJS-Box2d, if that's feasible. A single API for the best of both worlds?

On CocoonJS native Box2d; it's really impressive. Ibon demonstrated it during his presentation at GDC. The first demo was an iPad 3 running CocoonJS with Box2dWeb. The game was obviously slower than 30 fps. The second demo was the same game on an iPad 1 running CocoonJS with native Box2d. That one ran flawlessly smooth.

@Tokyonono
Copy link

1/ If the performance of Chipmunk is good enough, we don't have to switch to Box2D, even if it is better supported by CocoonJS. We have to think about the long term.
2/ iPad 1 ... who cares :-)

@parasyte
Copy link
Collaborator

parasyte commented Apr 8, 2013

Performance of Chipmunk-js on mobile is not terribly impressive, even on recently hardware. I fought with it last November while developing a physics-based game. You can read more on my blog. In particular the following posts:

10 rigid bodies and 10 constraints is enough to bring the frame rate down to about 40 fps (as I recall) on iPhone 4S. Not the most powerful of mobile devices, but if there's anything to take away from this experience, it's that native physics is more important than it first seems. (I would prefer native Chipmunk, but you make the best of what you have available!) My argument here is that Chipmunk-js performance is not acceptable on mobile for these reasons.

The iPad 1 demo was just to show that the performance improvement is exceptional. It's one of those things were you take the lowest common denominator, and beat the competition in every way just to make a point.

@Tokyonono
Copy link

I never ran any performance tests, if it is that slow with Chipmunk, we should consider Box2D, but I am really not a big fan of using dead projects...
I know what the point of using iPad 1 was, it is just that it shouldn't be a reason to choose one framework over another.

@parasyte
Copy link
Collaborator

parasyte commented Apr 8, 2013

I agree, and strongly prefer Chipmunk!

But discussing with @obiot last night, I think we came to the same conclusion; We integrate Chipmunk-js "officially", and write a wrapper for CocoonJS's native Box2D. In the end, we'll have a Chipmunk API which performs very well on CocoonJS for mobile, and Chipmunk-js for Desktop environments (where the performance of physics simulation in JavaScript is quite good).

@obiot
Copy link
Member

obiot commented Apr 17, 2013

@parasyte 0.9.8 too ?

@parasyte
Copy link
Collaborator

@obiot Good call. :)

@obiot
Copy link
Member

obiot commented Jun 13, 2013

postponed again, as end of June is in two weeks ;)

@truongsinh
Copy link

I wonder why this ticket was closed

@obiot
Copy link
Member

obiot commented Feb 11, 2014

because it was duplicated with #235

@truongsinh
Copy link

With basic math, I can see that #145 is lower than #235, i.e. #145 is older, i.e #235 was duplicated with this ticket, not vice versa. Or did I miss something?

@parasyte
Copy link
Collaborator

@truongsinh #235 supersedes this ticket, that's all.

@truongsinh
Copy link

oh ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants