Jump to content
  • Advertisement
Sign in to follow this  
Wichu

Which 2D physics library to use?

This topic is 2643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm making a 2D platformer-ish game in C++ using SFML. I've attempted to program my own physics, but it's really basic and a bit buggy. As I'm planning on adding a few things that will require a better simulation anyway, I'll just use one of the available 2D libraries.
The game has an infinite tile-based procedurally-generated map. The map is mostly static, though some tiles can be affected by gravity - in this case, they only fall vertically and can't be pushed horizontally (could be simulated by giving them infinite mass, right?) and align back to the grid when they stop falling (they'd 'crush' any non-tile objects beneath them). Some tiles would represent liquids (water and lava); I'm not going to bother with fluid physics, so liquids can be assumed to fill each tile completely. I'm planning on adding air and water vehicles, as well as carts that run on tracks (other land vehicles would be impractical to drive unless I add slope tiles, which aren't a priority). Air and water vehicles will be editable in-game; one of the main reasons I want to switch to a better physics engine is so I can simulate propellers being placed anywhere on the vehicle.
The plan is to simulate the outline of the tiles using static edges (place an edge wherever a solid tile meets a non-solid tile), and use circles or 'capsules' for entities such as the player, enemies and collectables. Vehicles will consist of a bunch of polygons attached to each other.

Anyway, my question is which 2D library do you think would be best suited for me? I'm leaning towards Chipmunk at the moment; it seems to be quite lightweight compared to Box2D (I don't think I'll need any of Box2D's more advanced features).
Also, any comments on my plans, or advice on how to implement them?

Share this post


Link to post
Share on other sites
Advertisement
Chipmunk and Box2D are largely equivalent and either would be a fine choice. I would personally read (browse) the manuals and forums for each and decide based on which I liked better (as you'll be staring at those docs and asking questions in those forums quite a bit).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!