Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
RjY

Please filter out Boom direct-SSG weapon change tics when recording vanilla demos

Recommended Posts

From the DW Ironman Perdition's Gate thread:

DRL 3.33 said:

Survived! I don't know how long I took though. Played with Eternity.

https://www.dropbox.com/s/kunm22gdcm13r5f/drlpgim.lmp?dl=1

Edit: Turns out this demo desyncs in PRBoom. Anyone who wants to watch this will have to use Eternity. I used -vanilla so it should work in Vanilla/Chocolate Doom too.


The reason this breaks in Pr+ is the demo contains several direct-to-ssg weapon change tics. The first is on tic 49181, which is the point where the demo goes out of sync, as the player switches to chainsaw instead of SSG.

% od -j109 -An -t d1 -vw4 drlpgim.lmp | nl -v0 | awk 'and($5,4) && !(rshift($5,3) < 7)'    
 49181      0    0    0   68
 74176      0    0    0   68
 95254     50    0    0   68
261631      0    0    0   68
(Curiously they are all single tics, likely some quirk of DRL 3.33's keyboard or mouse or whatever he was using to play)

The demo actually plays back in Pr+ with a command line switch -allow_ssg_direct.

Direct SSG switch was added in Boom, obviously vanilla demos can't contain them. Please consider filtering them out. The fix from PrBoom is below. It would be great if you could adapt it for Eternity.
Spoiler

------------------------------------------------------------------------
r1417 | cph | 2006-04-06 14:53:12 +0100 (Thu, 06 Apr 2006) | 4 lines

Supress straight-to-supershotgun key for demo_compatibility (no such key prior
to Boom, so using this when recording compatible demos led to bad demos).
Thanks again e6y.


diff --git a/NEWS b/NEWS
index ecca2de5..92a7032d 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Changes from v2.4.0 to v2.4.1
 - add ultdoom compatibility level, and bring compatibility levels into line
   with Prboom+
 - screenshots now use correct palette in software mode
+- suppress use-supershotgun key in compatibility mode
 - removed obsolete video related code
 - fix screenshots on 64bit systems
 - fix comp_666
diff --git a/src/g_game.c b/src/g_game.c
index 8fc5e273..630b5ca1 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -397,7 +397,7 @@ void G_BuildTiccmd(ticcmd_t* cmd)
         gamekeydown[key_weapon6] && gamemode != shareware ? wp_plasma :
         gamekeydown[key_weapon7] && gamemode != shareware ? wp_bfg :
         gamekeydown[key_weapon8] ? wp_chainsaw :
-        gamekeydown[key_weapon9] && gamemode == commercial ? wp_supershotgun :
+        (!demo_compatibility && gamekeydown[key_weapon9] && gamemode == commercial) ? wp_supershotgun :
         wp_nochange;
 
       // killough 3/22/98: For network and demo consistency with the
------------------------------------------------------------------------

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×