quakespasm icon indicating copy to clipboard operation
quakespasm copied to clipboard

Quake Enhanced, Scourge of Armagon - missing texture

Open mooreye opened this issue 2 years ago • 14 comments

When playing Quake Enhanced, Scourge of Armagon, map hip2m4 the end gate of the level has checkered/missing texture, as seen on the screenshot. My hipnotic's pak0.pak md5sum is a9e2a6e544da7f506f6b65b0661e89a9, I use GOG purchase of Quake Enhanced.

https://imgur.com/1376s0r

mooreye avatar Apr 05 '23 15:04 mooreye

Reproduced with quake enhanced update3, hipnotic pak0.pak is 79,928,584 bytes with md5sum 4dd6bf448c9c3c2615b47e2e20bedb43

Possibly a missing texture - haven't investigated. How does ironwail or vkquake work? (CC: @andrei-drexler, @Novum)

sezero avatar Apr 06 '23 11:04 sezero

Same thing happens in vkquake for me

sezero avatar Apr 06 '23 12:04 sezero

And I assume this does not happen in the Kex Quake?

Novum avatar Apr 07 '23 20:04 Novum

And I assume this does not happen in the Kex Quake?

No, it doesn't seem to happen, although it uses different texture than the retro SoA did: https://youtu.be/VS6OwwXFIc4?t=409

mooreye avatar Apr 08 '23 14:04 mooreye

I'm getting a warning "Mod_LoadTexInfo: 12 textures missing from BSP file". Does not happen with the original hipnotic (non rerelease).

After debugging for like 5 minutes I have no idea how this works in Kex Quake: The texture lump just has invalid (-1) dataofs entries.

Novum avatar Apr 09 '23 21:04 Novum

Can anything be done to fix this with an extra pak1.pak or so?

mooreye avatar Jun 20 '23 16:06 mooreye

They probably use textures[0] for missed textures.

--- a/Quake/gl_model.c
+++ b/Quake/gl_model.c
@@ -1052,10 +1052,9 @@ static void Mod_LoadTexinfo (lump_t *l)
 		if (miptex >= loadmodel->numtextures-1 || !loadmodel->textures[miptex])
 		{
 			if (out->flags & TEX_SPECIAL)
-				out->texture = loadmodel->textures[loadmodel->numtextures-1];
+				out->texture = loadmodel->textures[0];
 			else
-				out->texture = loadmodel->textures[loadmodel->numtextures-2];
-			out->flags |= TEX_MISSING;
+				out->texture = loadmodel->textures[0];
 			missing++;
 		}
 		else
rerelease

image

patched quakespasm

image

andrey-budko avatar Aug 21 '23 21:08 andrey-budko

Huh.. Thanks @andrey-budko. Now, if we had a fool-proof way of detecting rerelease content..

sezero avatar Aug 21 '23 21:08 sezero

@Novum, @temx, @ericwa, @andrei-drexler: What do you think of this?

sezero avatar Aug 21 '23 21:08 sezero

I think we can ask @svkaiser

andrey-budko avatar Aug 21 '23 22:08 andrey-budko

FWIW, I can make a 'detection' (cough..) of remastered content like below. Combined with @andrey-budko suggestion, it would be like:

index c80450f..24781c3 100644
--- a/Quake/common.c
+++ b/Quake/common.c
@@ -39,6 +39,7 @@ cvar_t	cmdline = {"cmdline","",CVAR_ROM/*|CVAR_SERVERINFO*/}; /* sending cmdline
 static qboolean		com_modified;	// set true if using non-id files
 
 qboolean		fitzmode;
+qboolean		remastered = false;
 
 static void COM_Path_f (void);
 
@@ -2135,6 +2136,13 @@ _add_path:
 			search->next = com_searchpaths;
 			com_searchpaths = search;
 		}
+		if (i == 0 && path_id == 1) {
+			if (COM_FileExists("progs/b_g_key_00_00.lmp", NULL) &&
+			    file_from_pak && com_filesize == 4104) {
+				remastered = true; /* 2021 re-release content */
+				Con_Printf ("Playing remastered version.\n");
+			}
+		}
 		if (qspak) {
 			search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
 			search->path_id = path_id;
diff --git a/Quake/gl_model.c b/Quake/gl_model.c
index 46a83a9..0a9729c 100644
--- a/Quake/gl_model.c
+++ b/Quake/gl_model.c
@@ -1051,6 +1051,9 @@ static void Mod_LoadTexinfo (lump_t *l)
 		//johnfitz -- rewrote this section
 		if (miptex >= loadmodel->numtextures-1 || !loadmodel->textures[miptex])
 		{
+			if (remastered)
+				out->texture = loadmodel->textures[0];
+			else
 			if (out->flags & TEX_SPECIAL)
 				out->texture = loadmodel->textures[loadmodel->numtextures-1];
 			else
diff --git a/Quake/common.h b/Quake/common.h
index 05ff9d3..7694215 100644
--- a/Quake/common.h
+++ b/Quake/common.h
@@ -397,6 +397,7 @@ long FS_filelength (fshandle_t *fh);
 
 
 extern struct cvar_s	registered;
+extern qboolean		remastered;
 extern qboolean		standard_quake, rogue, hipnotic;
 extern qboolean		fitzmode;
 	/* if true, run in fitzquake mode disabling custom quakespasm hacks */

sezero avatar Aug 22 '23 20:08 sezero

no lightmap with TEX_MISSING flag

a

andrey-budko avatar Aug 22 '23 20:08 andrey-budko

no lightmap with TEX_MISSING flag

Well, I wasn't expecting any solutions to this thing at all to begin with.

I'm still not sure that your patch whether your patch can cause any serious side effects either. Ie.: no lightmap would be the least of issues with replacement textures, no?

sezero avatar Aug 22 '23 21:08 sezero

Just in case you didn't notice. I'm not sure about my patch too.

andrey-budko avatar Aug 22 '23 21:08 andrey-budko