create a character that behaves like a human being

Hi *

I apologize if my question is answered in a previous topic but I have browsed all 48 pages of the "general discussion" and I found nothing.

For my needs I have to to create a character that behaves like a human. Starting with something very simple: At least, when there is no input from the user, the model has to stay in its feet.

My starting point was the "Biped Test" from testbed.

When you comment out the

for (int32 i = 0; i < 8; ++i)
{
.....
}

block in the BipedTest.h then you have already a pretty nice human-model but when it touches the ground, it doesn't stay in his feet.

After 1'' every part of it lies on the ground as if he is a dead man.

I changed a few things in the source, including the frinction of every body of the model (I set it to 0.95f) but with no result.

can you please advice me?

I am sure a lot of you have already done something like that before

thank you

theodosis
What is it that you mean by "behaves like a human"? Normally animation is done with animated sprites.
I attach some screenshoots taken from the modified "Biped Test" testcase of the testbed. ( by comment out the section for (int32 i = 0; i < 8; ++i) {...} in Testbed\Tests\BipedTest.h)

1. Image
2. Image
3. Image

In picture 1 we have an actor standing in his feet. He stays in this vertical position because I hold his head with the mouse.

When I release the mousebutton, he falls to the ground as we can see in 2 and 3.

How to define the bodies/joints of the actor in order not to fall so easy to the ground ?
You don't. If I hit you with a tranq dart, you'd fall to your feet pretty quickly. Making people stand up requires active feedback, and it's not easy, or else we'd have bipedal robots in real life. You could lock your biped to be completely rigid, but that seems to eliminate the point.

It's easier to apply pre-built animations, and external forces to keep the body from falling over. The vast majority of games nowdays don't even use ragdolls during normal gameplay, they only create one for death animations.
Yep Boris hit the nail on the head, it's very complicated to program a muscle feedback system, although I think some pre-render applications can do it.

Nice faceplant though...
It seems you are absolutely right. I didn't think it this way.

Even in the real world a man without applying any force to its muscles is a dead man and fall over the ground.

It is out of the scope of the physics engine to make the body breath. I have to search it outside of this forum.

If anyone knows something about it (where to apply forces or whatever else should be done) and will to share it with me/us it would be appriciated.

thank you.
I don't know about 2D, but in 3D you may look at the Euphoria Engine. Bear in mind it is neither Open Source nor free.
Boris lies.
Gta4 uses something like this. (Orm mentioned it)
There's a video showing all possibilities:
http://www.naturalmotion.com/euphoria.htm

It's not hard to implement it really, but you'll face some problems. Your body is going to be 2D, which will make it harder!

First step is to create a body with some advanced structure. Lost of joints..durr...
Then you'll try simple movement, and then maybe you'll make him stand!
Good luck, I hope you success!
Impressive video.

I actually said it was hard, not impossible. Considering this is a advanced piece of expensive technology, I think the point stands. 2D does make things easier, but the fundamental problem remains.

I am also not convinced that those dolls don't have external "hoisting" forces to help them stand upwards. They never promise that everything is physically correct, just that they use physics for their procedural animation system. When they've taken a blow, and recover from bended knees, it doesn't look to me to be 100% physically plausible. But it's hard to say.
I also think they are "cheating" with the Euphoria NPC. At the very end the model bows, but its legs stay perfectly vertical. When a human bows their legs angle backwards and they stick their butt out, to maintain a balanced CG over their feet. The model acts like its feet are glued to the ground - it just bends at the waist. So I bet Boris is right - they are tethering the character like a marionette to maintain pseudo-balance, and the "AI" is simply moving the feet to straddle the CG point as projected onto the ground. I'll have to play around with that technique sometime, because it should produce what appears to be actual balancing with a very simple algorithm. Notice that the model never actually walks. It only responds to external forces pushing it around.

Original thread: https://box2d.org/forum/viewtopic.php?t=3994