MantisBT - Zandronum
View Issue Details
0000534Zandronum[All Projects] Bugpublic2011-07-28 09:152024-06-30 04:08
unknownna 
 
highmajoralways
confirmedopen 
98d 
 
0000534: Ammo desync if you have a high ping. Client thinks that it didn't use any ammo.
If you fire your weapon and then instantly pick up some ammo for the corresponding weapon your ammo count will desync. Your client thinks that it didn't use any ammo when you fired your weapon.
1. Start a standard COOP server (skill 3) with the example WAD loaded.
2. Connect a client to the server with an emulated ping of 300 ms.
3. Join the game.
4. Pick up the RL.
5. Pick up the RocketAmmo actor immediately after pressing +attack.

When you pick up the RL you'll have 2 rockets.
When you pick up the rocket ammo after pressing +attack you'll have 3 rockets locally. It should be 2.
You may then fire 2 rockets, but the last one will be a NULL rocket.
AFAICT, this has nothing to do with the weapon A_Raise/A_Lower desyncs. It still desyncs in 3287.
No tags attached.
related to 0000193closed Torr Samaho Able to fire weapon before it's passed A_Raise 
related to 0001116resolved Kaminsky Client fires weapon too early after respawning 
child of 0003980feedback Kaminsky Desync with firing weapons with WEAPON.NOAUTOFIRE flag 
? ammo_desync_test_01.wad (720) 2011-07-28 09:15
https://zandronum.com/tracker/file_download.php?file_id=394&type=bug
? wepdesync_emptyammo.wad (1,505) 2024-06-30 04:07
https://zandronum.com/tracker/file_download.php?file_id=3052&type=bug
Issue History
2011-07-28 09:15unknownnaNew Issue
2011-07-28 09:15unknownnaFile Added: ammo_desync_test_01.wad
2011-07-28 09:16unknownnaRelationship addedrelated to 0000193
2011-07-29 01:45Torr SamahoNote Added: 0001995
2011-07-29 02:59unknownnaNote Added: 0002004
2011-07-29 03:00unknownnaNote Edited: 0002004bug_revision_view_page.php?bugnote_id=2004#r1016
2012-03-01 07:20TIHanNote Added: 0002726
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug
2014-06-12 20:15WatermelonNote Added: 0009154
2014-06-12 20:15WatermelonStatusnew => feedback
2015-06-06 20:27unknownnaNote Added: 0012560
2015-06-06 20:27unknownnaStatusfeedback => new
2015-07-16 03:53unknownnaNote Added: 0012951
2018-08-27 18:58unknownnaRelationship addedrelated to 0001116
2018-08-27 18:58unknownnaStatusnew => confirmed
2024-05-27 18:27unknownnaRelationship addedchild of 0003980
2024-06-30 04:06unknownnaNote Added: 0023772
2024-06-30 04:07unknownnaFile Added: wepdesync_emptyammo.wad
2024-06-30 04:08unknownnaNote Edited: 0023772bug_revision_view_page.php?bugnote_id=23772#r14292

Notes
(0001995)
Torr Samaho   
2011-07-29 01:45   
The problem sounds like it is caused by timing issues very similar to the one responsible for the weapon sync issue and is most likely very difficult to fix, I can't say this for sure yet though.

Nevertheless, I'm pretty sure that Skulltag has been acting like this for ages now (if not since forever). Since nobody complained about this yet, I doubt that it's a major issue in practice.
(0002004)
unknownna   
2011-07-29 02:59   
(edited on: 2011-07-29 03:00)
> Since nobody complained about this yet, I doubt that it's a major issue in practice.

One thing to remember is that many people have adopted a "just-deal-with-it" attitude when it comes to ST sync bugs. I don't know why, but it seems that it's the general consensus. I'm pretty sure that people have been affected by this desync many times by now. We have better tools now (ping emulator) so it's a lot easier for us to find these sync issues on our own LAN servers and reproduce them, compared to how it used to be in the past.

It's only thanks to Zalewa's ping emulator that I'm able to reliably reproduce the desyncs.

(0002726)
TIHan   
2012-03-01 07:20   
There is probably a lot going on dealing with ammo than I know about.

From observations and code, when you pick up ammo, the client gets updated with the full amount. Just curious if incremental amounts have been attempted? Such as, I have 2 rockets, then I pick up one rocket, the server tells the client who picked up the ammo, to increase by one, rather than setting his amount at 3. Of course, clients who didn't pick up would get the full amount on the client who picked up the ammo.
(0009154)
Watermelon   
2014-06-12 20:15   
Still the same in Zan 2.0?
(0012560)
unknownna   
2015-06-06 20:27   
Yep.
(0012951)
unknownna   
2015-07-16 03:53   
Quote from AlexMax
By the way, if you need an easy way to test for weapon desync, BFGSHOOT in Duel40 is a really easy way to make said desyncs appear. Play it against a bot, and you can make the BFG ball desync from the weapon animation really easily over the course of normal play.

You're very likely to encounter this desync in BFGSHOOT if you have a ping of 250 since it happens when you pick up ammo immediately after running out of ammo.
(0023772)
unknownna   
2024-06-30 04:06   
(edited on: 2024-06-30 04:08)
After thoroughly testing the new weapon sync for a while now, I was finally able to make this particular issue easy to reproduce. I made an example wad with a bind that will reproduce it 100% of the time. You're actually likely to encounter this bug during regular CTF play if you run out of SSG ammo and then immediately pick up some shells while having a rocket launcher in your inventory, which could happen often on certain maps in the IDL wads.

1. zandronum -iwad doom2.wad -file wepdesync_emptyammo.wad -host +sv_itemrespawn 1
2. Connect a client to the server with an emulated ping of 160 and join the game.
3. Copy-paste "+attack;wait 14;-attack;+forward;wait 5;-forward;wait 25;+attack;wait 75;-attack" into the console. After firing the SSG and running out of ammo, you will move forward to pick up ammo at a certain tick, this in turn will cause the rocket launcher being selected to desync, firing missing rockets and spending ammo.
4. Spectate, re-join the game and re-enter the bind to reproduce it every time.


If the initial wait is 14 tics, it desyncs, but if it's one tic longer at 15, it no longer desyncs.
And when the desync is triggered, it will actually desync all the way between 25 tics to 69 tics, so for 44 tics.

+attack;wait 14;-attack;+forward;wait 5;-forward;wait 25;+attack;wait 75;-attack
+attack;wait 14;-attack;+forward;wait 5;-forward;wait 69;+attack;wait 75;-attack


Both binds will always reproduce the desync.