Motor Physics: 50 dancing boxes
June 15, 2007 on 5:25 pm | In Actionscript, Physics | 10 CommentsThis is a follow up to the post about the SI-Solver from the Box2D engine. The revised demo shows a worst case scenario with 50 stacked boxes. It took great effort to max out performance, but I think it’s fast enough now, especially when realizing that the engine does a lot of computations each frame to make things stable (for example 50 sequential impulse computations per box). Performance is top priority, because a physics system which sucks up all processing time doesn’t leave room for rendering, AI and other game engine elements and hence is useless for more complex games.
I still see a lot potential to make it faster, probably in the range of 30-70%, but I won’t go into that for now. Instead I’m concentrating on putting the engine pieces together and adding forces, constraints and user interactivity. Enough with just bouncing stuff!
As a side note, I also decoupled the simulation from the frame rate (which I should have done a long time ago), so the physics attempts to run at a constant rate, which is very important for games. The example above is limited to 60fps so it tries to update the simulation every ~16ms. When the fps counter shows more than 60fps, there is still processing time available.
Looks beautiful! And no noticeable jittering while at rest, even when zoomed in. Nj
Comment by Nate Chatellier — June, 15 2007 #
Great work on that, I’m can’t wait till the day your engine will be released. tried some others, but yours will probably blow them away very quick…
Comment by Karol — June, 16 2007 #
[...] Be sure to check out the 50 boxes test with Motor Physics at Polygonal Labs [...]
Pingback by [ draw.logic ] Polygonal Labs Motor Physics Tests with AS3 « — June, 18 2007 #
Very impressive :)
Comment by Ash — June, 18 2007 #
WOW! Great job Mike, you never seize to amaze
I love it
Comment by Oz — June, 18 2007 #
[...] This demois about physics simulation. It uses AS3 at seams to be faster than APE. However it keeps using memory a bit. So i still thinking that it will be possible to decrease the memory usage. [...]
Pingback by Polygonal Labs Motor Physics Tests with AS3 « Flash Enabled - Get Ready With Flash… — June, 20 2007 #
[...] Polygonal New Flash Physics Experiment – 50 Dancing Boxes Published June 20th, 2007 Actionscript 3.0 , Web developer , Flex , Flash Polygonal is great Flash experiment author and physics engine creator. Great stuff always come out of his lab and this time he maxed out performance on pretty hard test of 50 boxes. Check it out on polygonal blog [...]
Pingback by Polygonal New Flash Physics Experiment - 50 Dancing Boxes « Cyberspace Nova — June, 20 2007 #
with the new Flash Player Update 3 Beta 1 I’m getting now 80fps (2.1Ghz P-Mobile, no Dual Core), that is an increase of 20fps. This is because rendering is now even faster using some sort of GPU acceleration, and it should be even better on dual core systems. Maybe someone could post their results.
Comment by Michael — June, 21 2007 #
Impressive!! Can you supply the source code?
Comment by Mat — July, 10 2007 #
Hi
As a fresh lab.polygonal.de user i only wanted to say hello to everyone else who uses this site :D
Comment by Zoompolioto — December, 19 2008 #