Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a simple 2D animation file format. It'll be very rudimentary: only an XML file containing some parameters (such as frame duration) and metadata, and some images, each representing a frame.

I'd like to have the whole animation (frames and XML document) packed in a single file. How do you suggest I do that? What libraries are there that would allow easy access to the files inside the animation file itself?

The language I'm using is C++ and the platform is Windows, but I'd rather not use a platform dependent library, if possible.

share|improve this question
up vote 3 down vote accepted

I'd suggest packing them into a simple .zip archive; there are several libraries out there (a good one using the minizip function of ZLib is discussed here). That way, you'll have an XML file uncluttered with other embedded information, and then all the graphics resources out in their own files inside the archive. This might also allow for better compression of the binary data (very unsure about this).

share|improve this answer
Note that ZLib is cross-platform, and that it is well tested. I really think that this is probably the easiest solution in your case. In the XML file, use relative paths, i.e. "/walking/frame1.tga", and then have the loading code handle those in the archive. Shouldn't be more than 10-20 lines at the most for that. You might also want to consider using big sprite sheets for families of animation. – ChrisE Mar 19 '11 at 20:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.