🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

"encoding" BMP files

Started by
14 comments, last by Julio 24 years, 3 months ago
I want to change the file format for the standard .bmp file format so I can use graphics in my games without worrying about them getting pirated. Something similar to a .wad (as in Doom). I can load a bitmap file easy enough and I am wondering if I just change the header of ''MB'' to something else, will programs like Paintbrush be able to read the file? Any help would be great.
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
Advertisement
Just changing the filename, will not help you. The simplest way of protecting against theft is to make your own fileformat. It is not fully protected though because someone will eventually figure out the fileformat, at least if the graphics is worth stealing.

If you want to do something like Doom, or Quake then you may want to take a look at this article:

Resource Files explained

You may be interested in knowing that Q3 graphics are not protected in any way, because the pak files can easily be read with WinZip.

I also don''t think you have to worry about people stealing your graphics, because it''s something that is so easily noticed.
Don''t bother trying to protect the graphics. Even if yu make them impossible to read, someone can just sit around and press print-screen to get all the frames into the clipboard.
spellbound: i think what he ment was; not change the extension, but the HEADER... (i dont mean to sound mean)

and whoever the anonymos is; hes right... the only reason i can think of why u should put them in a pak file or whatever is size and maybe speed... + that it looks better....


=======================Game project(s):www.fiend.cjb.net
To answer your question: most loaders will just give up after seeing a "MB" rather than a "BM". However some loaders will still try to read it anyway (especially if it''s labeled as a .bmp file). I found this out the hard way when I miss coded a bitmap writing function.

Alternately you can just add junk to the head of your files, or xor each byte with some arbitrary byte, etc.

On the plus side, if you do manage to hide your textures, screenshots of a three dimensionaly game will only give bad quality pirating of your textures. On the downside, the anonymous poster is right, if you''re in two dimensions then they can definately pirate your images without loss of quality.
JonatanHedborg: You''re right, after re-reading the post I see my error. My tired eyes wasn''t feeding me the right information.
Resource files is the best way to go, as long as they can''t be edited. I''ve made my own file format and every time I need a file, I extract it to a temp folder. If someone would Alt+Tab in the game, they can get the files but not edit them. You can also apply encoding to the resource file too (not zip like Q3 though, since IMHO that''s really lame)

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
Spiff: I think the way that Q3 uses zip for their pakfile is a really good idea. That way they don''t need to create a program to put all files in the pakfile. Also, they don''t use any compression to the data.
Well, sure, you're right about that Spellbound. But the main reason for using resource files is to gather the files into one and prevent users from modifying them. I can get all the textures from Q3 and use it myself or draw my nickname all over them.

It would be a good thing if some minor game used zip files, but if Q3 used zip for ease, they're just lazy.

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown

Edited by - Spiff on 3/13/00 3:18:02 AM
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
They probably didn''t do it for ease of use. Most likely it was because the Quake/Doom series has always relied very much on the society of people producing mods and skins and what have you. So, I''m guessing, it was more for *our* ease of use.

This topic is closed to new replies.

Advertisement