Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

beaton_john

FREE Virtual File System (like WAD)

This topic is 5708 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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....

Share this post


Link to post
Share on other sites
@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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!