Basic IK through hinges achieved!

I finally got the formula right! Well, fine tuning is still needed, but I thought sharing was in order: An IK leg via hinges!

Move the lower part (the ‘foot’, I guess) using the arrows. The leg can even spin, using PageUp and PageDown!

I’m hoping others will experiment with the idea and post results. I always found it rather discouraging that I could not make realistic leg movement for game characters. With this, it should soon be possible!

a few problems:
-this is rather inefficient for the final results
-the GE already has IK
-the movements are pretty unrealistic, and not very possible to control
-all animations have to be done with IPOs rather than actions- little animation control

it’s good that you’re trying things out though, and thanks for sharing your results (don’t let me get you down XP)

nice try

what you are attempting to do is more something like procedural animation ! but there is too many part in your leg. try something with tree part upper_ lower and knee

Early stages. Also, depends on your desired results.

-the GE already has IK
AFAIK, no, it doesn’t really, and that’s my problem. I have discussed it heavily, and IK in GE does not allow rigs to react to anything outside the rig. And since parts inside the rig cannot be controlled independently during the game, you don’t have IK. You just have some nice standard actions, no real flexibility. It is one thing that certain people are criticizing the GE for.

-the movements are pretty unrealistic, and not very possible to control
I have no idea what you want to control, but yeah, there are still significant limits. However, you can add keyboard logic bricks to either the hip or foot end as you wish, and use it as you would IK in animation. But I have not put in a lot of advanced controls, that is true.

-all animations have to be done with IPOs rather than actions- little animation control
Neither, actually. Both actions and IPOs are useless when doing actual interactions; they can only do pre-programmed things. The purpose of my current work is legs that can act as real legs, without relying on pre-generated movement as in actions or IPOs. You move the legs with whatever logic you want your character to use, jus tlike real people. Except the legs themselves still look like crap :smiley:

Yep, procedural indeed. I want legs I can move any way I want, no reliance on IPOs or pre-programmed actions. And yes, there are still too many parts, but every time I take something out, things go flying about. Still figuring out how to trim it. Suggestions are MORE than welcome (that’s why I post it, after all :))

why don’t you want a ipo reliance ?

if the result is a character reacting with his environement ? I mean it don’t have to be real to look realistic. Look at the wrapped procedural animation in recent game i’m not sure it’s real but its look like the character grab a chair or move his feet depending on his environnement

Cognis: Have you checked out these python functions yet
http://www.tutorialsforblender3d.com/GameModule/ClassBL_ActionActuator.html

There’s some useful stuff you may find in these functions related to the action actuator, some of these functions I didn’t know existed.

Because it is excruciatingly unflexible. A single IPO can only be used for a single circumstance, or situations that are unusually like it. Walk cycles are simply out; if a character makes a sharp turn, whatever foot he is supported on simply spin with his center of mass! I need characters to put a foot somewhere, and as long as weight is on that foot, it stays there. It doesn’t matter if the other foot is moving forward, making a turn, kicking a ball or the character kneels down; the foot that carries the weight stays put. Think about nearly all first-person-shooters: If a character is running or kneeling, and the player turns the character, it looks as if the entire character is sitting on a turning table! This is useless to me in my current work. Feet have to be able to be put somewhere, and the legs and body move around whatever foot carries the weight.

I have considered using an IPO to simulate the bent knee, and simply have it turn along with the leg. The problem is, I have not figured out how to make sure that the thigh and shin bend so that the ankle and foot line up completely.

It has to be better than the games where characters are basically running in air while simply moving along the ground. It has to be better because it is for a machinima project, and if characters are not running on the ground, the point is basically lost. Sure I can do a walk cycle or leg IPO, but the character will simply be swinging his legs without any relation to where he is. Just look at when characters in games run into a wall and keep running, their legs keep ‘running’ as if the character is still going straight ahead! And when characters turn, the legs still move as if running in a straight line.

Add to that the needed flexibility for a character to hunch, crouch, kneel, sidestep etc., and IPOs as I know them are suddenly not so well equipped to handle the deal…

I sincerely hope someone proves me wrong. I am not trying to show off any creative abilities, I just want characters that do not look ridiculous when they run, walk, kneel, etc.

EDIT: Oh yeah, and I am having a hard time testing methods with bones. After all, I cannot see the bones when the GE is running the game :-/

I am getting pretty good at animation python, but have yet to cut my teeth at GE python. I have been trying to exhaust all standard options first. I may have exhausted those now, and will see how much I can understand of this. Thanks! (if you already know some Good Stuff, don’t hesitate to let me know, please!)

