🎉 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!

file formats - please explain :)

Started by
8 comments, last by mickey 22 years, 7 months ago
hello! what are they for? and why does game have their own file formats why don''t they just use bitmaps or gifs or jpgs? these file formats, is this the one like for example in diablo2, their major files have an extension .mpq, does that mean that''s their file format? and is this the same thing coz right now, my graphic files are .bmp and i''m wondering why other games doesn''t have .bmp files in their directories? it''s because they have their own "file formats". thanks! http://www.wotsit.org/ -> explanation of files formats but dunno what is it for
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Advertisement
Many (or most) games put most (if not all) of their files into a large package file (like a zip file). Diablo''s .mpq format is just a proprietary package format. Quake III uses renamed zip files for packages and targas and jpegs for images, so not every game uses proprietary formats .

Sometimes it is nice you use a custom format for convenience (that''s the #1 reason I use custom formats). For example: they might be easier to load than the ''existing alternative'' file format is.

[Resist Windows XP''s Invasive Production Activation Technology!]
be aware that file extensions and file formats arent the same. you can rename a .bmp file a .zog file and still load it using the same code. Some people just rename their files so people dont realise they are plain bitmaps and dont edit or steal them.
In other cases, sometimes the headers (the bit at the start of files which describes the format) is stripped out, as the program probably knows the format already and uses the same for everything. That avoids loading any data into memory you wont actually need.

http://www.positech.co.uk
i''m sorry but i''m still confused, so how do someone create his own file formats?

Null and Void: hope this is not a stupid question, could you please explain what do you mean by proprietary package format?
This question was referenced to Null and Void, but I can answer:

You see, sometimes developers of programs/games design their own form of packages by designing or using a specific algorithm/method/library to handle the data/package.

Basically, the game developers develop a "tool" that allows only them to view/manipulate the data within those "specific" file formats.

Example: I''m a programmer for id() and wanted to develop some kind of Doom 5 game(whatever). If I wanted to be a genital, I could create my own image compression algorithm that takes .bmp files and converts them into a .xxx file. Only software/games using the compression library I created will be able to load, decompress, and display/view my image.

-Greg
Hopeful Purveyor of the Open Source Community
-Visionare
wow, okey thanks i got that a bit,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Sometimes the known formats like .BMP or JPEG lack something that you would like them to have.

For example. I have created my own image format. The primary reason was that BMP''s and TGA''s only contain ONE image/frame.

If you have an animation of a man running over 15 frames it is annoying to load all 15 images seperatly. I put all images like that which fit togehter in one file. This makes my code a bit cleaner I think.



-------------Ban KalvinB !
quote: Original post by Anonymous Poster
i''m sorry but i''m still confused, so how do someone create his own file formats?

Null and Void: hope this is not a stupid question, could you please explain what do you mean by proprietary package format?


if you have picture like this

xxooxxooxx
ooxxooxxoo
xxooxxooxx
ooxxooxxoo
xxooxxooxx
ooxxooxxoo

10 x 6 and you use 8 bits to colour info.
Now we design file format to it.

first we need some header to name -> "mof. My own file formatv1"
then we tell picture size 10, 6, 8 <- 8 bits for each info. not needed if these do not change
and then the rest is raw data.

so we get
struct mof
{
char array[25];
int witdh;
int height;
int colour;
int array [60]; <- this could be out side of struct
};

if you like you can add more info to struct.















quote: Original post by granat
Sometimes the known formats like .BMP or JPEG lack something that you would like them to have.

For example. I have created my own image format. The primary reason was that BMP''s and TGA''s only contain ONE image/frame.

If you have an animation of a man running over 15 frames it is annoying to load all 15 images seperatly. I put all images like that which fit togehter in one file. This makes my code a bit cleaner I think.


oh okey, hmmm... is what you''re doing is also the same as the gif animation files?

anonymous poster: so you can do that in VC? instead of saving your files in .cpp or .h, you save it in your own format, then um okey, example, i''ll be using adobe photoshop to draw my character, then after drawing it, i''ll save it as bmp, then this bmp file, i''ll make my own file format for it, right *sigh*? jeez, if you think all the answers to my questions are already posted here no need to reply, just tell me if it is so i''ll just keep on going over it hopefully i''ll understand it thanks!

question: okey, maybe this will make things clear for me, what is adobe photoshop for where you can already draw your pictures in windows bitmap resource editor right? and does developers use paints sotwares rather than draw softwares? hmm.... what if my images are vectors then i don''t have to assign a data structure for it right coz it''s already there? hehe, actually am not sure of what am saying here,

http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,

This topic is closed to new replies.

Advertisement