Brutal Doom 64 v2.666 ZMovement fix

It’s no secret that I’m big fan of original Doom/Doom 2 games serial, and even today I enjoy it using excellent GZDoom source port and huuuuge Doom/Doom 2 mods scene. Recently, I found out Brutal Doom 64 v2.666 Unofficial mod and I was really impressed by the work of Steven Connell (current main maintainer) and the community. So much that I decided to contribute with hires graphics upscaling (still not publicly available, attached images in this post are snapshoted with those upscaled textures), utilizing my photo editing experience and access to professional AI upscaling software as a photographer.

During the work, I found out very interesting ZMovement add-in, written in GZDoom Zscript by Ivory Duke for “original” (better said “gzdoomed”) Doom/Doom2 game. It allows using physics movement in the style of original Doom/Quake/Unreal Tournament/Build engine movement. But I found out it did have one relatively big issue in BD64 – when checking in-game security camera monitors or computer displays, it wasn’t displaying anything.

Picture would flash just for a split second. As those in-game security cameras and monitors are hinting player to secrets areas and lore, I really wished this works properly. After contacting Steven Connell, BD64 v2.666 mod author, I realized he isn’t original add-on author (shout out to BigStronk64 who converted this add-in mod to BD64 and one of the current contributors to BD64 v2.666) and it wasn’t likely this will be fixed soon, so I decided to check the code myself. After couple of hours learning GZDoom specifics with the help of online documentation (also this) and ZDoom/DoomWorld forums, I managed to fix the issue – turns out with just few lines of the code (for a record, this add-in contains ~4000 lines of C#/Java like code written in ZScript).

If somebody is interested, here is download link for fixed BD64 ZMovement add-in (right click on link and select “Save as” for download if instead of download you get a page with gazillion of characters).

Snippet of the code which fixed issue:

///////////////////////////
// SECURITY CAMERA DELAY TIMER

const	SecCamDelayTicks = 36;
int		SecCamTimer;

...

// HANDLE SECURITY CAMERAS
if (ZMPlayer.Cheats & CF_REVERTPLEASE != 0)			//is camera changed
{
	player.cheats |= CF_TOTALLYFROZEN;				//freeze player - no player movement from sec. camera
	SecCamTimer += 1;								//start delay timer

	if (SecCamTimer>SecCamDelayTicks)
	{
		if (GetPlayerInput(0, INPUT_OLDBUTTONS) & (BT_USE|BT_BACK))		//check Use (E) or Back (S) keys
		{
			SecCamTimer = 0;						//key was pressed - reset delay timer
			player.cheats &= ~CF_TOTALLYFROZEN;		//unfreeze player
			ZMPlayer.Cheats &= ~CF_REVERTPLEASE;	//return camera back to player
			ZMPlayer.Camera = ZMPlayer.Mo;
		}
		else										//timer expired but still no keypress
		{
			SecCamTimer=SecCamDelayTicks;			//prevent int from growing infinitely and potential overflow
		}
	}
}

BTW, justice for Mick Gordon …

September 2nd, 2024 | Posted in Doom, Windows |

Leave a Reply