PACKAGING GAME FILES TO USE WITH IRRLICHT

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Lprd2007
Posts: 15
Joined: Sun Aug 24, 2008 3:03 pm

PACKAGING GAME FILES TO USE WITH IRRLICHT

Post by Lprd2007 »

kes the game slower.
Last edited by Lprd2007 on Tue Jan 05, 2010 2:57 am, edited 1 time in total.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

packaging game files --> soooooo 90's. that passseeeee!

man, i hope you're doing fine now.
Image
Lprd2007
Posts: 15
Joined: Sun Aug 24, 2008 3:03 pm

Post 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!!
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post 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?
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Dark_Kilauea wrote:But hey, ignorance is bliss, am i rite?
You might be right, not rite.

Travis
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

That misspelling was intentional :P
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post 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.
torleif
Posts: 188
Joined: Mon Jun 30, 2008 4:53 am

Post 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.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post 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.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
skumar
Posts: 201
Joined: Thu Feb 14, 2008 6:24 pm
Location: kerala state india
Contact:

Post 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...
skumar
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Post 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.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post 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.
Post Reply