user3128725
user3128725

Reputation: 1

How to create, read and write to a custom binary file format?

I am looking to finish my C++ game and package its resources such as images, sounds etc into a custom file format, so users can't decode it. I was hoping if anyone could shed some light on this. I have researched and found that creating custom binary file format is the way to go, but no one has described how to do it.

I would like to package images and and other files into the File format, and during runtime use the resources from within it. Is this possible?

Upvotes: 0

Views: 2528

Answers (1)

Darren
Darren

Reputation: 253

Necroing because this question is what pops up if you search for such info.

I would suggest reading up on the Interchange File Format (IFF), which is where we get RIFF, TIFF, and many other binary file formats from: http://en.wikipedia.org/wiki/Interchange_File_Format The original Electronic Arts spec for the format is very interesting reading, and I recommend it to anyone thinking of designing their own binary file format: http://www.martinreddy.net/gfx/2d/IFF.txt IFF files have the benefit of being very robust: chunks can be stored in any order, new chunk types can be added that your app doesn't know how to handle, and yet it is simple to write a reader that will parse the file without error.

Upvotes: 1

Related Questions