SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

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

Moderator: GZDoom Developers

SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Postby Korell » Tue Dec 28, 2021 8:36 am

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 allExpand view
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
Korell
 
Joined: 28 May 2017

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Postby drfrag » Tue Dec 28, 2021 9:07 am

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
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Postby Graf Zahl » Tue Dec 28, 2021 9:38 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Postby Rachael » Tue Dec 28, 2021 10:35 am

Where should it go then? In the sprites folder exclusively under the Doom 2 filter?
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Postby Graf Zahl » Tue Dec 28, 2021 10:57 am

Make a copy, plain and simple.
It's simply not worth risking such conflicts for saving a handful of bytes.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: SHT2EO patch in game_widescreen_gfx.pk3 takes precedence

Postby Rachael » Tue Dec 28, 2021 11:04 am

User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest