Advertisement

File format overview

Started by March 19, 2006 06:36 AM
3 comments, last by CGameProgrammer 18 years, 10 months ago
I'm just finalising the planning of the game I am going to make. The problem is I do not know what sort of file formats to use for all of my data (models, maps, music, movies, images, etc.). Is it wise to just leave the images as TGA, or zip them? or to even make my own file formats? This goes for the other files as well. I don't particularly want ppl editing my stuff. What are the advantages of custom file formats? For example, Unreal Tournament uses *.utx and *.uta files and the like, and Half-Life used *.wad files to hold map textures. Why would they do that? Should I follow example?
Quote:
Original post by Kryptus
What are the advantages of custom file formats? For example, Unreal Tournament uses *.utx and *.uta files and the like, and Half-Life used *.wad files to hold map textures. Why would they do that? Should I follow example?

The article Resource Files Explained seems to be a pretty good explanation of it, I'd suggest giving it a read. It also includes a sample implementation IIRC.

You would use a custom file format for a number of reasons:
- You may be able to save space by using various compression techniques
- To make it harder for people to casually copy or modify game resources (there is no such thing as absolute security though - if someone wants to get to them, they'll find a way, so don't prioritise this too highly)
- It's neater than just having all the files sitting around

A lot of custom resource file formats are actually just renamed zip files, sometimes with small modifications or some form of encryption.

Check out the article, and maybe have a quick Google for some more reading material on the subject, if you still have any questions I'm sure people will be happy to answer. [smile]

- Jason Astle-Adams

Advertisement
Hello,
If you don't want people to edit your stuff, than custom file format is probably the best option. My approach is that I've custom file packer based on zlib that creates package from all my ordinary data files. Only disadvantage is that you have to put extra effort in creating packer & loader.

Regards,
Andrew
Using an existing library such as PhysFS can save you some effort if that's a concern.

- Jason Astle-Adams

If you're creating a Windows application, and you don't want people editing your stuff, you can compile all resources in with the application. That's how self-extracting zip files work. It's not actually secure in that the resources can be extracted, but very few people would even think to.

Obviously that's not good if you want your resources to be spread among several files or to not be tied to the executable.
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement