New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic pk3dir and <pak>dir support #2554
Comments
|
A couple of comments and questions. First of, I think this should be optional, so the packageformat would be extended to The Then I'm wondering about the behavior when both the package file and the directory are present, e.g. you have
Could you find out how other editors handle this? |
|
Maybe it would be cleaner to allow multiple package formats like: and this gives you well defined priority as well. (There are engines e.g. FTEQW that support all 3 package types as well as others). So we don't break all existing game configs, "packageformat" being a dictionary should be still supported. From checking FTEQW sources it seems to load all of the files for a given package format, then all of the files for the next format, etc., but I'm not sure whether pk3dir comes before or after pk3. Side node, we could express Quake's counterintuitive behaviour where loose files have a lower priority than files with the same name in pak's, which is currently hardcoded in TB, like this: Quake 3 doesn't even load loose files not in a pk3 does it? |
|
This looks like a good idea except if a package dir completly replaces its corresponding package, that is, if you find pak0.pk3 and pak0.pkdir, pak0.pk3 is not even loaded at all. @illwieckz could you please clarify this? Otherwise I like your proposal, however the loosefiles entry should go before the pak entry to achieve Quake's behavior, since the priority is in ascending order. |
|
For what I know, in case of I tried to verifiy reading the code but that was boring. So I made a test bed you can download there. It's a This contains a pk3dir, a pk3 and a map, both having a The pk3dir contains 3 textures, one red named The pk3 contains 3 textures, one green named Both Once loaded in radiant texture browser (here NetRadiant), the red one overrides the green one as expected and both blue and yellow are displayed as expected: This is verified in both NetRadiant: And in GtkRadiant: All radiants are GtkRadiant forks so if they don't behave the same, it's a bug. Technically radiant editors load pk3dir as yet another vfs (default vfs being the engine one and the home user one). To test how This is how it is seen within engine, we clearly see that the red texture from the pk3dir was clearly used by q3map2 instead of the green one from the pk3: |
|
I did the same to test loose file, you can download extended test bed there I added loose files, the We see that the loose Don't worry if this one looks darker, you must notice that the vertical grooves are lighter than the grey frames: By q3map2 map compiler: By ioquake3 engine: So, loose file > file in pk3dir > file in pk3. It does not sound counter-intuitive to me since loose files may be considered as to-be-released files. |
|
Since pk3dir is a vfs like the
This is verified by experience with reference editors (GtkRadiant, NetRadiant), reference map compiler (q3map2), reference engine (ioquake3). |
|
@illwieckz thank you very much! |
That's a side note but by reading how other things are done, the key may be named I know it's possible to do a trick like « if list load as In any way I'm with you about the need to support multiple package formats.
Why not but it looks over-engineered, other tools like radiant editors just look for Also that Note that So, there is an example of how it may look, with an implicit Note: I added an imaginary Now with an implicit To me the implicit |
|
Could PhysicsFS be used to support this kind of feature? |













A
pk3diris the directory equivalent of apk3: extractpak0.pk3content to a directory namedpak0.pk3dirand tadaa, you got a pk3dir. It's very convenient for modding as everything can be put in pk3-like layouts while using fully editables directories. This feature is already supported by GtkRadiant, NetRadiant and DarkRadiant (and perhaps some other radiants) and some game engines so it's a must have for TrenchBroom.I think the best implementation would be to do it the DarkRadiant way: for each existing package
<extension>, support for<extension>dirwould be implied. For example if someone adds this in a game config file:TrenchBroom would automatically enable support for
pk3dir,pk4diranddpkdir¹, and I'm sure people would appreciatewaddirfor same purpose._____
¹
pk4is the doom3/quake4 package format which is just apk3with a4, anddpkis an evolution ofpk3by the Dæmon engine (see more) that is thought to be loadable by existing pk3 code.The text was updated successfully, but these errors were encountered: