Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411432 Posts in 69363 Topics- by 58417 Members - Latest Member: gigig987

April 20, 2024, 05:49:40 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsCharacter Animator (with clever title eventually)
Pages: [1] 2 3
Print
Author Topic: Character Animator (with clever title eventually)  (Read 6181 times)
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« on: December 06, 2010, 02:55:41 PM »

Hello friends,

I'm working on some things for an animation class right now, and it occurred to me that I should eventually turn these things into a handy utility for indies.

The Idea

The general idea is this: the utility stitches together multiple images using hierarchical transforms, as in the "cut-out" style of animation used in games like Aquaria. The major difference is that here the individual images are actually mapped onto meshes which can be freely deformed using constrained optimization to maintain their shape and scale as closely as possible (given supplied constraints).

This gives you:

  • Squash and stretch, basically for free.
  • The ability to animate smoothly deforming objects like tentacles.
  • Bending at joints (like elbows or knees) without any breaking or discontinuous shearing of the underlying texture.

There will be support for a number of interpolation functions for animations (i.e., ease in and out) and IK. Ideally I'd like to add in some extra features, like dynamic relighting of sprites using optional depth information, but that's on the wish-list.

When you're done making animations, the utility renders output in the form of a sprite sheet with XML animation data.

The Motivation

Animation takes a lot of time, guys! I can't tell you how many walk cycles I've drawn, and yet they still take me hours to do. Cut-out methods reduce the time required to create animations, but the completely rigid joint structure isn't particularly aesthetically pleasing, and concealing discontinuities at the joints limits your character design options.

The goal here is to be able to draw a high-quality character once, and produce believable bitmap animations from that character. You also have the advantage of having your animation data divorced from your image data. Decide you need exactly 50% more frames in your running animation? No problem, just up the frame rate and re-render.

Having a utility to generate sprite sheets is far more generally useful than, say, a set of APIs, since the resulting product is automatically platform and language independent.

It will also be free! I hope this will really cut down on the time required to produce high-quality animated 2D characters. Ideally it should make reasonable quality animation feasible even within a game jam or compo time frame.

The Development

I already have some of the components for this, and I'm building the stuff for my class with the intent of leaving it integrable into this project, but there's really no timeline here. I'm super ultra busy right now, but I'll post screenshots and info when they become available. Ideally there should be something functional within a few months (depending on what else I end up having to do).

I'm also taking feature suggestions, if you have any really cool ideas or if there's anything about the animation process that's been bothering you that you think might possibly have a computational solution.
Logged

Formerly "I Like Cake."
ink.inc
Guest
« Reply #1 on: December 06, 2010, 03:47:08 PM »

I need this so, so bad.
Logged
Xion
Pixelhead
Level 10
******



View Profile WWW
« Reply #2 on: December 06, 2010, 06:32:53 PM »

do want badly
Logged

John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #3 on: December 06, 2010, 08:48:11 PM »

I made something similar a few years ago for a fighting game (

, download) and ever since then I've been fantasizing about making a more fully-fleshed-out one. Squash-and-stretch was definitely on my wishlist. But already your mesh idea sounds cooler than anything I had come up with.

I personally would prefer the API method over the spritesheet method. I like me some ragdolls and other procedurally generated/composed/blended animations, and I like having smoothly animated graphics without explosive memory requirements. But I understand that not everyone wants to deal with another API. Maybe one day I'll still make my own character animator for the crazy people like me who don't like spritesheets.  Tongue
Logged
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #4 on: December 06, 2010, 09:24:35 PM »

I mean, realistically it will probably be a C++ and OpenGL API before it's an editor, so there's no reason you wouldn't be able to integrate the source into a project.

