Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / An Indie Approach To Procedural Animation

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th May 2014 00:08
David Rosen, founder of Wolfire Games, gives a speech on how he implemented procedural animation in his most recent project "Overgrowth":
http://www.gdcvault.com/play/1020583/Animation-Bootcamp-An-Indie-Approach

The concept is so simple, yet produces amazing results. I had no idea you could create a walk animation with that level of quality using merely 2 keyframes.

I wonder how his method would work if you required more detailed animation between keyframes? I suppose you could just blend those details on top...

TheComet

Your mod has been erased by a signature
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 20th May 2014 15:32
That's interesting. I haven't tried moving bones in DBPro is it hard to do?
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th May 2014 15:44
Quote: "That's interesting. I haven't tried moving bones in DBPro is it hard to do? "


If your model is rigged, it's as simple as:


DBP doesn't support animation blending natively, so you'd either have to use a plugin like Enhanced Animations, do it through a vertex shader, or simply write your own blending code.

TheComet

Your mod has been erased by a signature
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th May 2014 15:55 Edited at: 20th May 2014 15:57
Watched this last night, thanks for posting it.

I have done procedural animation in AGK. I want to take it further at some point when the right idea comes along
Procedural Spider


Edit: I though you were banned for life TheComet, or am I getting mixed up?
Edit2: Ha ha never mind, just saw the other thread

Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 20th May 2014 16:03 Edited at: 20th May 2014 16:04
So just by moving a limb the whole mesh deforms on its own? How do you get the distance of deformation from each limb?
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th May 2014 16:14
Quote: "I have done procedural animation in AGK. I want to take it further at some point when the right idea comes along"

That spider is pretty cool! Sucks if you have arachnophobia.

Quote: "So just by moving a limb the whole mesh deforms on its own? How do you get the distance of deformation from each limb?"

If the model is rigged, DBP will consider each skeleton bone to be a limb, so by rotating it, you're effectively transforming the vertices assigned to the bone, along with all children.

The distance you can get by using Pythagoras Theorem: d^2 = x^2+y^2+z^1.

TheComet

Your mod has been erased by a signature
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th May 2014 16:24
I like these videos, followed Overgrowth since the start, they have slowed down a bit with the dev videos, but it's worth looking back at them all.

To do this sort of thing in DBPro, I think the best bet would be to get your model rigged and ready to go, but with no animation frames. Then use interpolation and limb rotation to pose your character. Once the animation is in your own format, it's much easier to expand on it - like adding springs and tolerances. And by doing it that way, you can effectively swap it out for a ragdoll, much easier than trying to ragdoll a model that is already keyframe animated.
There's lot you can do with this stuff once the basics are in place - for example having a pivot foot - so when a foot is on the ground and the player is turning, it pivots on the actual foot rather than the center of the model. Lot's of little things we can do to make our stuff more organic.

Yup, these videos can be very inspiring.

I am the one who knocks...
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 20th May 2014 17:56 Edited at: 20th May 2014 17:57
Could you load a rigged model in one pose, and the same model in another pose, and then store the second pose limb positions, and delete the model, then IK from one pose to the next just by using x1 to x2, y1 to y2, and z1 to z2 progressively?
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th May 2014 18:51
Quote: "Could you load a rigged model in one pose, and the same model in another pose, and then store the second pose limb positions, and delete the model, then IK from one pose to the next just by using x1 to x2, y1 to y2, and z1 to z2 progressively? "


Oh right, that's what you meant with "distance".

The answer is: Yes of course.

If you do want to do it yourself, a good starting point is to learn how to slerp. This usually involves rotation matrices, or these days more popularly, quaternions. This allows you to linearly interpolate between any two angles.

You'd have to account for transforms as well as rotations, but that's just some simple vector math if you're using linear interpolation.

As David says in the video, you will want to use more complex interpolation algorithms such as a spline to make things look more natural.

But why go to the fuss of calculating that yourself when you could just set those two keyframes within your modeling program, and let DBP interpolate between them using the animation commands?

The benefit of doing it yourself only comes when you have multiple tracks of animations layered over one another. For instance, if you have an animation of only the legs doing a running movement, and another, separate animation with arms flailing, you can blend the two together to form a combined animation.

That's what Enhanced Animations allows you to do, and it will probably run a lot faster than any DBP implementation.

TheComet

Your mod has been erased by a signature
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 20th May 2014 18:59
Quote: "But why go to the fuss of calculating that yourself when you could just set those two keyframes within your modeling program, and let DBP interpolate between them using the animation commands?"


I didn't know that DBPro had the commands to do that.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th May 2014 20:12
Quote: "Could you load a rigged model in one pose, and the same model in another pose, and then store the second pose limb positions, and delete the model, then IK from one pose to the next just by using x1 to x2, y1 to y2, and z1 to z2 progressively? "


Kinda, but you'd really want to work with angles, like using a traditional skeleton, you would rotate the hip, knee, and ankle for a walk cycle for example. If you were to just offset the limbs, you wouldn't have the rotation, so the model would deform and the limb offsets assigned by the modelling program would confuse matters a lot. I would have a standing pose, then rotate the limbs with code... heck, you'd probably get away with just having a single walk frame that way - because you could just mirror and loop the same standard frame... like if the right leg is forward and the left leg is back, the opposite frame is just the mirror of that - with control over limbs it's possible to cut a helluva lot of corners. If you start with a straight standing pose, it's much easier to predict the limb angles and add IK etc - because any animation in DBPro is included in limb rotation, and allowing for skeletal animation's effect on the limb angles would be a real headache.

I am the one who knocks...
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th May 2014 20:24
Quote: "I didn't know that DBPro had the commands to do that. "


Oh it's easy! Skeletal animation is handled by DBP, so all you do is:


But as I've stated, the shortcoming is you can only ever play one animation at a time, and not blend multiple animations together.

Quote: "with control over limbs it's possible to cut a helluva lot of corners."


I wonder where the line should be drawn, though. Good animation tools can generate the curves David talks about automatically, so does the work being offloaded from the animator outweigh unnecessary work being generated for the programmer? Additionally, the more procedural animation you do, the less control the animator has, which is usually something undesirable (for the animator).

I think David's emphasis was more on offloading those "transition animations" from the animator, which I agree with 100% because those are a pain. His engine simply extended on that feature because he happened to be working on a physics based fighting game.

Your mod has been erased by a signature
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 21st May 2014 11:30
Quote: "Kinda, but you'd really want to work with angles, like using a traditional skeleton, you would rotate the hip, knee, and ankle for a walk cycle for example. If you were to just offset the limbs, you wouldn't have the rotation, so the model would deform and the limb offsets assigned by the modelling program would confuse matters a lot. I would have a standing pose, then rotate the limbs with code... heck, you'd probably get away with just having a single walk frame that way - because you could just mirror and loop the same standard frame... like if the right leg is forward and the left leg is back, the opposite frame is just the mirror of that - with control over limbs it's possible to cut a helluva lot of corners. If you start with a straight standing pose, it's much easier to predict the limb angles and add IK etc - because any animation in DBPro is included in limb rotation, and allowing for skeletal animation's effect on the limb angles would be a real headache."


OK so how are rotations stored? Can you get the rotation, and then IK between rotations.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st May 2014 11:59
The problem is that rotations aren't stored! - well not effectively as far as I know, there's some weirdness when checking the limbs direction.

Anyway, when you load in a bone animated model, all the limb rotations are at 0,0,0 - the animation is 'invisible', even if your looping a walking animation, you'd check the limb angles and get 0,0,0 all the time. But, if you rotate the limb, then that rotation is included, so if you rotate a hip by 0,90,0 - it'll probably be pointing to the left instead of straight ahead, and then the walk animation would be really messed up. That's why I'm suggesting that anyone rotating limbs with code should leave them un-animated, because working with an animation and rotation is a much bigger problem than working with just limb rotation.

For example, in an old game I made Operation:Invasion Evasion, I had a soldier model with full walking animations, but anything above the waist was left alone. Then, I made a little limbs poser program and posed the torso (back, shoulders, elbows, hands) to suit whatever gun they might want to carry. So the walking animations all work alongside the posed torso, meaning I didn't have to animate lots of different soldier models for different weapons, the soldiers could swap weapons. This also meant that I could turn and tilt the waist and back limbs to aim up and down, left and right, independent of the lower body and walking animation. To avoid eular hell, I prefer to limit rotations on a single limb to 1 axis, or at least only allow slight movement on secondary axis. Like, the knee might only rotate on the X axis - by limiting rotations this way it's easier to constrain them. I mean - you could work out what angle the knee would have to be at with simple trig, it greases the wheels for IK calculations if you like.

I think it's worth just loading up a bone animated model, and messing around with it's limb rotation, this stuff is very very handy to know, and not just for character animation. I mean a skeleton can be applied to any mesh, like a flag that waves in the wind dynamically and doesn't cost the earth in terms of performance, doesn't need a physics plugin - just a simple bone structure on a mesh and a coder who likes to experiment with this stuff

Heck, I've even used bones to lay a big patch of foliage over a terrain... used it to make a fully working hourglass (with sand trickling down), glass containers of liquid. And I use the limb positions for line intersect collision detection. Skeletons are very very useful things in DBPro.

I am the one who knocks...
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 21st May 2014 14:14 Edited at: 21st May 2014 14:16
Well I'd like to mess with this stuff when I have time. Currently I have Fragmotion, and I haven't tried anything out with it. I have tried Anim8or, and it works well, but you can't save anything out. Anim8or has a really nice mesh morph as well between meshes, and that doesn't use any limbs.

Mesh morphing I suppose is difficult?

I am making witches, and they walk, and fly on broomstick type things. I thought that flying would look cool with a morph between their flapping clothes rather than limbs. Flapping clothes are like a flag too.

I wish that there were a DBPro version of the video in the link. Animation in DBPro is interesting.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st May 2014 14:45
Mesh morphing is possible, but in DBPro it'd be so tricky and probably not very fast. I mean, even if your model has just 1000 polygons, that's up to 3000 vertices to recalculate per loop per character, and a lot of solid math to go with it. You might be able to step through all the verts and have them update nice and smooth, but you also loose the dynamic influences - if you aren't just interpolating vertex positions then things get much more complicated.

If you can filter out the vertices that should move dynamically, then maybe you could have the cloth parts as secondary animations. Like, if you have a set area on your UV map, then you can tell when a vertex is cloth, give it some tolerances - keep track of neighboring vertices and distances between them. It's not easy, but really that's what you'd have to do in DBPro - cut the actual number of affected vertices down to a couple of hundred, and constrain them. I'd only move the vertices positively along their own normal - then I'd make the skirt quite close to the body, and only extend the vertices out - that way they would be less likely to morph into the characters limbs. I'd make an array of all the affected vertices, hold the neighboring vertice ID's, velocity etc etc.

I am the one who knocks...
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 21st May 2014 15:14
I might morph the clothes in Anim8or and just use about 10 clothes objects. Then after I finish this project I'll make a test project for doing animation properly.

Login to post a reply

Server time is: 2024-04-24 03:10:50
Your offset time is: 2024-04-24 03:10:50