MantisBT - Zandronum
View Issue Details
0003315Zandronum[All Projects] Bugpublic2017-10-28 01:432020-04-11 01:35
0003315: Incorrect ticking routine for players on servers
In ZDoom, the following happens:
-P_PlayerThink is called for every players (which ticks the psprites which is responsible for doing the hitscan attacks and so on)
-Only then are the DThinkers ticked which ticks the players mobj which makes them move

However in Zandronum this does not hold true, the players mobj are ticked directly after P_PlayerThink is called effectively making any hitscan attacks called by the next players potentially miss a given body.
Using the debug commit and the test wad referenced in 0002859:0018627:
-host a server on MAP01 (no need to enable sv_unlagged_debugactors)
-connect and join 2 clients locally (it is important to test this with no ping so as to not run into issue 0003316)
-make sure to have cl_ticsperupdate on 1 so as to not run into 0003317
-additionally you can connect an extra third client to make sure of what happens
-align them horizontally and try to shoot each other: if the player you're trying to shoot ticks before you do, you will completely miss him even if this is a local connection and no ping is involved
After the fix, trying to reproduce the bug using the steps above is impossible.
No tags attached.
Issue History
2017-10-28 01:43LeonardNew Issue
2017-10-28 01:43LeonardStatusnew => assigned
2017-10-28 01:43LeonardAssigned To => Leonard
2017-10-28 01:55LeonardSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11204#r11204
2017-10-29 16:43LeonardNote Added: 0018650
2017-10-29 16:43LeonardStatusassigned => needs review
2017-11-06 16:47LeonardNote Added: 0018813
2017-11-06 16:47LeonardStatusneeds review => needs testing
2020-04-11 01:35Ru5tK1ngNote Added: 0021263
2020-04-11 01:35Ru5tK1ngStatusneeds testing => resolved
2020-04-11 01:35Ru5tK1ngResolutionopen => fixed
2020-04-11 01:35Ru5tK1ngFixed in Version => 3.1

2017-10-29 16:43   

I think this is incompatible with the sv_useticbuffer CVar by the way.
With the CVar on, it is guaranteed that a player's mobj will only tick after P_PlayerThink is called for you even if said player has more than just one movement command in his buffer but with it off that is no longer the case.
Do we still want to keep that CVar around?
I thought we only wanted it to make sure there were no longer any desyncs caused by it.
The CVar was discussed here: 0002330:0012907 and 0002330:0012924.
I think the fix for 0003316 also does not work with sv_useticbuffer off.
2017-11-06 16:47   
This was merged in 3.1.
2020-04-11 01:35   
Tested online with alpha-r200329-1854 and followed the steps as listed. I was able to hit the other client with my pistol without issue and spawn blood each time as an indicator. Issue seems to be fixed and I will mark as resolved for now.