Thursday, 6 January 2011

Creating Simple Animations for Games


Participating in game jams, 48 hour competitions, and small amateur game productions, I've noticed that a lot of people have trouble creating simple animations. Often programmers feel they do not possess the art skills, or skilled artists don't know where to begin with game animations. Creating simple game animations isn't as difficult as it seems, and most people just need a prod in the right direction.

Thus, here is my introductory directed prod. If you have any tips to add or disagree with anything I say, feel free to comment me here or on twitter, and I'll gladly include your tips in the article - the more we can teach and learn the better!


Running Animations

Often for small-scale operations, a simple 4-frame running animation is sufficient. Here's a little template skeleton for a running animation:



I've highlighted below the arm and leg closest to the screen, so you can see how the two sets of limbs move during a run.



You can draw over this with your character design. Notice that the limb positions are exaggerated. The legs are far forward and far back. When one limb is fully extanded on the ground, it forms a straight line from the back. In the first and third frames the runner is not touching the ground.



Above is a running animation I created for Mindbender a few years ago. This is done with 8 frames of animation. I did the first four first, and then added the in-between poses later.

The red stripe on the leg is a trick I came up with that means that the front and back legs are easily distinguishable. The eye clearly sees the moving red line and sees it as the movement of one leg. Before I added that, it looked more like the image was blinking between two states, as frames 1 and 3 looked very similar. See if you can do this on your own animations - make the front leg clearly distinguishable from the back. The animation should demonstrate that even with only 4 frames of animation the motion is clear.




I always look to Sonic for a good, bold running animation. Sonic's a nice example because he has nice long limbs, and because running is kinda his schtick. Above you can see all 12 frames of his run animation (from Sonic 2 Beta, ripped by Rankles). You can pick out the four key frames that define his animation cycle - they are the boldest, and the poses are pretty exaggerated.



Exaggerate!

A trap a lot of beginners get stuck into is not wanting to exaggerate movements, but the reality is that the way humans move is actually pretty exaggerated. Legs and arms are fully extended at a lot of times, we leap off the ground, and our limbs stick out far from our bodies. Subtle movements are special versions of exaggerated movements, not the other way round.

Jumping Animations

Your next most likely animation you'll want to do is a jumping animation. This is fairly simple, and is just about posing the character correctly. I usually do two poses for a character: going up and coming down.



Above is an skeleton drawing of the jumping animation for my Sonic Forever prototype. Below is the character drawing based on the animation.



There's not much for me to say on this front, other than these two poses always seem to work.

Think big, scale down

Don't fall into the trap of starting drawing in the scale you will use in your game. What if that's the wrong size, and you decide to make the game objects a different size in later versions? What if you want to do fun camera effects, like I did in Sonic Forever?



To scale an image automatically to the correct size, use something like image.scale = intended_height/image.raw_height in your code.

Computers these days can deal with some pretty big image files, so don't worry about taking up space or memory. There's far more processor/memory-intensive activities your computer has to do. Bigger is (in my opinion) better.

Constructing a sprite sheet

Less of a how-to, more of a bunch of tips here. Choose a point to be the centre of your sprite and try to keep that consistent. Usually I choose the belly, as that tends to stay fairly consistent heighwise when you're running.



I like to work with big square frames of animation. The Mindbender sprites above were done in eight 1000x1000 pixel frames. Round numbers are easy to work with. Don't worry about having a lot of whitespace around your sprites. This means that if you draw another animation where the character is particularly tall or wide the programmer won't need to accommodate a different size of frame.

Talk to your programmer about what it is they want. I've had a lot of times where I've failed to properly explain what I've needed from an artist, and had to construct the sprite sheet myself, working around what they'd done wrong. Some programmers may prefer to work differently to me, or they may already have code that requires sprite sheets to take a particular form. Ask for clear specifications from your programmers!

Anything else?

If there's any other tips you'd like to add, or things you disagree with, please let me know!

Otherwise, good luck and happy animating!

