Time for an update.
I've been working hard the last few days on getting the latest changes from the Box2D SVN source tree into our C# port. For those who have not been following the progress of 3.0, we are currently porting over Box2D SVN (bleeding edge) to C# and helping out
Box2DX (A C# port of Box2D) at the same time.
We are a team of 4 (Paul, Matthew, Igor (From Box2DX) and me) that port over the code, but unfortunately the others have been a little busy, so I did the latest major upgrade myself. Here is a overview of what is new:
1. Dynamic tree broadphase collider
Box2D implemented a new
broadphase collider that uses a dynamic tree algorithm. They have always used the SAP (Sweep and Prune) collider because it was mature, fast and stable. They finally upgraded to a new broad phase collider that is faster than the old one (in most cases -
sometimes slower). There are no "magic" algorithms that can make everything super fast, it is a matter of developing an algorithm that fits the highest amount of users. (in terms of performance).
I really like the new broadphase since it makes the structure of the engine a lot simpler. There might be a lot of issues because it runs at a very low level (to get the most out of it) and thus not very fitting for C#. Thankfully I have the help of Igor
and he will probably hook it up with a lot of unsafe code (unsafe = low level) to make sure it runs as fast as possible in C#.
2. The basics only
Another big update is that Erin (Box2D creator) decided to remove all user contributions from his engine. This is both a good and a bad thing. It is good because it simplifies the engine a lot and it means that we will get more updates since Erin has to
update less code. The bad thing about this is that the workload was shifted to us - but then again, we can include only what we think should be included.
Will get a basic physics engine - just like we planned from the beginning - and then we can start to include all the features that makes a physics engine easy to use. (All the tools besides just simple collision detection)
3. More flexible
Flexibility is one of the goals in this engine. It means is that everything should be up to the users and if they don't like a certain feature, it should be possible to turn it off. After playing a lot with the source code I've identified certain areas where
we can make it more flexible. Example: In the new engine you will be able to increase the performance at the cost of accuracy - more than normally.
Also, exception handling and other debug-related code will only run in debug mode. This will further increase the performance of the engine, but make it harder to debug once released.
I can tell you that the new engine is really nice once you get to know it. With the help of Matt, Paul and Igor I'm sure we will get a fast and accurate physics engine. I know everyone is asking one question in their head: "That's nice, when can we
have it?". Unfortunately I can't answer this question right now, but I can tell you that we are close to have finished the initial port. (stage 1 out of 3 stages)
Once the next version of Box2D is out the door, we will be the very first to have an engine based on the release. Then stage 2 (features, tools, refactoring and API changes) and stage 3 (Optimizing the code, minimizing garbage) will start and hopefully our
first release of 3.0 will become a reality.