Mounting packed Xonotic data with fuse - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10) +--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12) +--- Thread: Mounting packed Xonotic data with fuse (/showthread.php?tid=2557) |
Mounting packed Xonotic data with fuse - Nodenum - 01-27-2012 Hi folks I've been working on a fuse based filesystem for Linux that reads and mounts .zip/.pk3 files just the way Quake3, Xonotic, etc. do it. It's called pakdirfs http://xwmw.org/pakdirfs/ If you want to know what's inside Xonotic try pakdirfs Xonotic/data ~/mnt (works as normal user, no root user required) To overlay the user data try pakdirfs Xonotic/data ~/.xonotic/data ~/mnt It's also enlightening to see what kind of garbage accumulates in ~/.xonotic/data/dlcache. pakdirfs ~/.xonotic/data/dlcache ~/mnt It works with other games, too. I've tried Warsow and Doom3 so far but there are lots of other games that use .zip/.pk3 files for storing game content. This is version 0.1.0 so there may be trouble ahead but I've tried a lot to crash it and it seems reasonably stable now. Have fun! RE: Mounting packed Xonotic data with fuse - Mr. Bougo - 01-27-2012 Sweet! Does it take .pk3dir into account? That's a darkplaces-specific feature. I'll just mention that mounting dlcache isn't very indicative of anything since it's never all imported in the darkplaces FS at the same time. Pk3 files in dlcache are opened only when needed by the server. RE: Mounting packed Xonotic data with fuse - Nodenum - 01-27-2012 (01-27-2012, 03:20 PM)Mr. Bougo Wrote: Sweet! Does it take .pk3dir into account? That's a darkplaces-specific feature.No, it just looks for the extensions .pk3/.pk4/.zip in any of the given directories (non recursive). What is .pk3dir for? If it is another location for .pk3 files it simply could be added to search paths. (01-27-2012, 03:20 PM)Mr. Bougo Wrote: I'll just mention that mounting dlcache isn't very indicative of anything since it's never all imported in the darkplaces FS at the same time. Pk3 files in dlcache are opened only when needed by the server.Ok, that explains why calling "map xyz" fails for downloaded maps (unless the pk3 was moved moved to ~/.xonotic/data). But it is an interesting backlog nonetheless. I remember when I've discovered it first in Nexuiz I though "Wow, I haven't played this or that map for a year or more. It's still there!?" RE: Mounting packed Xonotic data with fuse - Mr. Bougo - 01-28-2012 AFAIK .zip is not unpacked, or is it? .pk3dir is a darkplaces feature to simulate pk3 precedence without having to make an archive. It's a directory that acts exactly like a pk3 with the same name would. I don't know what happens when a pk3 and a pk3dir share the same name. pk3dir is used in the xonotic git repositories, all the content of what would be the data.pk3 file is stored in a data.pk3dir directory instead. I guess you could check the darkplaces source files (fs.c I guess?) to see the details. RE: Mounting packed Xonotic data with fuse - Nodenum - 01-28-2012 (01-28-2012, 02:16 PM)Mr. Bougo Wrote: AFAIK .zip is not unpacked, or is it?Not the whole zip file, just the file(s) from it that were requested. That's the whole idea, to not have to have all files unpacked at once. (01-28-2012, 02:16 PM)Mr. Bougo Wrote: .pk3dir is a darkplaces feature to simulate pk3 precedence without having to make an archive. It's a directory that acts exactly like a pk3 with the same name would. I don't know what happens when a pk3 and a pk3dir share the same name.Nice, I didn't know about that one. It shouldn't be too hard to add. This is something for the next version. RE: Mounting packed Xonotic data with fuse - Mr. Bougo - 01-28-2012 Yes, but does Quake or Xonotic see files with .zip extensions the same as .pk3's? RE: Mounting packed Xonotic data with fuse - Nodenum - 01-29-2012 (01-28-2012, 04:50 PM)Mr. Bougo Wrote: Yes, but does Quake or Xonotic see files with .zip extensions the same as .pk3's? I haven't looked into the code too much but I guess the answer is no, they just look for .pk3 files. IIRC Quake3/Xonotic only support STORE and DEFLATE compression and .pk3 files aren't meant to use anything else. Whereas "normal" .zip files could use several other compression methods like LZMA, BZIP2, etc. RE: Mounting packed Xonotic data with fuse - Nodenum - 02-07-2012 Version 0.2.0 is now available. http://xwmw.org/pakdirfs/ It also supports .pk3dir directories. For some weird fun try: Code: pakdirfs Xonotic/data/ ~/mount/ Code: find ~/mount -iname *.ogg -print0 | xargs -0 vlc RE: Mounting packed Xonotic data with fuse - Mr. Bougo - 02-07-2012 Awesome! |