Advertisement

Bone Animation, feedback needed

Started by May 10, 2020 04:08 PM
78 comments, last by Calin 4 years, 8 months ago

Once you have it walking, why not make it run?!?!
Maybe you are defining your problem in the wrong way.
The same logic should apply to running and jumping.
You should not code a walker, then separately code a runner, then separately code a jumper.
You need to define a something with two legs.

In my opinion, if you do not define a something with two legs and keep from there, you are defining the problem in a wrong way.

It is like saying that you programmed a car to move slow, but you can not make it run fast, or vice versa. Start by defining a wheel. Then define 4 wheels. And you are ready to go. This is simplified, but enough explanation/example. And i am not talking about OOP here, but AOP(aspect oriented programming). When i say to define a wheel, i don't mean to define a class Wheel in OOP, i mean to define a wheel inside your mind for AOP. 

Example - 
You have a body with no legs, but an array of bones. It can jump, it can move slowly, it can move fast it can climb, it can spline. You take an array of bones and you obtain all that comes with it.
 

It learned to climb brick walls from billions of years of try and error of climbing brick walls…NOT. We have bricks only in the last few thousand of years, not billions. The snake just knows what it has at his disposition, and finds a way to use it.

Look what a beautiful and elegant algorithm -
(YT video. Give it time to load)
 

 

Snakes “fly” too -
(It is a YT video give it time to load)

Advertisement

NikiTo said:
Once you have it walking, why not make it run?!?! Maybe you are defining your problem in the wrong way. The same logic should apply to running and jumping. You should not code a walker, then separately code a runner, then separately code a jumper. You need to define a something with two legs. In my opinion, if you do not define a something with two legs and keep from there, you are defining the problem in a wrong way.

I did not made it to the running because i had the issue of ragdoll falling on its nose occasionally and i did not know why, so i focused on that. I assumed my math is wrong, improved it, checked it… also made a good walking behavior instead that dumb state machine.

But nothing helped. I kept tipping over and falling to the floor, no matter what i did.

Finally i figured out the issue was Newton contact caching. After it refreshes contacts, it can happen they move from the front of the foot to the middle for one frame. And this means the foot can not apply so much force as the controller expects. Because humans are tall and their support polygon is small, this tiny inaccuracy is enough to tip over a second later. The ragdoll is doomed to fall, because there is no way to prevent it without making a step.

I fixed this issue with positioning the contacts myself, but at this time i already focused on GI and actually the ragdoll is broken because i changed too many things. So can't continue without spending weeks on this, and currently don't have time for that.

A similar issue was that i controlled joint motors with target orientation for the next frame. But because rotation angles are so small and quaternions can not deal with tiny angles robustly due to necessary normalization i had to switch to target angular velocity instead.
Such issues are really unexpected. You would think such tiny differences do not matter, but efficient balancing (meaning to move as fast as possible) requires really accurate simulation. No wonder toddlers need a whole year to learn it.

Ofc, we could solve such issues with cheating. By positioning the contact out of the actual foot balancing would become very easy (for me at least). Probably this is necessary for games, because they do not always aim for realism. Superpowers, moving unnaturally quick, etc.
But first i want to do it right so i learn it properly, and if i do it right it will look real without any need for animation. (And it could drive real robots :D )


There are many ways to tackle this problem. My approach is just one of many, but it certainly is not wrong. Ofc. i'd like to have a general solver that makes no difference between walking, running, or any other motion. But first i need to understand both physics and motion planning, and you can not write a solver for a problem you do not fully understand yet. The first step is done, which is the balancing controller that is general for running, walking and any upright motion of bipeds. (though, useless for snakes - but their motion would be easy to model in comparison)
Maybe i can replace the analytic pendulum model with some general solve of an optimization problem in a far future, but having hardcoded subcontrollers for walking, running, crawling or climbing could end up faster and easier to tweak for desired results. Downside is it wont work for animals without extra work.

If i was given the task to create ragdolls, i would start with defining a “naturally limited joint”. I will have a way in the program to add to it, or even pile over it other limits.

Naturally limited joint means, a human leg can not bend to the forward in the knee. This is a natural limit of the design.

Imposed limit from outside are the steps of stairs. Your leg can not physically pass through the marble. Ofc your ragdoll could attempt it and fall down. But you should be helping your ragdoll. We are not talking here about “learning” algorithms that require the ragdoll to hit an obstacle a billion of times in a row. We talk about intelligent design here, not evolution.

It still will have to learn but could learn guided by the algorithm, not completely randomly and unsupervised thrown into obstacles.

Then you add to every of the joints a start and an end. And every end of the joints can be both attached to a start of another joint or be a final end, for the case when humans want to walk on their knees.

When i have to program something complex, i lay in bed thinking about it for days. Then I paint it in Krita. Programming is the last part of the process for me.

The way you lay a problem in your head, decides how fast you will solve a problem on case you solve it at all.

When GPUs become so fast at Ray Tracing so nobody would bother anymore to use a good extremely optimized GI, ragdolls could still be an open problem. I told you you probably have more future in ragdolls than challenging Jensen.

JoeJ said:
No wonder toddlers need a whole year to learn it.

