Post news Report RSS Creating the Overgrowth physics engine

Here is some background on how we developed the physics engine for our upcoming game Overgrowth.

Posted by on

Lugaru physics

Ragdoll physics played an integral role in the gameplay of Lugaru -- much of the strategy consisted of arranging fights so that Turner falls on soft surfaces and his opponents crash into hard ones. The ragdoll physics in Lugaru were based on Newtonian particles connected by rigid stick constraints, as described in this paper. This method worked to simulate basic physics efficiently and robustly. I created a physics editor that allowed me to load a model, quickly set up its stick skeleton, and then simulate it and test it out. Here is what the Lugaru ragdoll looked like when held up by some stick-ropes:

Ragdoll hanging

False starts

This method could not handle hinge joints or rigid body collisions, so I looked into some alternatives for Overgrowth. I tried a number of different ideas, from an extended point-constraint model based on the old Lugaru approach, to a medically correct musculoskeletal simulation. These ideas turned out to be wrong for Overgrowth -- the point-constraint model could not be efficiently extended to traditional rigid body primitives, and the musculoskeletal simulation was too complex to be stable with large timesteps. They weren't a complete loss however -- I learned a lot about physics simulation, and my point-constraint work ended up providing the foundation for the ragdoll physics in Cube 2: Sauerbraten, a great open-source FPS game. Here is a picture of some of the ligament constraints in my musculoskeletal simulation:

Skeleton

Middleware libraries

I knew that we would need basic rigid body collision detection and response in Overgrowth, and I didn't want to try to reinvent that wheel myself. Middleware libraries I looked at included Newton, ODE, Bullet, Physx, and Havok, and chose ODE for several reasons. First, it is free and open-source -- this is important because it means I can go in and make any changes we need for Overgrowth. Second, it is well-documented and well-tested: it was used in big projects like Stalker, Titan Quest, and Elebits. On the other hand, while Bullet is not quite as mature as ODE yet, it is improving faster, and may be better in a couple years. This is a stress test of ODE physics I did in an older version of Phoenix (it has some fancy shadows because it is a tech demo, and I didn't care about compatibility and scaling issues):


We also looked into Euphoria, but not only is that not a physics engine, it's not even a product -- you basically hire their programming team to work on incorporating dynamic physics animation into your engine. This is extremely expensive, and not necessary when we can implement the same techniques ourselves.

Beyond middleware

While middleware physics engines handle basic collision detection and response, there is a lot left that they don't handle. They only do one thing -- when they are passed a set of rigid bodies, they determine what happens in the next timestep according to the simulation rules. It is up to us to figure out what rigid bodies to pass in, and what to do with the simulation results (apply damage, create sound and particle effects, etc.). My next step in the physics engine is to create a materials system that can handle collisions between different surfaces: a metal sword falling on a stone block should be a different kind of collision than a body falling into snow. This feature was already built-in to Lugaru -- are there any new features you would like to see in the Overgrowth physics engine?
(permalink)


Track us on ModDB (see our cool page)
and also join:
- Facebook
- Steam
- Twitter
- YouTube

Post comment Comments
pfannkuchen_gesicht
pfannkuchen_gesicht - - 520 comments

Is it possible to dynamicly break "bones"?
I mean, If the ragdoll falls down from a very high point and collides with the floor, will a bodypart break? like in RL?

Reply Good karma Bad karma+7 votes
Dra6o0n
Dra6o0n - - 534 comments

Then all you need to do is disable that part from functioning? But it might mess up gameplay since alot of the actions seems to be linked to body as a whole...

Reply Good karma Bad karma+1 vote
jeffr Author
jeffr - - 383 comments

That would be pretty hot. I am not sure if we will have time for that, but I hope so! David made a game back in the day called Soul of Steel where you could shoot robots and if you shot them in certain body parts they would be disabled in certain ways. E.g. shooting one leg would cause a limp, shooting both legs would cause them to crawl. Shooting their arms would cause them to run at you, arms wobbling helplessly, etc.

Reply Good karma+1 vote
MrMazure
MrMazure - - 223 comments

"shooting one leg would cause a limp, shooting both legs would cause them to crawl." that was in soldier of fortune 1 too :D

Reply Good karma Bad karma0 votes
chris_sloany
chris_sloany - - 2,830 comments

damn, this type of stuff takes a lot of patients.

Reply Good karma Bad karma+1 vote
revengous
revengous - - 165 comments

soft body collision?

Reply Good karma Bad karma+2 votes
Armageddon104
Armageddon104 - - 3,128 comments

Cool!

Reply Good karma Bad karma+1 vote
Otreum
Otreum - - 767 comments

I've love to see euphoria physics in overgrowth, it would be brilliant seeing all sorts of different reactions from punches, kicks, throws etc

Reply Good karma Bad karma+1 vote
jeffr Author
jeffr - - 383 comments

When we told them that we were indie, they basically said "sorry, you can't afford us".

Reply Good karma+2 votes
Daystranger
Daystranger - - 327 comments

They can do all this stuff themselves.
Euphoria just gives you some pre-coded stuff.
I've made similar thing myself. I can give you a link if you want.

Reply Good karma Bad karma+1 vote
PierreOfTheFrench
PierreOfTheFrench - - 320 comments

I've been following the Overgrowth news segments and such since the blood effects and I think it's going to be amazing. The updates are great and provide an extremely interesting view on how you go about developing your game and its greatly appreciated. Keep up the great work! I was wondering where one would go if they wanted to look more into the programming aspect and such of developing your own game/engine. Thanks :)

Reply Good karma Bad karma+1 vote
BunnyJen
BunnyJen - - 886 comments

Awesome stuff!

Reply Good karma Bad karma+1 vote
Kamikazi[Uk]
Kamikazi[Uk] - - 1,412 comments

You guys work so fast. Everytime i look on moddb you have a new post. Great work yet again love these posts really informative.

Reply Good karma Bad karma+1 vote
Dragonlord
Dragonlord - - 1,934 comments

I have to disagree with only one point and this is Bullet. It develops helluva fast. The current version has a lot of features including some which I did not put to use yet ( up to come ). Furthermore it's an in-source solution ( so no .so you link against you compile it straight in ) which makes it easy to modify. So it is definitely worth a look and is already now a viable solution. Looked into ODE at the beginning too but it takes a lot more reworking than a Bullet based solution.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: