Game Development Community

My first real work in over a year...

by Jacob Dankovchik · 10/05/2007 (11:49 am) · 5 comments

Wow, been quite a while since I've really been around here and done some real stuff. I've only tinkered in tiny bits of projects past since I joined the Navy. However recently I had to get shoulder surgery. It seems that when I injured my shoulder years back throwing a shot put, I had managed to tear a few ligaments off my shoulder bone. Now, much later on, the injury worsened and came back to haunt me. So now, I'm on leave for 30 days to recover and I'm finding I have much more time than usual.

With all this time to sit around and think, I decided I wanted to start working on an old idea of mine, procedural animation. I found some work done in the forums a while back to allow you to turn off player animations and manually move individual nodes. This was all I needed to get started.

My idea for the animation is that the "artist", who will actually just be a programmer at this point, will be able to write a script file defining the animations he wishes to use. In this file he will also assign weights to each node. For the animation, it will use a vector of the direction you wish to shift the node, with a magnitude that will be the force you wish to apply. I'm modeling this idea conceptually use Newtons as the force unit. You will also designate how long this force is to be applied.

After you put all that in for the animation, when it's called everything will be calculated out. Take the force, divide it by the weight of the node supplied, which will conceptually be kilograms, and you'll have the acceleration that your node will undergo. So, you apply that acceleration to the requested node for the duration of the animation, as input by the programmer.

I've not even really begun to scratch the surface on this, of course.. So far I've just worked it out on how you go about accelerating a node. With that very very basic starting point established, I plan to move forward soon and begin writing out the code to perform all the calculations required. After that comes planning my architecture for my script files and how to handle the animations. Then, bring it all together.

There are many possibilites for this and I'm very exciting to get started. More to come, if this should go as I hope.

#1
10/05/2007 (12:16 pm)
Sounds very interesting. The so-called demo scene - with its procedural content and super-small application sizes - has always amazed me.

Keep us posted on your progress.
#2
10/05/2007 (1:59 pm)
Hey Jacob, you probably found and looked at John Klima's post from a while back. I recently started doing some of this sort of thing (not exactly what you're talking about) and I'd just like to nudge you in the right direction. John mentions using the MaskNodeHandsOff mask, which is actually what you *don't* want if you want to be able to use animations and procedurally change them, essentially blending in your procedural changes(for one thing, hands off will not set *any* default rotations or translations, so your node transforms will have garbage in them which is not very nice). What you want to look at is the TSCallback class. Depending on what you need to do, you should look in animateNodes to see how it's used and possibly even move the callbacks to happen after the node transforms are converted into object space from bone-relative space.

Cheers!

Edit: Any chance of an update on your water shader? I couldn't manage to get it working from the older code that was there.
#3
10/05/2007 (3:27 pm)
Yes, I quickly noticed that HandsOff wasn't a good thing to use the instant I saw it in action. However due to my lack of experience in this area, I figured what will probably be the best course of action for me for now is to work out the animation to work exclusively by itself, then try to get it to blend with already made animations later. As with most things I do, this will be a sort of "learn as you go" kind of thing.

As for the water, I did manage to get it working properly. Took me a while, but I finally got all view angle and light angle calculations working as well. Someday here I'll have to clean the code up and post it.
#4
10/05/2007 (3:34 pm)
Well, it's really not too hard to get your own transformations working on nodes, and to have them do everything in cooperation with the normal animations. Like I said, take a look at the TSCallback class, that's basically what you want to use and it gives you everything you need to move the nodes around after the regular animation has already done transforms.

Cool, would love to see that code sometime. If you want some help with this animation stuff shoot me an email.
#5
05/10/2008 (9:41 am)
@Ross. What TSCallback class are you refering too? I cannot locate any reference to a TSCallback in my version of tge. can you point me in the right direction thanks alot.