Time in the link -
Less than 30 mins after birth learns how to stay up.
(YT video, time in the link. Give it time to load)


Butterflies know how to fly at birth. And flying is even more complicated than staying up.
This is what AI/NN sellers would prefer to not talk about - the supremacy of intelligent algorithms.

NikiTo said:
If i was given the task to create ragdolls, i would start with

Yeah i did all those things in almost that order. But it is only a distraction from the real problem, which i realized only long after that.

I made natural joint limits, even the IK solver respects them and works around the limits… all nice, but useless for the task. Setting up a human skeleton is also some work and tedious data to work with.

Evolution has grown our bodies in a way that basic locomotion is possible without ever hurting a joint limit. Only exception is knees (or elbows), which is much more easy and just a single angle.
So, i would postpone all this work until later.

I f i would start from scratch i would do only a two body inverted pendulum model. Move the upper part to a goal ar swing it forth and back as fast as possible. That's simple, but here you'll see what's the actual problem actually is.
And you can focus on that with out skeletons and IK solvers and all this.

Then i would add just one leg, not two. And make it jump around.
Then add another leg, which breaks the correspondence to the pendulum model, so a need for IK solver for the mapping comes up. But it's still simple.
Finally add spine and arms…

I did those things only later, but it helped much more than working with complex full boby.

NikiTo said:
Less than 30 mins after birth learns how to stay up.

Quadrupeds have large support polygon and center of mass is low. It's easy for them.

Advertisement

NikiTo said:
When GPUs become so fast at Ray Tracing so nobody would bother anymore to use a good extremely optimized GI, ragdolls could still be an open problem. I told you you probably have more future in ragdolls than challenging Jensen.

I'm not challenging HW RT because it offers opposite strengths than my GI algorithm. Combining of both is the way to go, and both Jensen and i will be happy.

JoeJ said:

NikiTo said:
Less than 30 mins after birth learns how to stay up.

Quadrupeds have large support polygon and center of mass is low. It's easy for them.

Side subject palaeontologist here. First, humans are quadrupeds (vertebrate skeleton is a universal blueprint with variations). You probably mean ungulates. And they (ungulates) have a high cog and a very reduced distal skeleton (one finger, no muscle mass, just ligaments to transmit kinetic energy). Thus they can run fast and keep in a herd, making individuals difficult to distinguish. A uniform livery helps as well.

The reason why they get up quickly after birth is simply evolution: they'd be eaten by the predators if not. Those that didn't were picked out. Selective pressure and all that. Primates have just a different strategy, they occupy a different niche. Their new ones need care for a long time and learn a lot before they are self sufficient. But then, their exceptional ability to co-operate in a group kicks in.

But go ahead, i don't want to disturb the intimate togetherness :-)

JoeJ said:
center of mass is low

With these long legs, it is not as low as with the short baby legs.

Anyways. I only suggest you things and I raise a doubt in front of you. You decide. I don't expect you to change or adapt to me…

The problem with evolution is nobody can program it, repeat it or prove it.

In theory we have the survived ones who grew legs and lungs out of fishes.

In practice it never proven working.

A program - make a horse learn to get up fast on its legs, or it dies(being eaten). Run the program!
Ooops, it doesn't work. The simulation needs a trillion of horses to try to not stand up early or to try to stand up early. No mammal can breed 100 trillions specimens in order to feed your simulation irl. And remember, the deaths by being eaten are still there, so female horses must lay 100 000 eggs per month in order to provide the simulation with enough death-VS-alive try-and-error.

In your simulation you can attach a recompense and punishment to the progress, but you can not attach death and life to the progress.

In order to understand it - run a genetic algorithm in your computer. Easy peasy. But when a bad path is generated, instead of lowering some numerical value inside the program,….. break the computer in pieces.

Will it work at all?
When you connect the existence of the computer to the outcome of the program?
Will it work at all?
Restart the ragdoll until it evolves to walk. Repeat, but at every fail, break the computer in pieces.
It can not work.

And no matter how much i menace JoeJ with being eaten by a lion, he will not finish his GI faster. It is like comparing soft to wet. @joej , now you know it, take your computer with you to the zoo, open Visual Studio and jump inside the cage of the lions….. the fear for your life will help you find the best solution to GI. It is evolution!! Or you die. Then repeat again until no Austrians are left on the planet. Do we have a GI algorithm yet?

If you are not convinced yet, you should find plutonium from somewhere. Or put your head inside the microwave. The radiation will generate lucky mutations that could help or could not help you create a perfect GI. If it fails, we have many other Austrians to keep trying it.

Theory vs practice - the moment of the truth!

Put it extremely simply - death is not giving you enough time to learn.
Same way JoeJ said life is too short to program a ragdoll. Same way life is too short for evolution to work.

An example of a false positive -

A kid paints one regular cat and another cat with wings. Two animals on the same sheet of paper.
A deep expert takes the paper sheet of the kid and pulls a deep conclusion - The cat on the left evolved to have wings.

The kid - “No, silly! I just wanted diversity. Next, i will paint a cat with 6 legs”

This topic is closed to new replies.

Advertisement