Advertisement

Compressing games´s data files

Started by March 12, 2000 02:31 AM
3 comments, last by Jaxks 24 years, 9 months ago
I´d wanna do my game datafiles(Sound,images & other gamedata) to it´s own files like Sound.lib or Main_character.img(All animations).I found to use Zlib or something else algorithim to uncompres and do own file format editor to do game files but when I decompres files should I extract they own dir like "cache" and remove files allways when user quits from game.I´m not yet learning file I/O very well so can someone tell is there funktion that removes files.And does someone know where the data is in professional games( Memory or harddisk)
yes, if your using C use the function
remove(filename);
In professional games, the data is on the
HDD until the initialisation stage, which
is when precaching occurs and the needed
files are loaded into memory for fast
processing.

-Mezz
Advertisement
As far as i know game data (img + snd) is stored in files(harddisk) but has to be loaded into RAM during the execution of the program. So while your program is not running all data is stored in the datafiles, when you start the program (and also while you use it) the datafiles are read into memory and the data can be used by the program.

Allegro offers an excellent grabber utility to compress datafiles, the bad thing is, it doesn''t support C++.
------------------------------------------------------------"To a computer, chaos is just another kind of order."
So I have my sound data sound.lib.Can I extract data there
straight memory and use it.
Yes. Don''t write it to the harddrive first, then load it back to the RAM again. That''s a big hog. Instead of writing from your memory buffers, when you decompress the file, to the hdd just write it to another chunk of memory - you''re soundbuffer or what so ever.


"I think, therefore I am...I think"

This topic is closed to new replies.

Advertisement