create a character that behaves like a human being

Hehe, here's my balancer dude after one day (I made the ragdoll before).
http://hatu.biz/walker/walk1.swf

raigans elegantly walking robots seem quite far away 😀
That made me smile 😆
cute
Very cute, like a drunk dude 🙂

@original poster: Take a look at iChalky game for the iPhone:
http://www.metois.com/iChalky/
It does exactly what you'r looking for. You will also find some physics explanations on the authors web site.
After watching the video about iChalky I set about creating a similar system using box2D. I noticed on the wiki it talks about maintaining a desired angle on a joint.

I've starting writing my own Game Engine within AS3, using the TestRagdoll example as a base for characters/ players.

Constructor for my Doll class creates all the bodies / Revolute Joints with
Code:
joint.enableMotor = true;  joint.maxMotorTorque = 0.0;
So that the Doll (all bodies) acts as a rag doll until the Game loop.

During the Game Loop I've used this code per leg and torso (bodies):

Code:
// ... Game Loop Begin ...
var angleError:Number = joint.GetJointAngle() - angleTarget;
var gain:Number = 0.1;
joint.SetMotorSpeed(-gain * angleError);
joint.maxMotorTorque(20);
// ... Game Loop End ...


angleTarget being almost 0.0 . The Revolute Joint motors now work to keep the legs at the correct angle to keep the player upright.

When the player's overall angle becomes too large angleTarget gets increased so that the player's legs stand apart more to stabilise itself.

(swf coming soon, once I get time to upload).
example swf!

I've now added Revolute Joint motors on the arms while the player is falling over. Which gets removed when the player is upright again.

No A.I. is at work yet. First step would to make the player more aware of all it's bodies and adjust accordingly. eg: Adjust arms to balance player rather than just stretch out arms fully.
aitken85, your work is impressive!
Thank you, I would have like to done more by now but I've been so flat out with work etc.

I have created a 2nd Ragdoll class, where the Player is standing side-on rather than facing forwards as the end product will be a side-scroller. But "he" doesn't stand up as well as the front-facing player atm. I'll post an example when it's working a little better 😀
well, really, you'll never get it good.

Use neural networks! Easy, fast, working. 😉
Is there an API for that? 😆

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