I've been working on an arcade-style shooter using SDL for setup, OpenGL for graphics, Box2D for physics, TinyXML for data, and a custom component database system for object data.
Box2D was exactly
what I needed, and has been instrumental in the development of my game project! I don't do anything fancy with rigid bodies or joints, so my project doesn't really show off Box2D's power as a physics engine. However, Box2D has worked out fantastically as a collision detection and resolution system, giving objects "solidity", performing bullet hits, and collecting nearby objects for AI target scans and explosion splash damage. I'm using the revision 155 now, with a few customizations due to using pixel units. The game uses continuous collision detection for fast-moving bullets, and Box2D has definitely made development a lot easier. It runs quite fast even with a remarkably large number of collidable entities roving around.
I don't have a website for it, so I've been hosting files and images on my network-attached storage device at home and posting updates on my livejournal
. The images look blurry because I have 8-sample motion blur enabled.
I added a visual profiler a while back showing what portion of a 1/60th second frame each system uses. AI logic (using b2World::Query to find targets) is red, simulation (applying forces) is yellow, physics update (b2World::Step and processing contacts) is green, update (weapons, spawners, links) is blue, rendering (OpenGL commands) is purple, and drawing (OpenGL busy) is grey. Even with almost 500 collidable objects, Box2D consumes only a small fraction of a frame. The eight render passes clearly dominate the frame time.
I've been making playable builds (updated to build 43)
and source code (updated to build 43)
available. The playable builds unfortunately require the Visual C++ 2008 Redistributable Package
, but that only needs to be installed once.
I recommend running full screen for the best effect, using either -fullscreen 1 or pressing ALT+Enter. At some point I'll add a configuration file so this won't be necessary.
To change screen resolution:
-resolution <width> <height>