SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Post Reply
User avatar
Korell
Posts: 439
Joined: Sun May 28, 2017 1:01 pm

SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Post by Korell »

For some years now, I have been maintaining a version of Pirate Doom by applying various fixes to make it compatible with the latest GZDoom version. The mod can be found here, as a sub-mod of the original Pirate Doom (for which I take no credit).
https://www.moddb.com/mods/pirate-doom/ ... v-18-fixed

A recent post (which I only saw yesterday as I've not been checking it much lately) mentions that there is a missing sprite issue with the super shotgun. I was able to track this down to the SHT2EO sprite. Pirate Doom has replacement sprites for which it just uses the original sprite names (probably not ideal, but it's an old mod), and when I opened up the WAD file in SLADE, the SHT2EO sprite is the same format as all the other sprites (truecolour PNG) so I couldn't see anything wrong with it.

After a little bit of investigation, I noticed that it was using the widescreen fixed SHT2EO from the recent game_widescreen_gfx.pk3 file that recent versions of GZDoom comes bundled with, and by renaming this file so that it doesn't load, the correct sprite from within Pirates!.wad was then used, confirming that it is indeed the game_widescreen_gfx.pk3 file that is causing the sprite issue.

Looking at game_widescreen_gfx.pk3 within SLADE shows that it has a SHT2EO sprite lump within filter/doom.id/patches/ (I think it is the only sprite within a patches subfolder as the folders for the other games contain folders named graphics and sprites). There is also a textures.txt file within filter/doom.id.doom2/ that references this replacement SHT2EO sprite. But why would this be taking precedence over the sprites within the mod itself, Pirates!.wad, when the mod is loaded afterwards? Is it because it is specifically located within a patches folder, or is it a bug?

To fix the issue, I've now renamed the sprite within the mod to SHT2P0 (simply because there were other sprite names in alphabetical sequence up to SHT2O0), and updated the TEXTURES file in the mod to reference SHT2E0 with a different sprite for the patch as follows:

Code: Select all

sprite SHT2E0, 700, 480
{
xscale 1.5
yscale 1.5
WorldPanning
offset -153, -130
patch SHT2P0, 0, 0
}
It works and there are no errors returned, but is this the correct way to fix this? I would guess that any other mods that replace SHT2EO will also be affected, so should game_widescreen_gfx.pk3 really take precedence over replacement sprites loaded by mods?
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Post by drfrag »

That change was made to make widepix compatible with wadsmoosh, in LZDoom i didn't apply what change and kept the graphic as a sprite. So LZDoom should not be affected.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Post by Graf Zahl »

I am in favor of getting the file out of the patches/ folder, but this report highlights a problem with the setup:

If you name your patch the same as the defined texture in TEXTURES and do not use the correct texture type for declaring the patch you will get unpredictable lookup behavior if there's collisions.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Post by Rachael »

Where should it go then? In the sprites folder exclusively under the Doom 2 filter?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Post by Graf Zahl »

Make a copy, plain and simple.
It's simply not worth risking such conflicts for saving a handful of bytes.
Post Reply

Return to “Technical Issues”