8 ms·
Box3D, an open source 3D physics engine
- HexDecOctBin 3mo agoI do wonder how it compares against Jolt. Both seem to have a good pedigree, one from Valve and Eric Catto, and another used in Horizon games.
- deleted 3mo ago[deleted]
- sph 3mo agoI am excited for Box3D because it’s written in C so it will have ergonomic bindings for other languages such as Odin. Someone tried to bind Jolt to C and then Odin, and the result is not very enjoyable.
- RobLach 3mo agoBox2D was a foundation for a lot of interesting physics oriented indie games in my day. I wonder if the landscape is empty enough for a resurgence.
- flohofwoe 3mo agoThere weren't many free and open source 3D physics engines to begin with. The ancient forefathers are ODE, Bullet and Newton Dynamics (all first released in the early 2000s), then nothing(?) for nearly two decades until Jolt in 2021 and now Box3D. Any addition to this small and exclusive list is very welcome :)
- badsectoracula 3mo ago> ancient forefathers are ODE I remember trying this back in 2004 or so when i was making my first real 3D game engine, but i ended up abandoning it because i was trying to use it on 64bit Linux and the source code had typecasts between pointers and (32bit) ints all over the place :-P. That was fixed later and apparently the engine was used in a few commercial games during the 2000s and early 2010s.
- bananaboy 3mo agoWe used ODE on Barnyard (released 2006 but started maybe two years earlier) https://en.wikipedia.org/wiki/Barnyard_(video_game) https://en.wikipedia.org/wiki/Barnyard_(video_game)
- bee_rider 3mo agoThere’s some ODE/more dimensions/PDE pun in here, for somebody better than me in physics or at least funnier.
- mikulas_florek 3mo agoNVidia made PhysX open source in 2018, and it was free to use before.
- tapirl 3mo agoFull List Of Open Source Physics Engines: https://www.tapirgames.com/blog/open-source-physics-engines https://www.tapirgames.com/blog/open-source-physics-engines
- artifact_44 3mo agoPhysx and Havok have been around for a while and dominate in the games industry for a huge class of games since they are integrated in Unreal and Unity. On the web alone, there is also: ammo.js, - a wasm port of bullet cannon.js, - a hand rolled engine oimo.js, - an older hand roll rapier.js - a newer hand roll jolt.js - a newer engine based on the engine used in horizon zero dawn. physx.js/wasm - nvidia wasm port of physx havok.js/wasm - microsoft endowed wasm port of havok (used in babylon) I've been in the space for a while, and anecdotally, PhysX is the most robust, stable, and vying for speed with Havok which is slightly faster, but makes some different accuracy choices for speed. ammo/(Bullet) was one of the earliest serious engines to make it to the web. r.e. - Box3d - Erin Catto is pretty legendary in the physics engine scene for (box2d).. it has powered a huuuuge number of games that many of us have likely enjoyed... So I'm definitely gonna keep my eyes on this one!
- erwincoumans 3mo agoMakes me feel old, as original Bullet creator.
- mangogogo 3mo agoi remember being hooked on Incredibots back when that was still a thing! that was how I heard about Box2D way back.
- thederf 3mo agoWell hello random IncrediBots-remembering person! Such good times with an oddly wholesome and welcoming community. I spent many of my teenage and early adult years trying to replicate it in HTML5. Finally got the Open Source version of IB2 largely ported during COVID: https://github.com/JoshTheDerf/Incredibots-2-HTML5-Open-Source https://github.com/JoshTheDerf/Incredibots-2-HTML5-Open-Sour...
- jackb4040 3mo agoThis is so cool! I also tried replicating Incredibots during the pandemic, but abandoned it in favor of 3d stuff. I remember every day as a kid logging on to find new vehicles, challenges, rube-goldberg machines. Some content archives are still online, but don't scratch that itch as an adult. For its time, Incredibots really nailed the sweet spot between expressiveness and ease to create content.
- mangogogo 3mo agothis looks like amazing work, i'll be checking it out. thank you
- Salatiel 3mo agoIt's so cool to see people talking about Incredibots here, I also learned about Box2D from it back then, and it immediately came to mind when I saw the Box3D samples app.
- actionfromafar 3mo agoI used Chipmunk2D a little back in the day, found it easier to use for whatever arcane thing I was doing.
- turkeyboi 3mo agoBox2d was somewhat recently rewritten in c and the api is improved, fwiw.
- adamrezich 3mo agoBox2D is still pretty darn good! Definitely recommended for 2D physics game projects. The C APIs for Box2D and now Box3D are just so nice to work with.
- minraws 3mo agoI feel like Box2D, was pretty good for the time, I didn't feel like it aged quite as well, mostly because where the solutions built internally went, but hoping box3d is great for it's time as well, would love lots of fun physics engines.
- a1o 3mo agoHave you tried the latest Box2D (it started as the experimental Box2c)? It’s pretty good afaict. It may not be what you want specifically in your 2D game, as often people prefer more arcade-like mechanics than the physics it tries to deliver.
- minraws 3mo agoI have been using an in-house/handrolled physics engine for the last few years so not sure if something has changed, but being able to modify the physics engine for arcade or other non-realistic style games was a big let down over time as well. Basically optimizing your game for feel was quite hard with Box2D in general. For a long time there wasn't deformers in Box2D (not sure if it's in there now), I hacked by own but I was a dumb 17yo and it was a horrid mess back in the day. Maybe AI could do better than the old me, but I gave up pretty quickly after not getting good results. So basically lack of support for non-rigid bodies and lack of easy customisability made it not age well for someone like me. But I know people who have had performance issues with it when building large maps/worlds as well so there are other issues. Again all of these could have been fixed if they paid more attention to it, more dev time, but it was free so I couldn't really ask for more as a broke student. And best part was you could run it on any hardware, I remember cooking up a small 2d demo on a rpi back in the day. Fun times.
- a1o 3mo agook, so you haven’t tried box2c, there are some posts about it in the blog https://box2d.org/posts/2025/04/box2d-3.1/ https://box2d.org/posts/2025/04/box2d-3.1/ It became the current box2d implementation, now after version 3.0, it was entirely rewritten in C, it works differently.
- nasso_dev 3mo ago> On the Valve side, Rubikon continues to evolve and Dirk has developed optimizations (similar to those in Box3D) in a new engine called Ragnarok. Look for that in future Valve games. wait....
- cr125rider 3mo agoValve Box3D 3D 3 Hope!
- deleted 3mo ago[deleted]
- InsideOutSanta 3mo agoConfirmed.
- jayd16 3mo agoHalflife 2D confirmed?
- dude250711 3mo agoConfirmed, released, and already forgotten. It was called "Codename: Gordon".
- maplant 3mo agoDon't get your hopes up, it'll be used in deadlock's volleyball game mode
- dym_sh 3mo agoBox>:3Drawr
- alex_suzuki 3mo agoSome years ago, I used Box2D from Python to get a couple of bodies moving naturally in a 2D plane, lightly disturbed by random impulses (like water lilies in a pond when it's raining). It was a fun project and working with Box2D was pleasant. Looking forward to using Box3D!
- tancop 3mo agoi love that we went from bullet being the only real option for open source 3D physics to jolt, rapier, avian, nvidia physx and now box3d.
- dude250711 3mo ago> ...native physics engine (called Chaos)... I have to say, based on those videos, that is one accurately-named engine.
- 999900000999 3mo agoI went ahead and wishlisted his legend of California game. Probably won’t use Box3D, I’m not a fan of low level programming. I will look forward to the abstraction layers above it
- neals 3mo agoMade look up some of my game stuff from back in the day, but the apps are not in the store (after 15 years, to be expected) oh well...
- LoganDark 3mo agoI first heard of Box3D when s&box loudly ripped out the Source 2 physics engine in favor of it (along with ripping out all cross-platform rendering code, etc). Nice to see it really is open-source now.
- gafferongames 3mo agoYeah this library is great. Use it!!!
- gafferongames 3mo agoWho the fuck is so petty to downvote this. Shame on you. This is a great library and Erin deserves your support. https://github.com/erincatto/box3d https://github.com/erincatto/box3d
- yunnpp 3mo agoProbably people who don't register the name. Your comment adds nothing and is the kind that always ends on the bottom of the thread, so you shouldn't take it personally. Great website, though. I'm fixing my time step all day.
- gafferongames 3mo agoAll good. I'm just trying to support my friend Erin.
- ajdoingnothing 3mo agoI love your articles. Used some techniques almost 10 years ago for hobby projects. Box2D/3D would make physics synchronisation a lot easier.
- gafferongames 3mo agoThank you. I agree, Box3D is great! Maybe Erin will even add rollback determinism at some point. That would be a huge step forward for network physics rollback!
- dustbunny 3mo agoHey Glenn, what do you mean by 'rollback determinism'? Is there some particular thing missing from Box3D now that makes it difficult to synchronize with solely the inputs? My reading of Box3D's docs is that it has 'cross platform determinism', and 'recording/replay'? Isn't that sufficient? Synchronize inputs, determine if inputs were 'mispredicted', if so, rollback the physics world, apply the changed inputs and resimulate? Just for context: I implemented state-sync netcode into box2d in 2018 and shipped multiple real games using it - and I work on netcode professionally. I'm planning on adding full netcode support for box3d and releasing it as part of a larger framework. https://box2d.org/documentation3d/md_simulation.html#autotoc_md152 https://box2d.org/documentation3d/md_simulation.html#autotoc...
- utopiah 3mo agoI'm a bit familiar with Rapier (and before that Cannon and Ammo) so how does it compare? PS: FWIW made my own physics engine in 3D space just few weeks ago (and shared it here). OK ok ... it's just a 1-liner that brings an object down at regular interval but it's surprising how well it works already! I recommend you give it a go as from a learning perspective it's really fun.
- MomsAVoxell 3mo agoOh I'm so ready for this.. I've had some success with Box2D in the past, it's well and truly one of the top bits of F/OSS out there. Box3D-based Spectre VR? It's so happening. (Shades of Tanarus ..) EDIT: holy smokes, the transition to recording and playback in the Legend of California demo (Unreal Engine-based) is quite a jarring leap. If you at first get the impression things are quite basic, be sure to get into at least 18:00 into the demo video, it gets pretty wild .. recording and playback is awesome.
- RubberSpoon 3mo agoI think of Tanarus all the time, I rarely see anybody mention it.
- MomsAVoxell 3mo agoI do too, it was something I played solidly for about 6 months and then life changed and it kind of disappeared, but it was really a fun game. I’d love to play a modern version.
- dom96 3mo agoFunny to see this just a few days after I’ve started building a Tron-like 3D game for the browser using Jolt[1]. So far Jolt is working pretty well but I’ll certainly be taking a look at this. 1 - I’ve been sitting on this domain for years: https://lightcycles.io https://lightcycles.io
- tapirl 3mo agoAbout Jolt, do you mean https://github.com/jrouwe/JoltPhysics https://github.com/jrouwe/JoltPhysics ?
- ivanjermakov 3mo agoYep, there is a WASM build with full feature support: https://github.com/jrouwe/JoltPhysics.js https://github.com/jrouwe/JoltPhysics.js
- vmg12 3mo agoI open sourced a wasm build that has better typescript support here: https://github.com/snackdotgame/jolt-ts https://github.com/snackdotgame/jolt-ts I also have an open source character controller for it https://github.com/snackdotgame/jolt-ts-character-controller https://github.com/snackdotgame/jolt-ts-character-controller I'm a big fan of jolt because they have a more incremental way of snapshotting physics state which really reduces the amount of serialization and memory you have to do if you want to implement deterministic netcode.
- ivanjermakov 3mo agoNice! JoltPhysics.js is quite finicky with typescript, having to have global variable Jolt of type Jolt and using that as a namespace.
- dom96 2mo agoNice, thanks for sharing! I'm definitely hoping to make use of the determinism for my netcode, if you have any useful write ups about that I'd be interested to read more.
- jackling 3mo agoGlad to see the release, Box2D has some of the best code I've ever read. It's interesting to see that Box3D was originally a fork of a physics engine made by Dirk. Dirk is one of the best presenters in GDC, and so influential in Physics Engine space, nice to see how he's continuing to push the latest and greatest forward.
- adalacelove 3mo agoPhysics simulation is a dangerous rabbit hole. Even if you focus just on rigid bodies and just physical plausibility there are plenty of open problems related to collision detection and collision resolution. Convex approximations and/or decompositions for geometry and hand tuning of solvers are the norm, balancing robustness and precision against speed.
- kidfiji 3mo agoI remember reading about it in S&Box's (Source-2-based game engine) blog a while back - glad to see it released out to the public!
- Jeaye 3mo agoYes! This is exciting to see. Erin Catto is such a cool hacker. Thank you, Erin, for sharing your code with the open source community. There wasn't anything about determinism in the announcement, but I'd really love to see some more about that, too. Trying to use Unity's built-in physics to make a networked billiards game is quite troubling, when none of the clients can happily agree on what happened.
- tikotus 3mo agoI was looking for the same thing. There is a replay mechanism, so it seems to be deterministic. But with floating point physics, not across platforms. Though -ffast-math is unsupported according to the documentation, so maybe it is intended to be deterministic across platforms? https://box2d.org/documentation3d/recording.html https://box2d.org/documentation3d/recording.html EDIT: Clarified meaning about ffast-math
- tikotus 3mo agoAh, found more: https://box2d.org/documentation3d/md_simulation.html#autotoc_md152 https://box2d.org/documentation3d/md_simulation.html#autotoc... "Box3D is designed to be deterministic across thread counts and platforms." This is absolutely fantastic!
- qwery 3mo agoPhysX itself (assuming Unity still uses PhysX, but any major physics engine will be the same) is unlikely to be your problem, although it is possible that Unity compiles it with undesirable optimisations, or some aggressive multithreading strategy, etc. In any case, it's quite likely that the physics simulation is not being initialised with identical state on each instance, so the physics engine -- even if it claims to be deterministic -- cannot be expected to arrive at the same solution across instances. From the scripting layer atop Unity (et al.) you are essentially out of luck. You don't have the requisite control/access to guarantee the simulation input is consistent. To expand on the "quite likely" variance in the simulation input, there's an unending list of possibilities, so just a couple of points: Unity is really really big and complicated. The physics engine in Unity is not primarily there to be a FEATURE: physics engine. It's a general purpose collision system, and it's fundamental to Unity's whole world/scene/components. It's always running. Stuff that has nothing to do with what you see as your simulation can affect your simulation. My unopinionated advice is: read Glenn Fiedler's classic networked physics articles[0]. My opinionated advice is: you're making a game where the physics is the whole game. It's also a very nicely contained problem space. Write your own physics simulation. It's gameplay code. Also, typical rigid body physics engines certainly can do a billiards sim, but they aren't actually that good at it. [0] http://gafferongames.com http://gafferongames.com
- tikotus 3mo agoOh, nice! What a wonderful surprise! Very easy to build, and quite small. A release build of the library is 916K (on macos at least). I have a game engine that compiles to WASM for web, and having 3D physics has been a challenge. 3D physics libraries tend to be large and hard to compile. I didn't try yet, but compiling this into a WASM library with emscripten should be easy, and it's likely small enough to be justifiable for a simple web game.
- lukan 3mo agoHave a look here, this guy maintains a wasm build of box2D https://github.com/Birch-san/box2d-wasm https://github.com/Birch-san/box2d-wasm And Catto said, Box3D is very similar to Box2D.
- gregsadetsky 3mo agoWhenever I see Box2D mentioned (the library by the same author as Box3D, obviously), I think back to this story from many years ago https://kotaku.com/this-guy-created-angry-birds-physics-and-all-he-got-was-5906541 https://kotaku.com/this-guy-created-angry-birds-physics-and-...
- tikotus 3mo agoI used to work at Rovio (the creator of Angry Birds). Everyone was telling the story of a talk given by Peter Vesterbacka, the head of marketing. When it was time for questions, a man from the audience asked what physics engine the game uses. Vesterbacka gives the correct answer, Box2D, to which the person replied with another question. "Why isn't it mentioned in the credits? And by the way, I'm Erin Catto, the creator of Box2D." To this Vesterbacka replied "Come talk to me after the show". Maybe that's when Erin was given the hoodie? Also, his name was soon added to the credits. But one thing amazed us all. It was impressive that the marketing guy knew which physics engine was used!
- gregsadetsky 3mo agoTo the larger point, do you know if Rovio did support/pay Eric in any other way than that hoodie? Angry Birds generated $500M [0], supposedly. I would also not be surprised if the Rovio developers, designers, testers, etc. who worked on this game did not get a share of that $500M pie - I actually assume they didn't. But still, you know. Dare I say it - what about "fairness"? :-) [0] https://gameworldobserver.com/2023/02/28/angry-birds-2-revenue-500-million-rovio https://gameworldobserver.com/2023/02/28/angry-birds-2-reven...
- sosodev 3mo agoI find it odd how we frame fairness in regards to open source software. He licensed his software as MIT. It says anyone can you use it without owing the author anything. So how is it unfair? To be clear, I think that open source maintainers deserve much more, but I don't understand why we rarely inspect the licenses as the source of the problem.
- vardump 3mo agoGreat, now we can have Angry Birds in 3D.
- hdjrudni 3mo agoLove to see this! I got started with Box2D back in probably 2006ish. Great to see Erin is still working on this stuff. Thank you Erin for the great libraries!
- ainch 3mo agoAs an ML researcher, I know box2d because it underpins many of the standard reinforcement learning environments (in OpenAI Gym) that we use to benchmark methods, like Lunar Lander or Car Racing: https://gymnasium.farama.org/environments/box2d/car_racing/ https://gymnasium.farama.org/environments/box2d/car_racing/ Thanks to Erin for such a useful piece of software!
- jnurmine 3mo agoIt was delightful to see the Dzhanibekov effect in the "gyroscopic torque" part of the video.
- shevy-java 3mo ago> Chaos spinning rifle physics Well - simply see it as a feature. A horror game where poltergeists infiltrate objects. Stephen King even wrote some book about that, and that got a B movie too. Also shame on the Unreal engine to have such huge bugs and nobody fixing it. Still, I like the idea of horror movies more. Finally poltergeist makes a come back - it was a really scary movie when I was young.
- erwincoumans 3mo agoGreat to finally see Box3D released! Glad to see some healthy physics simulation options, next to Jolt, PhysX and https://github.com/newton-physics/newton https://github.com/newton-physics/newton (using MuJoCo Warp, which I've been pushing at NVIDIA). Bullet Physics author.
- tkfoss 3mo agoHi, many thanks for amazing work you did! I was wondering, how does Box3D compare to bullet for game engine integration, if you had a look at box3d?