Side View Rag Doll

I was going to use some machine learning and let the guy just teach himself how to walk. I found an article about using "stability" as a reward, and it learns as it tries to walk, without needing separate trials (no twitching?). Takes only about 20 minutes to get a nice walk going apparently... but thats for physical robots, with fewer joints.. which I'd suspect would make my problem easier since the "sensing" is perfect. The article is a little over my head though 🙂

I thought of a little cheat though. You can prevent the pelvis from rotating, which makes the biped pretty much impossible to knock over, while still providing a lot of freedom. I think if we do it right, players wont even notice. You can simply re-enable rotation if the character dies, or if you need to knock him over for whatever reason...

Without cheating, I got him to take a single step 🙂 I was so proud I finally got him stepping forward instead of toppling over backwards... its really ridiculous how many factors are involved when walking, I never even thought about it before. You need just the write amount of 'tension' or torque in each of the joints and you have to move them at just the right speed... and I'm sure if any obstacles came up you'd just be screwed.

Anyway, I'll look at these articles later. Thanks for the input guys! That spider man biped is crazy!
the fact that it takes a human brain a good deal of time to learn the optimal control strategy for walking should indicate the complexity of the problem 😉

the issue i have with learning/evolutionary solutions is that they require you to figure out a good parameterization of the problem (i.e which outputs to optimize based on which inputs), which as far as i can tell is just black-magic guesswork -- there is no methodology for determining the optimal set of inputs/outputs.
another option could be animated IK movement of the limbs, with just a few different movement scenarios, just like a raster sprite.

so you might have walk, jump, run, fall, get up, etc. all as pre-programmed movements. The game executes the movements and the body
moves according to the IK constraints, but it's not really interacting with the rest of the world on the physics layer. So if a rock rolls down a hill
and hits your character, you might have a sensor in that space in the physics layer that tells the character model to execute it's 'fall over backwards'
movement script.

Is it possible to set up box2D so you could have the character rig with IK but no other forces? I know you can turn off gravity, but you'd want to disable other stuff too, all you really want is joint constraints for the IK.
raigan wrote:
the issue i have with learning/evolutionary solutions is that they require you to figure out a good parameterization of the problem (i.e which outputs to optimize based on which inputs), which as far as i can tell is just black-magic guesswork -- there is no methodology for determining the optimal set of inputs/outputs.


Well... I was going to use "get to the other side of the obstacle course in as little time as possible" as the reward.... and if he starts squirming like a worm or running on all 4s because that's the fastest way... I could take away points if his hands touch the ground or... whatever. I don't think it's any more trial-and-error-ish than fiddling with the parameters by hand.

Anyway, I *did* manage to get some sort of zombie-walk going after much fiddling... he kinda stumbles a lot, and he's difficult to get going again if he falls... but it's a start!
ninjascience wrote:
another option could be animated IK movement of the limbs, with just a few different movement scenarios, just like a raster sprite.

so you might have walk, jump, run, fall, get up, etc. all as pre-programmed movements. The game executes the movements and the body
moves according to the IK constraints, but it's not really interacting with the rest of the world on the physics layer. So if a rock rolls down a hill
and hits your character, you might have a sensor in that space in the physics layer that tells the character model to execute it's 'fall over backwards'
movement script.

Is it possible to set up box2D so you could have the character rig with IK but no other forces? I know you can turn off gravity, but you'd want to disable other stuff too, all you really want is joint constraints for the IK.


Seems kind of like defeating the purpose of a physics engine. I'll probably end up using pre-programmed movements for walking, jumping, etc, but physical obje cts will still be able to collide with my character. In your example, if my character got hit by a rock while he was walking, I'd tell him top running the walk animation...then let the physics do the work (knocking him over) and then once he's on the ground, and I can execute the "get back up" routine.

Edit: I just fixed the problem with the neck too. I left the neck in because I like it (and it was too difficult add an option to remove it...stuff depends on it). So, what I did instead was simply attached the head to the chest! So it *looks* like the head is setting on the neck, but it isn't.
Edit2: I guess I didn't really think that one through. When you bend the head back the neck won't follow... but it's not really noticeable given the limited range of movement anyway.
Edit3: Try the new walking demo for yourself: http://www.sfu.ca/~mnb2/Biped.exe
This guy's unstoppable! (right click to create rag dolls)

Erin: It seems quite easy to completely freeze the simulation by throwing bipeds really fast into each other. The program is still responsive but nothing moves. I'm not quite sure if it's just my program or the physics... I guess I'll try repeating it in a different program later.

I guess I should limit the FPS eh...? Works nice on my other computer (must have vsync enabled) but this one doesn't...

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