Friday, October 5, 2012

Friday Video Mash-Up: BeamNG

As I mentioned earlier, BeamNG does an amazing job of simulating physics in video games.  Here is a video of it in action.



BeamNG offers some caveats in their description of their video: "If things seem too bouncy, please remember we're using real life spring and damper rates, and it probably looks wrong because nobody ever does anything this extreme with a real car".  For comparison, here is a real crash test:



So what do we notice when we compare the two?  I see two things:
  • In the real crash, the metal quickly deforms into a complex shape, and doesn't bounce around much after that, similar to the process of smashing an aluminum can.
  • In the real crash, there is some bouncing around of the thin metal on the outside of the vehicle.  The bouncing of these 'body panels' is visible immediately after impact but quickly stops.  By comparison, BeamNG does indeed seem to bouncy.
Let's look at a higher fidelity 'real' computer model and see if it can provide us any insight into what's driving the limitations of BeamNGs' physics.  Below is the Abaqus benchmark model e1, representative of a passenger car impacting a wall at 25 mph.  It has tens of thousands of points at which the vehicle crash is simulated. The simulation simulates half a second of impact, and the below video of it displays at 1/5 speed.


Same model, but with a cross section cut thruough it



Looking at this model, it appears that the rapid permanent set of the material happens in a much more realistic fashion.  This can easily be explained by the much higher levels of detail allowed by a model which does not have to run in real time.  But the body panels are still bouncing around!  Why is this?  For insight, I first looked at the Abaqus input deck to see what was being used to try to stop the body panels from bouncing around.  Specifically, what I'm look for is 'damping', the name for what keeps a bell from ringing forever.  Unsurprisingly, I found nothing: this model has no damping in it outside of the suspension.  Why would this model not include realistic damping to create a more realistic simulation?

The answer will be very familiar to FEA analysts who do significant amounts of work with explicit FEA solvers.  Damping of the kind typically found in structures is of a form that is proportional to the deformation of the metal, and as can be seen in the Abaqus Analysis Users's Manual ver 6.10, section 23.1.1, small amounts of this 'stiffness proportional' damping can reduce the stable time increment, i.e. how much time can pass in one simulation step without the FEA model exploding.  This reduces the speed of the simulation, and for a relatively minor amount of structural damping can reduce the speed of the simulation by a factor of ten or more.  So for an FEA analyst simulating a car crash or cell phone impact, not only is damping not going to have a very large effect over the very short time scales of an impact, it will significantly increase the time it takes to arrive at a solution.  This is why damping was left out of this model and why it behaves strangely.  Damping can be so hard to add to explicit FEA solvers that a typical approach is to just filter the results after the fact.

Which brings us back to BeamNG. In a recent interview, the developers spoke at length of the challenges faced by video game developers trying to do structural simulation in real time, stating that "Mass-spring systems have very bad stability, they tend to explode, and are very CPU intensive."  My guess is that BeamNG may have experimented with more realistic damping rates for more of the vehicle, but after noticing the massive changes in stability in their simulation removed most of it, leaving damping only in the suspension.

Of course, all this is nitpicking, and I wish them the best of luck in their ambitious endeavor.  If I may offer some unsolicited advice, I'd suggest that they be the ones to make the first game that uses their technology.  All the successful video game engines and rendering software that I can think of were noticed after the developers made an original product that captured the interest of the public.  Consider Pixar's RenderMan, the Doom engine, the Unreal engine, the Crytek Cryengine, and many others.  These may never have been used as widely had the developers of these engines not used their intimate knowledge of what their  technology can do to make something great.  Fortunately, it looks like BeamNG is already heading down this path, and I look forward to a new way to use my computer to simulate smashing things.

No comments:

Post a Comment