23 comments:

  1. Only one thing to point out really, opposite arm to leg goes forward, otherwise you tend to overbalance, ie. left leg forward needs right arm.

    Other than that, nice post :D

    ReplyDelete
  2. Thanks for your reply :)

    As for the opposite arm to leg thing, that is certainly true when walking. I had for a long time thought the opposite to be true for running - left leg moves with left arm, etc.

    So I looked it up on google image search, and I can't find any images that support my assumption, which worries me a little... Many thanks for pointing that out :)

    ReplyDelete
  3. Thanks for this. Those are some neat little tips I hadn't thought of before. I'll be sure to try more animations in the future I think.

    ReplyDelete
  4. Glad you like it :)

    I found a useful image on a blog by animator Preston Blair: http://www.animationarchive.org/pics/pbanimation26-big.jpg

    It has some simple 8-frame animation cycles for walking, running, tip-toeing, and such. Thought it might be a useful addendum :)

    The blog I got it from is here http://www.animationarchive.org/2006/05/media-preston-blairs-animation-1st.html

    ReplyDelete
  5. I'd personally have said 1024x1024 instead of 1000x1000 pixel frames! Powers of two are just rounder to a computer, you know :)

    ReplyDelete
  6. Thanks for your comment about powers of two.

    In my opinion, round numbers are so much easier for you to work with as an artist and a coder. Computers are pretty sharp now, and will work with 1000x1000 without any hassle, so why not make it easier for yourself?

    It's so much easier to calculate where the centre of a 100x100 frame is than a 128x128 frame, and then what if you want 7 of them? 7*100 is easy, but 7*128 not so much. In your code, this will come up if you need to calculate the positions of the frames when coding the animation, and it'll be easier to spot human errors in that respect.

    Most computers can deal with non power-of-two textures fine, and if you're compensating for those that don't you can always put a 1000x1000 sprite sheet on a 1024x1024 canvas with no trouble.

    My personal rule of thumb is that computers are pretty powerful, so focus on making it easier on yourself as a coder/artist than pleasing the computer. The things that cause problems will be much bigger than non-power-of-two animation frames! ;)

    ReplyDelete
  7. Hi there - could I use the running image on my blog? I would source it. Thank you!

    ReplyDelete
  8. Hi Jayme - sorry about not replying sooner! Feel free to use the image if you like. If you could credit it with a link to the blog that'd be great :)

    ReplyDelete
  9. Overbust Corset
    Flapper Costumes
    Wholesale Sexy Clubwear
    Vintage Dresses
    Wholesale Womens Mens Sexy Lingerie, Halloween Costumes Wholesalers, Plus Size Lingerie and Costumes Exporters Seller, Lingerie China Suppliers, Corsets Manufacturers, Adult

    Costumes Dropship, WalsonLingerie.com, WalsonLingerie.

    ReplyDelete
  10. Seriously, I consider your blog is one amongst best blogs that I found. Your efforts awfully help make reading your blog considerably easier. dubbed anime

    ReplyDelete
  11. Title credits are named along these lines as a delayed consequence of the banks requesting the endorsing of commitment in regards to vehicle, known as the title. The borrowers are fittingly not confined from making utilization of the vehicle amidst the season of the improvement, in light of the way that just title is held by the development expert. car title loans

    ReplyDelete
  12. Do you have your driver's award with you? There are different variables which identify with this limit. The individual ID tells the moneylender who they are working with and that it composes the proprietor recorded on the title. http://www.approvedcashadvance.com/locations/newport_news/

    ReplyDelete
  13. The colloquialism "take after the orientation, and it'll turn out right" is amazingly vital and exact when securing a vehicle title credit. A borrower may similarly be at threat of taking out a development from an unpalatable association that will charge extra costs on top of the gathered distraction, or minute hid supports that were created in the fine print in the assention, that are just about hard to see, unless observed intentionally with an opened up glass. cash advances mobile

    ReplyDelete
  14. The fortunate thing about these sorts of credits is the credit powers generally speaking don't oblige a credit survey the grounds that they have your auto title as affirmation and security for the improvement. At that point, you can even now drive your auto and pay back the advancement in parts Payday Loans

    ReplyDelete
  15. To judge the best game plan, make progress toward the payday propels association that is advancing a lower APR. Commonly, most payday development associations give a cost breakdown each 100-dollar expands that match with the rate. Cash Advance Chicago

    ReplyDelete
  16. Right when individuals consider vehicle title credits, much like payday advances, there has a tendency to verify demographic hypotheses which ring a toll. The lion's offer would hold a title credit with clearing metropolitan districts concentrating in on the low wage car title loans chicago

    ReplyDelete
  17. Since we looked at the Pros, we should look at the Cons of vehicle title credits. Genuinely, no budgetary decision is 100% wonderful. Nothing is faultless, however a few things draw close. If this article was in light of telling the peruser that the auto credit industry is the best budgetary choice, then the article would be stacked with crap. title loans jackson-MS

    ReplyDelete
  18. Once more, this sort of is comprehensively ordered into two sorts secured and unsecured credits. You can decide for unsecured regularly scheduled installment credits if there should arise an occurrence of getting critical money. usacheckcashingstore.com/costa-mesa

    ReplyDelete
  19. the estimation of the vehicle is to an inconceivable degree essential and an assessment will be finished by development expert gave appraiser. The vehicle title advance moneylender will require your vehicle on the premises with a specific end goal to process the application. car title loans

    ReplyDelete
  20. The blessed thing about these sorts of credits is the credit experts all around don't oblige a credit watch the grounds that they have your vehicle title as affirmation and security for the progression. By then, you can even now drive your auto and pay back the progression in parts
    Payday Loans San-diego

    ReplyDelete
  21. The procedure of procuring guide through title credits is the same as exchange advances. Borrowers must be watchful for advance pros who charge excessively high rates of pastime. One must take title credits just from the approved banks why ought to affirmed offer these advances. Cash Advance San-diego

    ReplyDelete
  22. The use of auto as protection is not confined to title credits itself. Diverse moneylenders see the vehicles as security to back the credit repayment. In any case, home measures unprecedented in the favored summation of insurances. Payday Loans

    ReplyDelete