"encoding" BMP files

Started by
14 comments, last by Julio 24 years, 1 month ago
Ok, I give in. Although I''m still considering drawing my nick on all of the textures though

============================
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
Advertisement
quote:Original post by Spiff

But the main reason for using resource files is to gather the files into one and prevent users from modifying them.


Actually I think the main reason for using resource files is that it is faster to load the data from a resource file than from separate files. This because you don''t need to rely on the operative system to find the file for you, instead you effectively have a pointer that tells you exactly where the file is inside the resource file.

It also takes up less space on the harddrive than separate files. Files on the harddrive use an even amount of blocks, which will in average give you a waste of half a block per file. As an example, think of the old FAT16 file system, here each file is stored in blocks of 32kb. If you have a thousand files you will waste 16 MB of harddrive space. In reality you will waste a lot more than that as most files are smaller than 16 kB effectively raising the average waste per file. Of course with FAT32 and NTFS the block size is a lot smaller (I believe it is 4kB for FAT32) but the waste is still there.
Another reason to use some sort of resource file is that it can take a lot less time to install on a users machine (assuming you are installing from a CD) as you get one long sustained transfer instead of a thousand seeks and a thousand short transfers that generally make the CD skip all over the place. I''m just mentioning this because of a game that I just worked on where the developers shipped about 3000 seperate 2-16k files, and it takes FOREVER to install, and it''s really not that large.

Another benifit is that when you are creating your install, it''s much easier to be sure you didn''t forget a file (though you might have forgotten to put it in your resource file).

One other thing (it''s the last, I swear it) is that you can use numeric ID''s instead of filenames (if you roll your own resource file), and then you don''t have all those filenames littering your code and taking up space. Of course, you have to make sure the ID''s match...

Mark Fassett
Laughing Dragon Entertainment
http://www.laughing-dragon.com

Mark Fassett

Laughing Dragon Games

http://www.laughing-dragon.com

One other possibility that will not Prevent someone from taking the graphics but can help copyright them. Is to use a technique calles stegenagraphy... I don''t know if I spelled it correct. But that actualy can hide a logo, or any sort of file within the graphic itself. Though you cann''t tell just by looking at the picture, it is possible by looking at the data and using certain tools to tell there is a hidden file. But by encrypting the file and other methods it is a very common and effective way to copyright images. Might be worth a look into.
Spiff...Why would id care if you wrote your name on all the textures? The net effect of your effort would be that you uglified your (and only your) copy of Quake3. If the Quake games (and Doom before them) taught us anything, it should be that the ability for users to modify game art and even behavior can be a huge plus, as it creates a longevity that the game would otherwise not have.

Trying to hide graphics with obfuscation is a pretty useless gesture. If anyone really wanted to get them out, they could, no matter what you do to hide them. Worst case would be they just have to disassemble your texture loading function. That doesn''t mean they can just go and use them in their own game, copyright law protects against that.

id using ZIP format for Quake3 isn''t lazy -- its just smart. It gives them good compression and as others mentioned makes it easy for mod programmers to work with the files. Even when they were using other formats (WAD, etc) the fileformats were known. Most of them id published themselves. For the original Doom, a lot of the information was first reversed engineered by end-users (before id realized how much of a good thing it is to keep your game mod-friendly)

*puts down his sign* - I give in. Of course there are advantages of using zip files, but only for games you really want people to alter, and that''s prolly not what Julio wants. Can we go with this..?

============================
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

This topic is closed to new replies.

Advertisement