Beta - Final pk3 shader file conflict?


(pazur) #1

I changed a shader in the recent version of my map. It’s an important one: the asphalt in my map had landmines on. Now I removed it.

What will happen when someone has two versions of my map? The beta pk3 and the final pk3? What shader will load?

Would you guys recommend to rename the shader and replace it in GtkRadiant?


(Wezelkrozum) #2

I recommend to change the mapname into mapname_final or something. It’s confusing to use 2 same mapnames and the game will only load one of the maps so the other can’t be played.
The server will only load the shaderfiles of the final map when you load the map because it only loads the files in the pk3 of your map and not all the pk3’s.


(pazur) #3

Yea. Will rename the map. It’s now “adlerhorst_b”… will have “adlerhorst” for the final. Good to hear that the shader won’t be a problem.


(Flippy) #4

Also, if the pk3’s have the same name, how can someone have two versions of your map? You can’t have two files with the same names…

Even if a server was running your final pk3 and a client connects who only has your beta pk3 (with the exact same name), I still think ET can see this and will make the client download the final pk3 from the server.

But still, you should change the name yes.


(kamikazee) #5

[QUOTE=wezelkrozum;179687]I recommend to change the mapname into mapname_final or something. It’s confusing to use 2 same mapnames and the game will only load one of the maps so the other can’t be played.
The server will only load the shaderfiles of the final map when you load the map because it only loads the files in the pk3 of your map and not all the pk3’s.[/QUOTE]
This is not entirely true. You are right that only one of the two can be played if the bsp’s have the same name, but both pk3’s will be looked at.

I can’t remember if the “pak name precedence rule” applies for shaders (whether it’s the first or last who wins), but it was definitely so that pk3’s with textures could override textures from the paks when playing another map.


(IndyJones) #6

i don’t think there will be a shader conflict, because i doubt server owner would keep 2 versions of one map… only on lan :slight_smile:


(Wezelkrozum) #7

so the conclusion:
If you change the name of the pk3 and the bsp it won’t be a problem because only one pk3 (the pk3 of the .bsp which you called up) will be loaded.


(kamikazee) #8

[QUOTE=wezelkrozum;179715]so the conclusion:
If you change the name of the pk3 and the bsp it won’t be a problem because only one pk3 (the pk3 of the .bsp which you called up) will be loaded.[/QUOTE]
No, that is a false conclusion. The only way to make only one version load is by making sure that there is only one pk3 present.
When you have two files, e.g. x_b.pk3 and x.pk3, both are loaded. The one loaded last wins on similar-named items. Things which are only defined in one of them are always loaded.

However, the part where my memories get fuzzy is if the “last loaded wins” rule applies for every file type. Shaders could be an exception.

Still, mixing two versions is tricky and needs careful testing. The best way to know if it works is to throw both into a clean install and play both versions.
It could very well be that suddenly the changed shader is reverted back to its former settings because both pk3s are present.

So the best advice to server admins: remove your old copies.


(-SSF-Sage) #9

[QUOTE=kamikazee;179717]No, that is a false conclusion. The only way to make only one version load is by making sure that there is only one pk3 present.
When you have two files, e.g. x_b.pk3 and x.pk3, both are loaded. The one loaded last wins on similar-named items. Things which are only defined in one of them are always loaded.

However, the part where my memories get fuzzy is if the “last loaded wins” rule applies for every file type. Shaders could be an exception.

Still, mixing two versions is tricky and needs careful testing. The best way to know if it works is to throw both into a clean install and play both versions.
It could very well be that suddenly the changed shader is reverted back to its former settings because both pk3s are present.

So the best advice to server admins: remove your old copies.[/QUOTE]

It shouldn’t overwrite. If you have 2 pk3’s and both has different shader with same name. The one that is in the pk3 that is alphaphetically after the other is used. And the other shaderfile is ignored. That’s afaik. Same should according to my limited testing of shaders overlapping apply to shaderfiles too. If you have myshader and myshader_x, the last one should win. That’s what happened to me. And I mean for the same shadernames/paths

Simpler explanation:

Not sure if here wins the file or the shadername.
mypk3_final ->myshader //win
mypk3->myshader //lose

packed in same pk3 (not sure how it will work if they are on different paks)

myshader -> mytexture //lose; mytexture_x //win

myshader_final -> mytexture //win; mytexture_y //win


(pazur) #10

You are losing me :wink: … I guess testing is the best method to find out.