The only issue would be that the mesh deformation uses an iterative solver which, although it converges quickly (according to the reference material I've got), probably isn't super fast depending on how many objects you wanted to use it on. Being able to render out to sprites is a good solution for people who aren't using C++/OpenGL or don't have the cycles to spare or don't want to mess around with shaders, etc.
Logged

Formerly "I Like Cake."
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #5 on: December 06, 2010, 09:26:06 PM »

I'm currently mulling over how I want to manage the interaction between mesh control points and bones in the skeletal system. It's confusing.
Logged

Formerly "I Like Cake."
dumbmanex
Level 1
*


Stay out of the water!


View Profile WWW
« Reply #6 on: December 06, 2010, 09:46:39 PM »

Very cool idea.  I've been recently thinking up methods of creating higher resolution art/animation at a quicker pace.  All I came up with is applying the 2D art to flat polys in a 3d program, animating what needs animating and make sprites from those.  Shrug

Ha, I've got nothing to add really, but best of luck on getting this working right, it'd be a hell of an asset.   NinjaHand Thumbs Up Right
Logged

John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #7 on: December 06, 2010, 09:51:38 PM »

Iterative mesh deformation? I'm intrigued!
Logged
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #8 on: December 06, 2010, 10:43:02 PM »

Yeah, well, subject to constraints on mesh points specified by the user, the algorithm tries to minimize changes in Laplacian coordinates of the boundary curve, changes in edge length within the mesh, changes in relative angle between mesh points and changes in global area. The problem is non-linear, so you need to use an iterative optimization method.

In principle it isn't that complicated. It's going to be kind of a mess to implement, I think, but I've got about a week to do that part. That's what I'm actually going to need to hand in.
Logged

Formerly "I Like Cake."
Zaphos
Guest
« Reply #9 on: December 06, 2010, 11:02:13 PM »

Are you following the as-rigid-as-possible shape deformation paper from takeo et al? ( I mean: http://www.moscovich.net/tomer/papers/rigid2005.pdf )  Hmm, actually I don't think they use an iterative method though ... they just split it into a few linear solves?
Logged
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #10 on: December 06, 2010, 11:33:13 PM »

I looked at that paper, but I wasn't happy with some of the results depending on the initial rest shape of the object, and I noticed there was crushing of some elements of the mesh when deformation resulted in large changes in the boundary curve, so I'm going with this one:

http://www.kunzhou.net/publications/2DShape.pdf

It seems to work well, by and large. I noticed a few issues in their video presentations, but I think it will be adequate.
Logged

Formerly "I Like Cake."
Xion
Pixelhead
Level 10
******



View Profile WWW
« Reply #11 on: December 07, 2010, 12:32:08 AM »

also, regarding:
Quote
I'm also taking feature suggestions, if you have any really cool ideas or if there's anything about the animation process that's been bothering you that you think might possibly have a computational solution.

stuff on the top is what I expect from these kinds of animation tools but, I dunno how you'd do it, but if something on the bottom were, if not easy then at least not impossible with some finessing, that would be too great.

Also, the ability to change the entire, or parts of, the source texture mid-animation. So I can, for instance, change a character's hand from open to closed, or have some more traditionally animated details within the larger animation (like clothes flapping, hand motions, facial expressions, etc.).

and, (one more, sorry) layers?
Logged

Zaphos
Guest
« Reply #12 on: December 07, 2010, 01:26:53 AM »

I looked at that paper, but I wasn't happy with some of the results depending on the initial rest shape of the object, and I noticed there was crushing of some elements of the mesh when deformation resulted in large changes in the boundary curve, so I'm going with this one:

http://www.kunzhou.net/publications/2DShape.pdf

It seems to work well, by and large. I noticed a few issues in their video presentations, but I think it will be adequate.
Ah, cool Smiley  I'm curious -- what libraries (if any) are you using for the non-linear least squares solve?  I was looking at this library a while ago but didn't get to try it -- http://www.ics.forth.gr/~lourakis/sparseLM/ ... (it's Levenberg-Marquardt not Gauss-Newton though.)  It looks like the paper probably used some sparse linear solver per each iteration of the Gauss-Newton, but I don't see them say the details explicitly anywhere.
Logged
RotateMe
Level 0
***



View Profile
« Reply #13 on: December 07, 2010, 07:29:00 AM »

Funny how the differential geometry class I had *last week* helps me just now to understand this paper. Amazing stuff, hope it will work out!
Logged
Dataflashsabot
Level 2
**


View Profile
« Reply #14 on: December 07, 2010, 09:18:59 AM »

FUCKING YES I NEED THIS NOW. Actually yesterday. Actually a year ago Sad
Logged
DanFessler
Pixelhead
Level 3
******


aka Indigo


View Profile WWW
« Reply #15 on: December 07, 2010, 09:46:16 AM »

toonboom anyone?
Logged

Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #16 on: December 07, 2010, 04:36:07 PM »

Responses, beep boop:

Ah, cool Smiley  I'm curious -- what libraries (if any) are you using for the non-linear least squares solve?  I was looking at this library a while ago but didn't get to try it -- http://www.ics.forth.gr/~lourakis/sparseLM/ ... (it's Levenberg-Marquardt not Gauss-Newton though.)  It looks like the paper probably used some sparse linear solver per each iteration of the Gauss-Newton, but I don't see them say the details explicitly anywhere.

With their method, you just need to compute G, the pseudoinverse of the matrix A, which is easy enough, and then b(V) is a non-linear function of V they describe in detail. Fortunately you can precompute G, so you don't need to do a linear solve each iteration or anything. I think I'll stick with the method they've got, unless I find I have convergence problems or something, in which case I might use Levenberg-Marquardt or see what else I can do. I don't know, we'll cross that bridge when we come to it.




You both will and won't be able to do this, ha ha. Obviously actually turning a limb out of the plane is impossible (and wouldn't look right anyway). You will be able to change bone length, dynamically, and by turning off global area preservation, you will cause distortions. Whether you'll be able to get things to go into perspective properly is another matter entirely, and until I have the mesh system and solver up and running (next week, I should think), I don't want to speculate. It might wind up looking okay for quick movements, and it might not.

One thing that I can stick on the feature wish-list, though, is an additional animatable FFD system. It would mean a lengthier setup for frames (depending on how many domains you were using and their configurations), but you'd be able to perspective warp parts of meshes, if you wanted.

Also, remember you can use this as part of a tool-chain. Since it generates bitmap data, you'll be able to go in and edit frames manually afterwards as well. If you want detailed and accurate shading, for example, you could draw colourmaps or silhouettes, produce all your frames, then paint shading on in Photoshop or whatever afterwards, or make minor adjustments. You'd still be able to do the bulk of your animating in a more automated, more interactive way, without having it look too computer-generated.

Also, the ability to change the entire, or parts of, the source texture mid-animation. So I can, for instance, change a character's hand from open to closed, or have some more traditionally animated details within the larger animation (like clothes flapping, hand motions, facial expressions, etc.).

Yeah, I had plans for this. The only issue is the boundary curve around objects that are being animated. If the animation is just a change in texture, and the boundary remains the same, that's trivial, but if you want flapping clothes or hand motions where the boundary of the shape is changing... well, I can definitely precompute meshes and operators for each frame in an animation, but the issue would be how to handle the fact that changes in the boundary might move user-defined control points out of the mesh as it animates.

For example, if you've got an open hand and you've defined a control point at the end of one finger, then the next frame the hand closes, where does that control point map to on the mesh?

The best I can think of is for frame data to consist of:

  • The texture image.
  • The triangle mesh.
  • The operator G for the solver.
  • A vector of offsets mapping the control points from the previous frame to their closest vertices in this frame.

Then you'd be able to successively offset control points every time the frame changes. I think that would work. I'll have to think about it.

Edit: if you have frames with vertex lists V and U, this is still a potential problem if |V|=/=|U| depending on the number of control points. Imagine you don't want a character's head to deform at all, so you select every vertex in that region as a control point. Then the head is animated to turn obliquely, the areas of the two frames are unequal and suddenly you have fewer vertices than control points. I'll probably just need heuristics to handle any extra cases. There might be unconquerable weirdness, but I hope it should work okay for typical use cases.

The verdict on this one is: definitely texture changes (with identical boundary curves), possibly animations including changes in the boundary curve, but I won't guarantee it's doable.

and, (one more, sorry) layers?

You kind of get this for free, since you can attach multiple meshes to different bones. If you don't want hierarchical transforms, you can just stick everything on to the root. You'll be able to specify draw order.

toonboom anyone?

The problem with Toon Boom (and basically every other animating package I've checked out) is that their support for bitmap images is basically just a rudimentary skeletal system. I don't even think they do FFD. They seem to have morphing only of vector images. Also, even their skeletal systems for vector images produce artifacts (if you rotate the leg of an outlined character at the knee, the outline enters the interior of the leg).

My goal is really to have something that's flexible enough to handle painterly art well.
« Last Edit: December 07, 2010, 04:46:36 PM by Chris Whitman » Logged

Formerly "I Like Cake."
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #17 on: December 07, 2010, 04:47:31 PM »

I just wrote my animation exam today, by the way, so I'll be starting work tomorrow in earnest.

Not tonight -- tonight I am going to go drink beers.
Logged

Formerly "I Like Cake."
John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #18 on: December 07, 2010, 04:52:21 PM »

You'll be able to specify draw order.

Can you change draw order mid-animation? It can be useful for dealing with handheld props, like a sword, which might be in front of the character at the start of a swing and behind the character at the end.
Logged
Chris Whitman
Sepia Toned
Level 10
*****


A master of karate and friendship for everyone.


View Profile
« Reply #19 on: December 07, 2010, 05:01:55 PM »

Excellent idea.

But again, I don't know how well motions out of the plane can be captured. Weng et al. doesn't mention a system for depth sorting individual control points. Igarashi et al. does, but they don't specify how it works. The issue would be if you, say, had an arm bending all the way around the body. It should be manageable.
Logged

Formerly "I Like Cake."
Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic