MantisBT - Zandronum
View Issue Details
0003980Zandronum[All Projects] Bugpublic2022-02-24 05:002024-05-27 18:27
Kaminsky 
Kaminsky 
highminoralways
feedbackopen 
3.1 
3.2 
0003980: Desync with firing weapons with WEAPON.NOAUTOFIRE flag
Sometimes, if you try firing a weapon that has the WEAPON.NOAUTOFIRE flag (e.g. rocket launcher or BFG9000) the firing animation plays like normal but no projectile/hitscan appears. This doesn't seem to be a problem when firing weapons that don't have the flag.

I suspect that in some cases, there's a discrepancy in the value of player_t::attackdown between the server and client which causes the desync.
The issue appears to occur intermittently, but might occur more frequently right after spawning. In my experience, playing a few games of deathmatch or CTF on maps containing rocket launchers or BFGs is a good way to encounter the bug.


Use the example wad in the link below:
'https://zandronum.com/tracker/file_download.php?file_id=1547&type=bug [^]'
1. zandronum -iwad doom2.wad -file changemap_weap_desync.wad -host +sv_nomonsters 1
2. Connect a client to the server with an emulated ping of 160 and join the game.
3. Copy-paste "kill;wait 35;+use;wait 1;-use;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 75;-attack" into the console. The weapon will start to fire too early, spending ammo and animating the rocket launcher with no rockets coming out.
The issue also causes the "rampage" mugshot to appear on the status bar when it shouldn't.

