Skip to main content
GameDev.net gamedev.net
🔒 Locked

Modular Animation

Started by Hollandera Feb 7, 2010 at 1:37 PM 4 replies 3.2k views
Original Post
Hollandera
Hollandera
Hello, I am working on A 2d platform game called "Knight" for now. I want to animate the character and npcs using modular animation but I cannot find a good page on the subject. Could anyone point me to a good source or post some pointers? All coding is being done in Java.
bzroom
bzroom
Modular animation for 2d? Could you describe your system and what you're trying to do a little more specifically?
Hollandera
Hollandera
Sorry if I was unclear. I found this video:


and I wanted to incorporate animation similar to that of which is used to animate the golem on my characters.

maybe I used the wrong term, sorry about that.
Lord_Evil
Lord_Evil
Well, from the video it looks as if the golem is constructed of multiple parts that form a hierarchy (e.g. torso -> upper leg -> lower leg -> feet).

Then the individual parts are rotated arount their joints. This could be done via skeletal animation which is applied to a 2d skeleton instead of 3D and doesn't make use of skinning.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Hollandera
Hollandera
I have attempted to create a skeleton of rotating parts by placing the body parts relative to the torso's position and rotating them back and forth to preset angles. I really do not like to hard-code and of my work and this way seems very tedious; not to mention a I bet that it runs very slowly. Are there any techniques to doing this to make the code more generic and run efficiently?
Lord_Evil
Lord_Evil
Skeletal animation isn't hardcoded by itself. And it's not really slow.

Generally, skeletons along with animation data are provided as part of your character, i.e. it would consist of a file containing the skeleton and animations and one or more files containing the individual body parts. Thus everything is artist-controlled.

Additionally, you could apply inverse kinematics to make your character respond to the environment.

When rendering you'd update the skeleton by rotating the bones around their joints and apply the transformations to the attached body parts. Note, however, that if you use sprites for your characters you'd normally have somewhat rigid parts, i.e. they would rotate and maybe scale but they wouldn't change their shape.

You could, however, provide a sprite for each animation step and combine multiple independent parts to one character. But that would require the artist to create every single animation frame.

Or you could apply some transformation on your sprites but if they go beyond simple rotation, translation and scaling you might get a significant performance hit.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.