Page 1 of 2

PACKAGING GAME FILES TO USE WITH IRRLICHT

Posted: Sun Aug 24, 2008 9:18 pm
by Lprd2007
kes the game slower.

Posted: Sun Aug 24, 2008 9:21 pm
by dlangdev
packaging game files --> soooooo 90's. that passseeeee!

man, i hope you're doing fine now.

Posted: Sun Aug 24, 2008 9:32 pm
by Lprd2007
dlangdev wrote:packaging game files --> soooooo 90's. that passseeeee!

man, i hope you're doing fine now.
Why it's out of date packaging game files? Did you saw the game textures and meshes, of a commercial game, like The Sims, or Colin Mc Rae, or Max Payne in the original format? The commercial games developers usually save their game files in a file to avoid that the users copy the game files.
Anyway, keeping the files in the original format (GUI images, etc), it's from 90s!!

Posted: Sun Aug 24, 2008 11:21 pm
by Dark_Kilauea
actually no. They don't prevent copying of the data, for reasons that have already been mentioned by countless people.

But hey, ignorance is bliss, am i rite?

Posted: Mon Aug 25, 2008 4:12 am
by vitek
Dark_Kilauea wrote:But hey, ignorance is bliss, am i rite?
You might be right, not rite.

Travis

Posted: Mon Aug 25, 2008 10:27 pm
by Dark_Kilauea
That misspelling was intentional :P

Posted: Tue Aug 26, 2008 7:47 am
by JP
Yeah they're not generally using their own file format to protect the files, more because they're using their own set of tools and file loaders and need the file format to support specific things that public domain file formats don't provide for them.

Posted: Sat Aug 30, 2008 9:52 pm
by FuzzYspo0N
For some actual help, check anywhere online about c++ -> games -> file packing.

file 1 contains (lets say, 8 blocks of data)

File header
1_1
1_2
1_3
1_4
1_5
1_6
1_7
1_8
2_1
2_2
2_3
2_4
2_5
2_6
2_7
2_8


Use normal file reading, and normal file writing. GetFile(fileIndex) will return the data as a type right? so its like, getFIle (2) will return an image, or zip file etc etc. Its pretty much generic file processing, and there are millions of references online about it.

Posted: Sun Aug 31, 2008 4:25 am
by torleif
Before you give your game to friends put all your files in a .zip and rename the extension to something like .data or .game

Then load the zip to the file system when the game starts. It's efficient and most games use the same technique.

Posted: Sun Aug 31, 2008 1:32 pm
by rogerborg
Heh, like ".pk3" files; see example 02.Quake3Map.

For SUPAR SEKRIT SECURATEE, you could change the 4 byte magic header in your .zip file, then make a teeny modification to CZipReader::scanLocalHeader() to scan for that header instead of 0x04034b50. Most apps then won't recognise the .zip, even if they correct the extension.

Posted: Mon Sep 01, 2008 11:27 pm
by omaremad
Another reason is the faster load times, opening one file and fread-ing at different offsets(stored in the programs ram) is allot faster than opening lots of files using fopen. The difference matters even more on cd`s where the TOC is so far from the data and seeking is slow.

Posted: Tue Sep 02, 2008 7:33 am
by JP
Can anyone say UMD? Effing terrible read times :lol: Luckily the clever chaps at Sony came up with a TOC cache basically which sped up file reading incredibly so more recent games on PSP use this.

It's also much quicker to just read the whole file (or a large chunk of it if the file is too big to stick in memory) and then process the buffer rather than multiple file reads which are prone to stalls and the like.

Posted: Sun Sep 07, 2008 1:50 pm
by skumar
hi,
I was researching for this for some moths....and i finally got a commercial solution...molebox pro......

you can even pack the whole game as one exe...

or as different packages...in an encrypted form..

Efficiency is also good ...please try it...

Posted: Thu Sep 11, 2008 6:53 pm
by Frank Dodd
I believe your looking for the addZipFileArchive() command, simply zip your media files up call this command and then load the files as if they were in your current directory.

Obviously it needs to decompress the media from the archive but I haven't seen any noticeable performance degradation.

It is particularly useful where there are sometimes many hundreds if not thousands of small media files wasting disk space and being troublesome to move about.

Posted: Sat Sep 13, 2008 8:29 am
by sio2
Frank Dodd wrote:Obviously it needs to decompress the media from the archive but I haven't seen any noticeable performance degradation.
If that's an issue then you can store the files uncompressed in the zip file.