[11:46 PM] agaures: marine guy brought up a good point about it happening with rocket launchers in ctf
[11:47 PM] agaures: for whatever reason i've had that happen to me a lot so that's what i was trying to search for last night
[11:49 PM] agaures: he also mentioned something interesting to me in dm: he posted a video of 3.1 where when shooting the pistol and then switching to the rl, the statusbar face would i think either switch to the angry one of "you've been holding down mouse1 for a while" or remain static (i couldn't tell it was a custom statusbar face)
No tags attached.
related to 0001116resolved Kaminsky Client fires weapon too early after respawning 
related to 0003715confirmed  COOP SPY feature show frozen (ready) weapon state on weapons with +WEAPON.NOAUTOFIRE 
parent of 0003491feedback Kaminsky Berserk powerup causes weapons to desync and client to fire weapon too early 
parent of 0000534confirmed  Ammo desync if you have a high ping. Client thinks that it didn't use any ammo. 
has duplicate 0001780closed  BFG plays sound and uses ammo but doesn't fire. 
Not all the children of this issue are yet resolved or closed.
Issue History
2022-02-24 05:00KaminskyNew Issue
2022-02-24 05:00KaminskyStatusnew => assigned
2022-02-24 05:00KaminskyAssigned To => Kaminsky
2022-02-24 05:42WaTaKiDNote Added: 0022147
2022-02-25 15:30KaminskyNote Added: 0022149
2022-02-25 15:30KaminskyRelationship addedrelated to 0001116
2022-08-04 16:38DrinkyBirdNote Added: 0022302
2022-08-04 16:38DrinkyBirdNote Deleted: 0022302
2024-03-01 18:21Ru5tK1ngRelationship addedparent of 0001780
2024-05-15 14:54unknownnaNote Added: 0023702
2024-05-15 14:54unknownnaRelationship addedrelated to 0003715
2024-05-15 16:00unknownnaRelationship replacedhas duplicate 0001780
2024-05-26 14:32KaminskyNote Added: 0023712
2024-05-26 14:32KaminskyStatusassigned => needs review
2024-05-27 05:49unknownnaNote Added: 0023722
2024-05-27 05:50unknownnaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14214#r14214
2024-05-27 05:52unknownnaNote Edited: 0023722bug_revision_view_page.php?bugnote_id=23722#r14216
2024-05-27 05:53unknownnaReproducibilityrandom => always
2024-05-27 09:28unknownnaNote Edited: 0023722bug_revision_view_page.php?bugnote_id=23722#r14217
2024-05-27 10:23KaminskyNote Added: 0023724
2024-05-27 18:27unknownnaNote Added: 0023726
2024-05-27 18:27unknownnaStatusneeds review => feedback
2024-05-27 18:27unknownnaRelationship addedparent of 0003491
2024-05-27 18:27unknownnaRelationship addedparent of 0000534

Notes
(0022147)
WaTaKiD   
2022-02-24 05:42   
is this already reported as'https://zandronum.com/tracker/view.php?id=3492 [^]' ?
(0022149)
Kaminsky   
2022-02-25 15:30   
Some people claimed that this also happened in 3.0 and not just 3.1, so this could be more of a symptom of:'https://zandronum.com/tracker/view.php?id=1116 [^]'

On the other hand, based on this recording from someone else, the mugshot bug seemed to happen without them respawning:'https://cdn.discordapp.com/attachments/917702959364710400/917704206129987644/zandronum_2021-12-07_11-00-03-23.mp4 [^]'
(0023702)
unknownna   
2024-05-15 14:54   
Quote from Kaminsky
The issue appears to occur intermittently, but might occur more frequently right after spawning.


This is very much a duplicate of the issue I reported earlier. It would be very nice to have the respawn desync fixed if possible, especially since this is a cornerstone first person shooter where every second counts in PvP modes. It doesn't feel complete at the moment, you always fire too early at spawns currently. The weapon sync has been broken for 12 years by now..
When Torr and I originally worked on these issues way back, we actually fixed it at first, but fixing a separate packet-loss issue with weapons that occurred after "changemap" map changes in coop modes caused it to break again when respawning. After that, nobody really looked into it again. From the looks of it, Leonard seemed to dabble in it, but it seems nothing came out of it.
(0023712)
Kaminsky   
2024-05-26 14:32   
I created a new merge request that should address the desync:'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/122 [^]'
(0023722)
unknownna   
2024-05-27 05:49   
(edited on: 2024-05-27 09:28)
The WEAPON.NOAUTOFIRE desync might be a separate issue and is caused by multiple +attack and -attack buttons arriving and colliding at a single tick, from testing and comparing two separate binds to try to reproduce the issue. I didn't get to test your fix yet however to see if it fixes this.

Using the example wad from:'https://zandronum.com/tracker/file_download.php?file_id=1547&type=bug [^]'

and starting a server and following these steps:

1. zandronum -iwad doom2.wad -file changemap_weap_desync.wad -host +sv_nomonsters 1
2. Connect a client to the server with an emulated ping of 160 and join the game.
3. Copy-paste "kill;wait 35;+use;wait 1;-use;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 1;-attack;wait 1;+attack;wait 75;-attack" into the console. The weapon will start to fire too early, spending ammo and animating the rocket launcher with no rockets coming out.

You can 100% reproduce the "missing rocket launcher / BFG" issue with the bind above.

(0023724)
Kaminsky   
2024-05-27 10:23   
Using the minimal example WAD you provided and following the steps listed above, I'm able to reproduce the bug (i.e. the rocket launcher looks like it's firing but no rockets spawn) without the fix. With the fix, however, I can't reproduce the bug anymore. The rocket launcher fires and spawns the four rockets, as expected.

If you're interested in testing the fix yourself to see if it works, I uploaded the build here:'https://www.mediafire.com/file/99j3igz0d6i3440/ZandroDev3.2-wepdesync-fix.zip [^]'

Thanks!
(0023726)
unknownna   
2024-05-27 18:27   
Indeed, the fix seems to take care of this issue in general. Well done.

Players can however, and will still end up firing "missing rockets / BFG" due to the remaining weapon/ammo desyncs, such as:

'https://zandronum.com/tracker/view.php?id=3491 [^]' (berserk powerup desync)
'https://zandronum.com/tracker/view.php?id=534 [^]' (ammo count pickup desync with latency)

The two issues above will still cause it to happen during normal deathmatch/duel gameplay on certain popular maps, e.g. Duel40: UROBUROS and BFGSHOOT.

And the desyncs below could potentially cause the issue as well if you drag it all the way out after initially desyncing, though they are more special cases:

'https://zandronum.com/tracker/view.php?id=2309 [^]' (changemap desync in coop)
'https://zandronum.com/tracker/view.php?id=2311 [^]' (post-win sequence desync)
'https://zandronum.com/tracker/view.php?id=1094 [^]' (morph weapon raise desync)