Jump to content
  • Advertisement
Sign in to follow this  
force_of_will

Sprite animations and character customization

This topic is 3179 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

Hi, Im looking onto SVG based, GIF (sprite) based, and possibly onto M3G for a mobile application targeting in Java ME, the software requires the personalization of an avatar and the use of animations on top of that avatar character, as such the avatar after personalized should be allowed to do some animations but maintaining the previous customization. The customization involves, hair style, glasses or not, eye style, cloth etc I can't go much technically here on the application details. Given the constraint limitations on mobile apps and on the methods we would like some insight on the direction to go, possible some resources if anyone has done something like this. For instance using GIF's for a multilayered composition of the avatar how complex and doable is it, what limitations/restrictions will i find, and size. I'm not looking into someone to give me all the work, just comments on someone that has previously done something like this, or has some resources like links, documents, techniques that can share with me, and being a old gamedev user i know this is the best place for this even if this is not directly game related :) Regards.

Share this post


Link to post
Share on other sites
Advertisement
GIF is basically dead. It has all kinds of silly issues - both technical and legal - that make it totally impractical for what you're trying to do.

Fortunately, PNG exists for the same reasons as GIF (i.e. for graphics, rather than pictures) and is superior in pretty much every conceivable way. It's also the standard image format for J2ME.

SVG is probably out of the question. It won't gain you very much anyway since screen resolutions are still much lower on cell phones than on desktop computers. Better just pre-render everything.

It is possible to do palette-swapping, but not especially easy. If you have indexed-colour images, your best bet is probably to load the file into memory, alter the PLTE chunk, and then re-load the image. If you want to get fancy you can try making a packed binary file with PNG chunks that you mix-and-match into a well-formed PNG file within a scrap byte[] and then pass to the loading routine. You can even edit colours at runtime, but then you will also need to calculate some checksums.

You will want to read the documentation for the Canvas, Graphics, Image and File J2ME classes, and the PNG specification. You may also want to look up some PNG optimizer utilities. (Mostly they just strip out metadata that you don't need, but also can sometimes massage the image data - losslessly, don't worry - to make the compressor work better. It's sort of like the difference between ordinary ZIP and ZIP with the Burroughs-Wheeler Transform.)

Share this post


Link to post
Share on other sites
True that gif is dead, however PNG doesn't support animations, and to pre-render all animations is out of question since, the avatars need to be customizable, the number of possible combination's makes it impractical on the application size.

Im looking on SVG and it seems to be supported by most devices it is vectorial based, so it scales well with any screen dimension, supports animations, and most importantly seems to allow access and manipulation to the XML document through DOM, also the file size is usually lower since animations and shapes are pure "vectorial instrutions". what do you think ?

Share this post


Link to post
Share on other sites
But can your sprites be represented by vectors? Vector graphics are usually used for items that can actually scale, like fonts and objects consisting of abstract surfaces, such as cartoon style drawings.


It seems to me like you should build up your sprites out of separate pieces which you can swap out. Each part would then have the same compatible animations which play synchronously.

Share this post


Link to post
Share on other sites
Yes for the kind of effect we're trying to achieve here, cartoon like characters are perfect is customizable in runtime off course.

However i'm experience many problem with SVG-Tiny mainly on Erickson K800i which supposedly supports SVG and nokia n80 the same

Share this post


Link to post
Share on other sites
It's true that PNG's don't support native animations. But that shouldn't really be important. Most 2D games don't use GIF animations anyway. A much more common method is the use of sprite sheets. You define the coordinates from an image that will be drawn to your sprite element. By changing the coordinates, you can define different animation "frames." Dynamically changing the drawing coordinates creates an animation. The nice thing about this approach is that it also allows for automatic mirroring. (change the placement of the coordinates properly, and you can have your character facing in the opposite direction)

PNGs are still probably your best bet. The more advanced transparency that they provide works well with sprite sheets, and would make layered customized components possible.

Share this post


Link to post
Share on other sites
Yes indeed you're right i focused only on refering that PNG doesn't support animation, true that i can use sprite sheets, and also keep the individual sprites better organized in that way, however the major problem i faced is that my size estimation for
8 component personalized types (hair style, eyes, glasses etc) a gallery with 5 of each (total of 40) of dimensions 80x80 customized for 10 animations (so each specific component must have a frame sequence for each animation) with 10 frames each stored in gif palette indexed the overall size is around 800KiB's way too much for only 10 animations, thats the major issue,
SVG is also current off question since many devices don't suport it

I'm looking now onto M3G (Customization done through texturing, individual attached meshes (arms, legs) etc) based on keyframe animation, its hard to estimate size.
Thanks alot for input guys any more suggestions are highly appreciated.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!