Box2D 3.2
Version 3.1 was released about 16 months ago. I’ve been busy with Box3D and work, but I’ve managed to add a lot of cool stuff to Box2D. Also it has been heavily optimized and tested. Here I’ll cover the most interesting bits. The full details of changes are in the release notes.
Grab the new release at the repository.
Large world support
I followed Jolt’s big world approach of using double-precision for body positions. This allows the world size to increase from around 16km to 1000km with almost no loss of performance and very little added memory. All heavy math remains local using single-precision. I’m tempted to keep it as the default, but my attachment to single-precision has deep roots.
Recording and replay
I think this is more of a me feature than a you feature. It is the ultimate debugging tool for me. Users can make a recording, zip it up, and attach it to a GitHub issue.
But this machinery also brings with it the beginnings of a snapshot and restore system, which has many exciting applications in games. This includes gameplay systems such as rewind and networking.
Dynamic character mover
The dynamic character mover is something I’ve wanted to add to Box2D for many years. It is finally here and ready for testing. I even made a whole video on it.
Performance
My obscession with performance has a gotten a bit out of control. Version 3.2 has roughly triple the performance of version 3.1. When I saw this number I couldn’t believe it. So here is a breakdown of what changes made it faster:
- Contact recycling (~40%)
- Solver algorithm refinement (~20%)
- AVX2 runtime dispatch (~15%)
- Solver optimization (~10%)
- Broad-phase optimization (~10%)
These percentage gains stack! The math:
$$ (1 - 0.4) (1 - 0.2) (1 - 0.15) (1 - 0.1) (1 - 0.1) \approx 0.331 $$The future
I have a few ideas for future Box2D work:
- More efficient rollback
- More robust joints
- Improved support for Godot
- Maybe fluids?
I also want to spend more time prototyping games of my own. I haven’t done enough dogfooding and I enjoy making games.
And of course I need to get Box3D into beta.
Supporting Box2D
If you’d like to sponsor Box2D and Box3D development, you can sign up using GitHub sponsors or Patreon.
Thank you to all my generous supporters!
390 words
2026-10-17 17:00 -0700