It's been a while since I updated. I've been rebuilding the inverse kinematics system for animation I mentioned a while back. Although it's a system hog, in the end it's way too useful to abandon. Normal animation (frame by frame, pre-made) would be very time consuming to do for every entity in the game.
So, like those big 3D games, I'm building a skeletal system that's mostly shared across all entities. This means I only animate that skeleton once and that animation can be shared across a number of characters (as long as they have 2 legs, arms, and a head). Using this system, I'd still have to hand animate that skeleton but it'd be much easier with inverse kinematics - moving the foot would move the thigh and shin accordingly whereas without IK, I would have manually reposition and re-angle the thigh and shin each frame. So i only really need to focus on moving the foot about. Of course, there do need to be a few constraints here. A leg shouldn't bend backwards for example, so I'm making angle limits on the bones of the skeleton.
It's all very boring to explain so I'll stop there, and post a ragdoll/animation demo later on. If my horrifically vague and inaccurate explanation of what IK fails, have a look at this video. The only part of that robot's arm that is moved is the bit attached to the wheel. The rest of the arm works out how to position itself from there.
UPDATE: Instead of manually doing the animation, I'll be taking a procedural approach. So animation will be worked out on the fly. As a rough analogy, I won't show it how to walk, instead I will explain the concept of walking to the computer and it'll work out how to place its feet and move.
Showing posts with label animation system. Show all posts
Showing posts with label animation system. Show all posts
09 March 2010
10 December 2009
How I learned to walk
There are a huge number of programs out there that allow you to animate something in 2 dimensions. Some of these packages are very very good at what they do, and others are mediocre. Some are inbetween in the same way that statistics tells us there are averages. But I need my animation system tightly integrated with my game. I'm sure I could do a very handy job at character and object animations using another editor, but the result wouldn't be quite what I wanted, nor would it allow me the excuse of trying to make my own animation system and throwing all the code at you for free.
It's been mentioned to me that I could possibly make money by selling the tools I'm making at the moment, and I'm sure I could profit a little from them, but I'd rather help the growth of the community of indie (and even big company) devs out there. As I've mentioned before - my tools are different and maybe they'll hit a niche somewhere that somebody appreciates (at the moment that niche is me). I hope so, although even if that wasn't the case I'd still make the tools because I enjoy making them. Plus now I get to see if I can make something that actually works better than paid-for software and feel all self-important.
Here are some mockups for you all. It might be beneficial to click on the pictures to enlarge them, but maybe your eyesight's really good and you don't need to.

Colours are not final here, and in fact I think it might be nice to have this interface themable (if only by colour). I already have a theming system half-coded up when I was writing the platform for my blog in Flash. Sadly I have since let the webs gather upon that project and opted instead to use blogspot. This is mostly due to the fact that it's one of the few ways I could get a free website.
For those of you dislike mysteries, I'll divulge a little as to the blending mechanism. Each animation has a priority of motion for each bone node. So you can specify that one animation takes prevalence over the leg nodes while another will control the arm motion. This way you can combine pointing at stuff with walking. You can set up nodes as weak controllers so they have low priority in the animation - they'll be used unless another animation that you're blending with has a different motion for those nodes. What if you use two animations with equal priority of bone nodes? I don't know. I might throw out an error to the user in the animation editor or perhaps gracefully fail and choose one animation over another automatically.
It's been mentioned to me that I could possibly make money by selling the tools I'm making at the moment, and I'm sure I could profit a little from them, but I'd rather help the growth of the community of indie (and even big company) devs out there. As I've mentioned before - my tools are different and maybe they'll hit a niche somewhere that somebody appreciates (at the moment that niche is me). I hope so, although even if that wasn't the case I'd still make the tools because I enjoy making them. Plus now I get to see if I can make something that actually works better than paid-for software and feel all self-important.
Here are some mockups for you all. It might be beneficial to click on the pictures to enlarge them, but maybe your eyesight's really good and you don't need to.

The animation editor
And here are some notes for the non-telepathic
The menu interface is much the same as the one in the level editor, save that now you get to see just how advanced the menu buttons can get as well as just how fricking difficult I make life for myself. Damn you, me.
So, quick notes, for the stuff I don't mention:
- The timeline of the animation is resizable.
- 1...2...3...etc. are time in seconds.
- The hands shown there aren't how I'd actually make an animation, but just an illustration of what's possible.
- The breathing diagram is draggable with the dots, and can also be edited by number input (not shown).
- The times, etc. given in exertion are also not the values I'd use in the game (I will be greatly accelerating the values so 3 minutes would actually be a few seconds as otherwise the effects wouldn't be very noticible). Each animation has a level of exertion that is applied to it - more hectic things like running or jumping around will have significantly higher exertion levels. The more the character is exerted the more likely they have to stop moving to catch their breath, pass out, or have a heart attack.
- You can search through these animations like in the other menus, I just haven't shown that here.
- The red background track colours respond directly to the colour of the bone nodes (the circles) in the character.
- The black silhouette is not how it will be shown in the actual system, I just couldn't be bothered to draw up something properly.
- You can group bone nodes together (shown here as arms and legs).
- I've left a subtle mention of animation blending in the bottom there while not showing anything of how this will work (aren't I mysterious).
Colours are not final here, and in fact I think it might be nice to have this interface themable (if only by colour). I already have a theming system half-coded up when I was writing the platform for my blog in Flash. Sadly I have since let the webs gather upon that project and opted instead to use blogspot. This is mostly due to the fact that it's one of the few ways I could get a free website.
For those of you dislike mysteries, I'll divulge a little as to the blending mechanism. Each animation has a priority of motion for each bone node. So you can specify that one animation takes prevalence over the leg nodes while another will control the arm motion. This way you can combine pointing at stuff with walking. You can set up nodes as weak controllers so they have low priority in the animation - they'll be used unless another animation that you're blending with has a different motion for those nodes. What if you use two animations with equal priority of bone nodes? I don't know. I might throw out an error to the user in the animation editor or perhaps gracefully fail and choose one animation over another automatically.
Subscribe to:
Posts (Atom)
