Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mounting packed Xonotic data with fuse

#1
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!
Reply

#2
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.
Reply

#3
(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!?"
Reply

#4
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.
Reply

#5
(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.
Reply

#6
Yes, but does Quake or Xonotic see files with .zip extensions the same as .pk3's?
Reply

#7
(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.
Reply

#8
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/
find ~/mount -iname *.ogg -print0 | xargs -0 mplayer
or
Code:
find ~/mount -iname *.ogg -print0 | xargs -0 vlc
Reply

#9
Awesome!
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] How to build data AriosJentu 5 3,788 08-14-2019, 08:18 AM
Last Post: Freddy
Brick Separate meshes and animation data MirceaKitsune 11 14,313 11-08-2012, 07:57 AM
Last Post: HellYeah

Forum Jump:


Users browsing this thread:
4 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-