|Original post by ndatxcod|
I really hate when people are talking about protecting data and someone ALWAYS comes up and says a nonsense along the lines of "you shouldn't bother protecting your data because if someone really wants to get it he will be successful anyway" it is usually spewed out by people who have never finished a commercial project by themselves. The point of protecting data is not making it impossible to access but to deter most users wanting to take a peek at it, or even to steal it for their own projects, also that data comes usually from third party vendors (sounds and music) who require you to protect it before shipping the product. Should you use your own format for your game ? If you intent to go pro, then yes, there are a lot of successful indies that are doing that and have their own file format for their games and I'm not talking about a simple password protected zip.
Now when I say file format I'm not referring to the "primitive" types like a png or a dds. I'm talking about your own format wrapping those common ones, sort of like a pak system where you can pack your data in a single file, you put sounds, images, maps, etc using your own set of functions. To read/steal it someone would have to disassemble the binary.
I've written my own homebrew games and sold them for profit. I've worked at independent professional software studios, and currently work for a major game corporation.
I'm going to repeat this line, only because it is true: Do not try to obscure, encrypt, or otherwise hide your data. There is no point to it. The data is virtually useless to anybody, and if they did manage to steal it, copyright law still protects it. If they modify it, it isn't a big deal, both because of copyright protection so we can take them to court if it's bad, and if it is neutral or good it amounts to word-of-mouth advertising.
I have always used my own custom data formats for countless projects, but it is absolutely not for reasons of protecting data.
So why do it?
The file formats are useful for exchanging data between programs for compatibility, but I'm not interested in that. Instead, I know the memory formats and layouts of my data as used in the final game. I use my tools to load the data to file in exactly the same format and layout that it is needed when running. When I need to load a level, I can read a huge block of data for the assets. I don't have to worry about parsing what is images and textures, what is models, what is transformation data, or otherwise manipulate or manage the data at all. I just read the type of data, it's length, and dump the entire thing into memory all at once. This cuts load times by HUGE amounts.
If it is compressed data, then it is a simple matter to decompressed the block as it is loaded, then dump the decompressed block directly into memory. Again, it loads more than just a single bit of data but a huge swath of memory. It just adds a single step to the loader, and generally helps the load time by a few percent.
Just to show the difference, when we started one project at a studio a few years back, we loaded and parsed all the asset files directly, without preprocessing them into a tool. The load time was around four or five minutes, while listening to the disk churning as each tiny file was loaded and parsed. We finally got the tool in place to preprocess the data and pack it up, and load time dropped to just a few seconds.
Load time, not protection of data, is the primary reason to pack data in custom formats.