Creating animation parts to reconstruct in a game

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
SvenFoster
Posts: 400
Joined: Mon Jun 13, 2011 10:50 am
Location: stephen.foster.uk(skype)

Creating animation parts to reconstruct in a game

Post by SvenFoster »

Hey all.

Got a bit of a task and I am hoping someone can give some insight to the following.
I'm developing a game and plan to use anime studio to generate my characters and their animations.

So I figure I can do this a couple of ways:
1. Simply animate every action such as walk, jump, wave etc and then use that image sequence in my code.

2. Do the same thing but try to construct the character in a way I can export the head separate to the torso and use the sequences in my code and attach them to each other.

3. Try to be clever and extract the parent child relationships and images to store the animation timing etc and write extra code that would animate them rather than playback a sequence of images.

1 and 2 would allow a certain level of point animation with 2 allowing me to have different head movement and expressions withou worrying about the body. So I favor 2 out of those.
3 well would be suited to cutout style but as long as I can get the bone information and the images and origins would e a pretty epic solution.


Irrespective of which one I chose there is a second consideration. How to go about animating the various actions.
A. Would it be best to have separate files for each action
B. maybe put all animations in the single file one after another and somehow export their start frames and just use the offsets.

Then with the generated image sequences build a sprite sheet and read the files and animation info.

Its likely to end up on a mobile device so I would like to keep file sizes down hence not just automatically going with 1 and generating millions of files and making life easy.


Jezz don't show my face for ages and then I ask how to do something tricky.
Any ideas
--Sven
What *if* the Hokey cokey *is* what its all about?
JaMike
Posts: 357
Joined: Sat Jul 16, 2011 6:36 pm

Post by JaMike »

Depends on the size/quality/detail of the images.

Making old-fashioned bitmap sprites would be easiest, and allow you nice textures. But if there's too many of them, your memory space would be used up. This you know already. :)

For the other two options, you'd basically have to recreate ASPs way of animating, if you want to use the same data. Otherwise you'd have to reprocess the animation to fit your game, which defeats the object.

I was asked to do an iPhone game graphics last year, and went through the same issue. After talking to the programmer, it was decided that bitmap sprites were the only way to go. He was looking originally at SWFs, then a skeleton-based engine.

In the end, they went the 3D route. I believe it still hasn't been released. :twisted:

I'd definitely keep as separate scenes for each action, whichever way you choose.
User avatar
J. Baker
Posts: 1063
Joined: Wed Mar 23, 2005 7:22 pm
Location: USA
Contact:

Post by J. Baker »

It all depends on your needs and how well you are trying to optimize your game.

Sprite sheets or strips are the most common and sheets or strips can be switched out with others. So you can have as many actions you want. This method can be optimized by color reduction, size and limited fps for each sheet or strip.

Creating a single image with all of the body parts of the character spaced out accordingly can have it's benefits. First off, you only need one image with all the parts instead of multiple sprite sheet or strips. While this does save on file size and graphic loading, you will be taxed a bit more on the cpu. Simply because your characters animation is not pre-rendered like a sprite sheet or strip. But if your code is optimized right, this can be very efficient.

And just remember, even though newer graphics cards can accept non-power of 2 images, stick with power of 2 anyway. The graphics cards will pad any non-power of 2 image because a graphics card can only work with power of 2. This is a terrible hack that was introduced some years ago that does nothing but create slower loading times for non-power of 2 images due to the fact that they have to be padded so the graphics card can work with them properly.

Hope that helps some. ;)
SvenFoster
Posts: 400
Joined: Mon Jun 13, 2011 10:50 am
Location: stephen.foster.uk(skype)

Post by SvenFoster »

nice one,
I thought I couldnt be the only one that has tried to do this on here..As you say the generate the whole action into traditional spritesheets is probably the most straightforward. Since I'm doing an interactive type game. I suspect I would still export the head separately so that I could give some nods, winks etc without moving the body(or letting it wave etc)

As for the 3d approach, I have also considered that. The big problem for me is rigging 3d chars and lighting. I'm ok modelling and animation for that matter. but it is really time consuming and 3d is just one of those things that has to much to it. Esp when I can create and animate a character in a day on ASP. (and I'm not that good)

If ASP had an xml export format or its scripting language was in something I knew python,perl,tcl,javascript,java,c/c++/obj c instead of 'lua' lol.. (really? i hear good things about it but my life is to short to even try.) I would have a bash as writing an export script.. heck might even have a go for fun.

Some good points on FPS and colors.. I would probably only need 12 or 15 frames or so and I probably wouldnt have much in the way of colors as I'm avoiding gradients...
Might be worth me looking for some examples of animations at different rates..
--Sven
What *if* the Hokey cokey *is* what its all about?
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Post by hayasidist »

SvenFoster wrote:If ASP had an xml export format or its scripting language was in something I knew ... I would have a bash as writing an export script..
depends what you want to export - if it's "just" a (set of) static image(s) then render and save?

Or you maybe don't need to learn LUA to do this. The .anme is "just" a text file, so maybe you might use AS to create it, then after AS has written and closed the file you can read it and convert it?? That way you might be able to write the "exporter" in any language that can read and process text strings to generate an equivalent XML (or SVG! :roll: ) file .. I can se a few big challenges though - such as handling stuff for which there is no direct equivalent in the target format... (I'm thinking such as particles, physics, ...) But it does really depend on what you want to "export" - I've been seriously thinking in this direction to do "convert to legacy" formats.
SvenFoster
Posts: 400
Joined: Mon Jun 13, 2011 10:50 am
Location: stephen.foster.uk(skype)

Post by SvenFoster »

hayasidist wrote:
SvenFoster wrote:If ASP had an xml export format or its scripting language was in something I knew ... I would have a bash as writing an export script..
depends what you want to export - if it's "just" a (set of) static image(s) then render and save?

Or you maybe don't need to learn LUA to do this. The .anme is "just" a text file, so maybe you might use AS to create it, then after AS has written and closed the file you can read it and convert it?? That way you might be able to write the "exporter" in any language that can read and process text strings to generate an equivalent XML (or SVG! :roll: ) file .. I can se a few big challenges though - such as handling stuff for which there is no direct equivalent in the target format... (I'm thinking such as particles, physics, ...) But it does really depend on what you want to "export" - I've been seriously thinking in this direction to do "convert to legacy" formats.
as ive got some time constraints I'll just export the animations to images (splitting out the head from the rest) this will be enough independence for what I need.)

interesting thought on parsing the .anime file...hadn't really contemplated that but it might be possible to to make enough sense of the bone keys and such.
--Sven
What *if* the Hokey cokey *is* what its all about?
Post Reply