Archived

This topic is now archived and is closed to further replies.

.dat - files

This topic is 5499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Maybe I''m just stupid but I haven''t figured out anything about these files with extension (.dat)... I see games with no graphical files included with the zip(such as .png or .bmp). They must have packed all that into a .dat-file. How do you do that? What are these files? Excuse me my stupidity. -thanx

Share this post


Link to post
Share on other sites
Well it is actually quite simple.. files do not depend on their extension.. if you rename pic.bmp to pic.dat it is still a BMP file (if that was what your original bmp file contained).. extensions are only windows''s way of deciding which program to open the file with.. Unix uses searches the file header for a "magic" tag to determine the filetype.. web servers use a standard called MIME.. *.dat files are often used in game because you can interpret *.dat as data.. that is what they are.. data files.. and it is up to the developer to decide what to store in them.. they could contain two bmps.. are a raw bitmap with a header of your own (your own custom image format that would be).. it could also be bunch of variables.. bottomline .dat is just a popular extension because it stands for (dat)a :-)

Share this post


Link to post
Share on other sites
You''d have to either create your own .dat file format and write a utility to pack resource files (*.bmp, etc) into your custom .dat format. Or you might be able to find an already made file format with utilities for packing. The .zip file format could work for file packing.

Share this post


Link to post
Share on other sites
It''s quite easy to test with text files...
I wrote a little program once that used files with the ending .lcm for l3mon''s class maker and it wrote some text into them. If you open those files with notepad or some other software capable of reading it, you''ll get the idea that it can work with anything. If you wanted to, you could give a text file the ending .bmp and open it with notepad, it''ll still work, though windows will probably automatically tell you it''s a bitmap because of the ending. It''d also be pretty silly to use such an ending for a file, but hey, now you know

Share this post


Link to post
Share on other sites
Actually, in most games the graphics are stored as resources in the executable, actually appended to the EXE file. This is to prevent people from stealing the images. The DAT that you have found might be save files (though those are usually SAV), or configuration settings (though those are usually INI), but almost definetly not pictures. If you still don''t believe me, check the file sizes. If it is graphics, the file sizes will be huge, over a Megabyte.

Share this post


Link to post
Share on other sites
quote:


Actually, in most games the graphics are stored as resources in the executable, actually appended to the EXE file.




Are they? Wouldn''t that make for an extremely large and cumbersome .exe file?

How about paks and pk3s etc? You can pull the graphics (and everything else) directly out of these archives so i don''t think graphic theft is really that important an issue for game companies.

-Ben

Share this post


Link to post
Share on other sites
Actually in many games from big companies you''ll find they''ll use their own tools to create those resources and can pack them how they choose to, making the game able to read it the way it''s meant to. Hence you can''t just open it with your software and take a look at it or even steal it.

Share this post


Link to post
Share on other sites
Most big game companies do not use resource files that append to the exe. They probably use a proprietary file time. My graphics engine for example uses *.yoshi, which can hold numerous images in one file in a 16 bit format (or 24, 32, etc.). This is a better idea because if you change a single image, you don''t have to rebuild your entire application. Since it''s a propriety image format, most people would not be able to look at the images or alter them anyway.

Share this post


Link to post
Share on other sites