views:

557

answers:

2

Hello,

I'm developing what it's turning into a "cross-platform" 2D Game Engine, my initial platform target is iPhone OS, but could move on to Android or even some console like the PSP, or Nintendo DS, I want to keep my options open.

My engine is developed in C++, and have been reading a lot about Box2D and Chipmunk but still I can't decide which one to use as my Physics Middleware.

Chipmunk appears to have been made to be embedded easily, and Box2D seems to be widely used. Chipmunk is C , and Box2D is C++, but I've heard the API's of Box2D are much worse than chipmunk's API's.

For now I will be using the engine shape creation and collision detection features for irregular polygons (not concave).

I value:

1) Good API's
2) Easy to integrate.
3) Portability.

And of course if you notice anything else, I would love to hear it.

Which one do you think that would fit my needs better ?

EDIT: I ended up writing an article about my particular choice, you can find it here

+2  A: 

You are right, chipmunk has been developed improving a lot of the places where Box2D falls down.

However, Box2D is definitely the more established platform and from my personal experience when making the decision of which engine to use, I found that Box2D had a much larger community following, so was easier to learn by example.

adam
I have found from personal experience that chipmunk tends to be a bit "quirky". Lots of hacks and tweaks were needed for me to get things right. Of course the same may happen if I were to go to Box2D
eviljack
+2  A: 

I use both, but when I can choose, I go for chipmunk, it has much better API, and was much easier to learn...

But that was because I learned it without need for a community, the manual is completly fine.

UPDATE: My current game is using Box2D, and I wish I used Chipmunk with it... Mostly because Box2D has two serious issues, that are exacerbated on my game: First, it has a REALLY OLD bug where objects "snag" on corners, my game is a breakout game, so when the ball is "rolling" along a wall, sometimes it snag and is flung away from the wall, lots of people asked why my game physics looks "random".

The other issues that Box2D have, is how it store objects, Chipmunk use a spatial hash, and Box2D use a binary tree, my game was having MASSIVE slowdowns in levels with lots of objects, I asked Erin (author of Box2D) the reason, and he explained that because Box2D uses binary tree, if you place objects in a grid (like I said, my game is a breakout clone! everything is in a grid!) the tree gets unbalanced, and Box2D slows down. The solution for my game was make some levels into a "checkerboard" pattern to avoid this problem.

So, for all tile-based games, I will just use Chipmunk, Box2D REALLY is unsuitable for those (because the "snag" on tile corner bug, and the slowdown bug with tile grid)

speeder
Actually I think not needing a community is quite nice, I started with Box2d today... I will evaluate both myself, and stick with the one I find the best :-), thanks for the comment!
Mr.Gando