Sign in to follow this  
RokkumanXRX

Sprite Formats

Recommended Posts

I'm developing a fighting game, and up to this point, I've been using *.BMP format. It's working so far, but this format makes it easy for people to just go in and edit the sprites, and it's probably hiking the file size up. Is there another more protective format that I could convert BMPs to? I'm using SDL, just for the record.

Share this post


Link to post
Share on other sites
Well, the simplest way to protect your data from people casually modifying it would probably be to use something like XOR encryption. I think there was a Sweet Snippet on GDnet about how to do that. It's not secure of course, but it will stop people just opening up your files in paint or whatever.
If you're going to implement that, then I would suggest you look into using some kind of archive system as well (that is, keep a bundle of resource files packed up into a small set - maybe just one - of archive files; you can make your own archive format, or just use a fairly standard system like .zip files, for which libraries are freely available). That way, you can put your XOR encryption code in with your archive handling code so that it will be done for all your resource files (or rather, all the resource files that you put into archives).
In fact, if you do use an archive format (other than standard .zip), then you might not want to bother with any kind of encryption at all, since it probably won't be obvious how to extract files from your archive.

As for the size issue, there are other image formats you can use. I would recommend .png format, which can handle different bit-depths, and alpha transparency, and gets quite good compression ratios, depending on the type of image. The SDL_image library can load several of the common formats (including PNG).

John B

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
well, i had the same problem few days ago.
I done written a simple encrypted zip file for my needs.
It's simple to use and it compresses bmps quite enough
without any quality damages.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this