parts inside the rig cannot be controlled independently during the game
good point, I had forgotten that

I have no idea what you want to control
I have never seen an IK rig in which the algorithms alone end up with the intended result; often it’s necessary to rotate bones in the chain as part of the animation. Also, gravity and things bumping into the chain parts would effect them a lot more than is realistic

Neither, actually
even programs like euphoria, which do procedurally animate characters, work off of pre-made animations. do you think all the movements in force unleashed are generated during runtime? they’re just morphed and mixed animations. the processing power, never mind the sheer amounts of programming, to make a self-animated, fully functional AI is staggering.

Besides, IK is an animation technique- real people don’t put their foot somewhere and the leg muscles just make the leg follow, real people use FK. if you want procedural realism, FK is the way to go (not that I have ANY experience in that area, so take what I say with a grain of salt)

much of these arguments are irrelevant if you are making machinimia and have some sort of method to control the feet/hands/etc, but I digress.
[edit] eugh, I made a huge extension to this post, and then it crashed and got deleted. another reason why I should type my posts in a text program, in which I can save. to sum it up:
-GE python is much better than logic bricks for all but the simple tasks
-don’t expect to pull off anything amazing- games like crysis are just starting to do this
-if you make a separate animation for turning while walking, rather than just using the walking one, it looks fine (in other engines you can blend animations, and/or take control of bones manually- I’m currently looking into changing engines, possibly to panda3D which is also python)
again, you might want to look into FK ( use rotation on the joints rather then changing location of the end points). no solution will be easy (and look passable, that is) and ultimately the decision is up to you.
cheers ^^

Dear lord no, you are reading waaay too much into my work :smiley: The only thing I am going for here is flexible legs. I just need something that does not depend on me (or another animator/programmer/whatever) pre-generating every single relevant pose and movement. I just need the knee to bend without ankle or hip going out of place, that’s it. That, however, is not as easy as one might think…

real people don’t put their foot somewhere and the leg muscles just make the leg follow, real people use FK. if you want procedural realism, FK is the way to go (not that I have ANY experience in that area, so take what I say with a grain of salt)

True. Partly. Real people shift weight. I have my weight on one foot, then on the other. Sadly, I cannot reproduce that in the GE. I know, I tried. So instead, I simply need to move the feet and hip as separate objects, and have the knee bend nicely. ‘Simply’, yeah right :spin:

-GE python is much better than logic bricks for all but the simple tasks

Yeah… I’m starting to see that…

-if you make a separate animation for turning while walking, rather than just using the walking one, it looks fine

HISSSSS… be gone you minion of foulness!:ba:
Seriously though, that is basically saying “just prepare a separate animation for anything that the character might be needed to do”. If you just have to run, walk and turn, no biggie. Sadly, I would end up with hundreds of animations, each with dozens of variations, just to cover the basics… not practical…

you might want to look into FK ( use rotation on the joints rather then changing location of the end points).

Seems I’m damned either way… :no:

Nice work Cognis, this is interesting even if it is “early stage”. Please keep sharing your work!

Dude… iam realy looking forward to this… Keep your efforts Cognis!:slight_smile:
I wish i could help.:o

Oh hey Buck, I completely forgot about this thread. Blender is still busting my chops on this. I found another ALMOST perfect formula for doing really versatile legs, wide range of motion and all, low processor drag (I made 13 sets of legs dance around clumsily in one test, no drag on m laptop at all). But if you just let them stand, the tension set in the knee joints will build up slowly, until they start flying about. Only in perpetual motion do they work. If I turn OFF the tension, they get unpredictable, knees bending backwards and flailing.

It’s really close, but no cigar yet: latest version (play with buttons z, x, pageup, pagedown, and arrows!)
EDIT: Slightly improved version 6

I just thought of having the lack of motion turn off the tension, and having motion turn it back on, I’ll test that out (EDIT: I did, see above!).

Still, I fear it’s back to the drawing board. I am doing something with IPOs, seeing what comes of it. If I can get an easier way to preview bone ideas (bones are invisible in runtime, argh), I’ll check some ideas out there, too. Or maybe Python is the only way…

How’s your machinima angle coming along?

Actually, I have been trying to spread some awareness around the GE’s (and Blender’s) possible uses in far more complex animation, both game and traditional. The response has been sporadic, at most. But I am hoping to put together an idea group at some near-future point to explore possible paths that are easy to get done and could increase Blender’s uses exponentially! If I get a framework running for such an idea group, anyone should feel welcome; some have ideas, some know Python, some know Blender real deep, etc. Synergy should do some good, and Blender will get some extreme features!