Packing level files

Started by
2 comments, last by Prads 12 years, 9 months ago
Hi,
I have a lot of level files and was wondering if I should pack them to one file.
The problem is I don't know how exactly do that.
I need to be able to pack all files into one in game editor, and use this pack in game.
But how would I then use DirectX functions who require path to one file, which will be in a pack?
I'm programming in c++.

If you know any good articles, or tutorials or just how to do it, please tell me.
Any help would be appreciated.
Advertisement
Do you want compression too? If yes then it's little complicated. But if not then you can just read bytes from files and put them all in one file. And later when you need to read them, just unpack them into a temporary folder and delete them when you don't need them anymore.

But I think it would be more efficient if you just put all your files in one separate folder and read them from there instead of make one huge file by putting them together.
My first 3D game: Click Here
But how would I then use DirectX functions who require path to one file, which will be in a pack?
You read your pack into memory, and then use the [font="'Courier New"]Create...FromMemory[/font] functions, instead of the [font="'Courier New"]Create...FromFile[/font] functions.

[font=arial, verdana, tahoma, sans-serif][size=2]
And later when you need to read them, just unpack them into a temporary folder
So to load a file, you load it from disk, then you write it back to disk, then you load it from disk again?? Why not just make use of it after loading it the first time?
But I think it would be more efficient if you just put all your files in one separate folder and read them from there instead of make one huge file by putting them together.[/quote]Reading multiple files into one go (by reading a pack of files) will usually be faster than reading many small files.[/font]
Didn't know there were D3DX....CreateInMemory Functions. lol Never used them so...
My first 3D game: Click Here

This topic is closed to new replies.

Advertisement