• Advertisement
Sign in to follow this  

coding vs drawn animation

This topic is 2063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In most modern games, are animations 'drawn in' as in you have models which contain the animations of various things moving? or are they 'coded' in: when the key W is pressed and MOVE() is called, this directly changes the coordinates at which the player is drawn, along with his legs moving in a running animation in specific intervals

I am currently reading various books but this question keeps popping up in my head. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
[quote name='lululoo' timestamp='1338062453' post='4943546']
In most modern games, are animations 'drawn in' as in you have models which contain the animations of various things moving? or are they 'coded' in: when the key W is pressed and MOVE() is called, this directly changes the coordinates at which the player is drawn, along with his legs moving in a running animation in specific intervals
[/quote]

Most games have pre-drawn stuff.
That said, most games have artists (which you might not).
Some graphics (explosions/ advanced particle effects) look better with custom coding,

While pre-rendered animations look better, and allow you to work well with an artist, I find that coding my animations is much more fun to me as a programmer (I love coding cool explosions and morphs).

Share this post


Link to post
Share on other sites
For 3D games, the models are meshes covered up by meshes. Think of it the same way they do the big parade floats with a wire mesh covered by decorations. These are made by modelers. The modelers also include "bones" and "joints", which are special points that tell the mesh how it should deform. This is generally done in Maya or 3DStudio Max.

Next come the animators. Their job is to animate the bones and joints in ways that look good. These are generally a bunch of transformations and keyframes. This is also generally done in Maya or 3D Studio Max.

The cool thing about it is that when done right, modelers can generate many different models using the same bones and joints. Animators can create a single animation that will look good no matter what the model is. As one example, consider The Sims since it is so well known. The same animations work regardless of if your person is tall or short, skinny or fat, male or female, old or young. You can use different textures (color of skin, makeup, tattoos) and different models (male, female) and reuse the same animation on them all.

The programmer builds an animation system that loads up all the models, the textures, and the animations, turns the bones and joints into a skeleton, and plays the animations (which are matrix transformations) and blends them smoothly over time.

Sometimes the animation won't have it written by the animators. There are systems called Inverse Kinematics systems (IK Systems) that will solve the math for you. For example, if the IK system knows a hand needs to been at one point and knows the shoulder needs to be at another point, it can solve the math to figure out where the elbow needs to go.

The programmer should never need to move those points directly. Instead he should be able to tell the animation system that a specific animation needs to be played, and the animation system will run the matrix transformations that the animator specified.

As you can see, there is a lot of work involved in making 3D games.


Particle systems, such as explosions, fog, mist, and so on, are also generally created by artists. The artists create particles, and they create simple scripts that describe where the particles start, how they move, and how long they last. The programmer can start and stop the particles with a fairly straightforward particle system.


For making 2D games, pixel artists generally draw a series of pictures. When the programmer needs to play an animation, the animation system simply plays one picture every frame until the end of the cycle. For example, you would tell the animators that the walk cycle is 32 frames; when a character walks they move the object for 32 frames while at the same time playing the animation for the same 32 frames.

2D games are simpler to program, but can require much more drawing than 3D games.

In neither case do major games have the programmer directly moving animations through code.

Hope that helps.

Share this post


Link to post
Share on other sites
And then there are dynamic animations, such as the character's feet actually meeting the stairs when you walk up on them, rather then hover over them playing the pre-set walk animation.

While there are pure dynamic animations, the usual case is to blend them with pre-set animations, to make the character more believable by reacting correctly to the world.

Do note that this subject is pretty advanced (a lot of inverse kinematics and physics).

Share this post


Link to post
Share on other sites
The 2D castlevania (metroidvania) games I believe have "coded" dynamic animations.

Large monsters were drawn in parts, and their parts were animated through image transformations, sort of like a model system. Edited by Explodinator

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement