FREE Virtual File System (like WAD)

Started by
14 comments, last by beaton_john 20 years, 12 months ago
Hi, This is only my second submission to the forums, so, bear with me... I have written a VFS that is intended as a free 'wad' file code. It is demonstrated in a 'VFS explorer' app, where you can view, add files, delete files, etc... please ignore the crap layout, it's just to give you an idea of how it can be used. All the vfs source code has comments -> i'm not going to comment the mfc because i can't be bothered. A file in the VFS is extracted to a CVFSFile class (i called it cfile, but mfc has its own cfile), which can be dumped to a file, read from (eg file.Read(data,size)), seeked in position, etc. This is free - you can use it however you like, if you want to use it in a commercial product, that's fine, it would be nice 2 know... Please write back here, and tell me what u think... Download it << HERE >> (Right Clik, download)... Cheers, john PS. Ken Van Hoeylandt has converted the VFS so that it works on a mingw compiler... you can download it << HERE >> [edited by - beaton_john on April 25, 2003 8:32:11 PM]
Advertisement
nice!
www.autodefrost.com/~travisSignature Virus cleaned by McAfee
Copy and paste the URL in your current browser!

.lick
Nice work!

A couple of ideas:

1. Wrap your C++ code in a ''vfs'' namespace (or something similar). This will allow your CFile class to co-exist with MFCs CFile. (and prevent any other name clashes).

2. Make a rules-based explorer that adds files depending upon certain rules. A simple example would be "add c:\gamedir\data\*.x". With large projects and lots of datafiles it gets messy and error-prone and tedious having to manually add and remove each file. This way you could automate it on the command-line every time some data changed.

Nothing is ever finished
I haven''t looked at your program in detail, mainly because I don''t use the windows api...

Can anybody please point out to me the advantages of using a special VFS over using some existent system like .zip, .tar, .tar.gz and so on?
I have worked with neither of them, but I''ll have to, so I''d like to know.

"George W. Bush Geography Simplification Initiative"
More info on George W. Bush

My Homepage (C++ SDL OpenGL Game Programming)

I am a signature virus. Please add me to your signature so that I may multiply.
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
The reason i use a vfs, instead of a zip, is because it is (slightly) faster. Of course, i haven''t yet optimized it for speed, but it should be faster. Also, a .zip file can be read by anyone with winzip,(you can put a pw on it but it will become slower to extract, + more code), and this means anyone can get your data files... maybe i should build encryption into my vfs....
Haha I downloaded this source earlier today on PlanetSourceCode, looks nice from what I''ve seen.

James Simmons
MindEngine Development
http://medev.sourceforge.net
@beaton
OK, you''ve got two good points there.
Well, since I plan to make my game open source anyway, I don''t need encryption. Well, I''ll see what I use when I come to the point

"George W. Bush Geography Simplification Initiative"
More info on George W. Bush

My Homepage (C++ SDL OpenGL Game Programming) (Mirror)

I am a signature virus. Please add me to your signature so that I may multiply.
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
adding zlib compression would be nice. ..hmnn I wouldn''t think access time would be that much faster than loading the files yourself though into memory.
www.autodefrost.com/~travisSignature Virus cleaned by McAfee
Would you mind briefly explaining the file format you use (I don't mean like byte X is Z, but what info do you store how {like just header/file pairs sequentially})? I didn't see any kind of documentation in the download other than comments in the source.

I've thought of several different kinds of virtual file systems but haven't really come up with one that has fast access time, easy insertion, and easy deletion. There is always some kind of problem (the same kind FAT has - like fragmentation, wasted space, etc).

[edited by - Extrarius on April 21, 2003 2:44:48 PM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

This topic is closed to new replies.

Advertisement