PDA

View Full Version : File Systems


Jamie W
11-02-2006, 12:14 PM
Hello ...

I'm looking for something that can do the following:

Say I have a load of data files for my game (graphics, sfx, level data) and I want to access (i.e. only load) from within my game.

Maybe my directory structure looks something like:

data\gfx\...
data\levels\...
data\sfx\...

Normally, I want to work with just files, but for a release version, I'll want all my data packing in to a single data file, that I can then access from within my game code.

Ideally, I'll be using the same code, no matter if I access my data as regular files, or, as part of this single data file (probably I'll just set a flag or something to specify which I'm using).

Anwyays, just wanted to check, are there any existing solutions that can do this?

Thanks.

jessechounard
11-02-2006, 12:39 PM
I use (and recommend) physfs (http://icculus.org/physfs/).

I suggest you grab a newer version from svn, though, as there are a couple of bugs I've run into that have already been fixed but aren't in the released package.

luggage
11-02-2006, 02:20 PM
Molebox will do that if I remember correctly. No need to add any code either. Don't think it's cross platform though.

Jamie W
11-02-2006, 03:49 PM
Thanks for the suggestions guys.

I had a look at molebox, which looks very nice infact, though it does seem to be heading towards 'application protection' territory. This makes me think; perhaps I should be considering the whole picture ...

Do application protection wrapping proggies, such as TryMedia's Active Mark, or Star-Force's Protection Studio, also hide away my data files from prying eyes?

That's really my main objective here (I want to hide away my data files), and as I'll be needing some kind of application protection mechanism anyway, if that will also hide away my data files, then that's very good thing.

Anyways, thanks once again for your help.

:)

Huge
11-02-2006, 08:27 PM
You could simply encrypt your files - and leave the directory structure the same. I have done this and it works quite well. You can also encrypt your non-demo levels with a defferent key from your "demo" levels, and then use part of the registration key as the key for your non-demo levels. This gives you extra protection because your (paid for) decrypt key is not actually in your exe.

Huge
11-02-2006, 08:28 PM
Also, forgot to mention, make compression (eg, zlib) part of the encrypt/decrypt process. Compress before encryption otherwise your file size will be too big.