MantisBT - Zandronum
View Issue Details
0001510Zandronum[All Projects] Bugpublic2013-09-17 21:152018-09-30 22:38
Edward-san 
Edward-san 
lowtweakalways
closedfixed 
1.2 
1.3 
0001510: Server sends useless inconsistent hp/armor values (100/100) to the other clients when a player is damaged
To be more precise, it happens only when the server does not allow the other clients to know the precise values (like in deathmatch).

To have a good perception of this problem, play a custom wad which has an HP/Armor filling bar and has custom spawnhealth (like for example AOW when using mechs or ZDoomWars).

Please someone test the attached patch!
- Host a server with one of the custom wads in deathmatch mode and allow coopspy;
- load a map which has a damaging sector/floor like lava or radiation;
- let two clients connect, one joins the game, another one is a coopspy spectator;
- let the player take the damage;
- the spectator sees a sudden passage of HP from spawnhealth to 100 and the armor from 0 to 100.
No tags attached.
related to 0000071closed Torr Samaho Health desync with zdoom wars hud 
txt inconsistent_hp_armor.txt (2,545) 2013-09-17 21:15
/tracker/file_download.php?file_id=1064&type=bug
txt inconsistent_hp_armor_2.txt (4,992) 2014-04-13 19:36
/tracker/file_download.php?file_id=1198&type=bug
txt inconsistent_hp_armor_3.txt (4,960) 2014-04-13 21:37
/tracker/file_download.php?file_id=1199&type=bug
Issue History
2013-09-17 21:15Edward-sanNew Issue
2013-09-17 21:15Edward-sanStatusnew => assigned
2013-09-17 21:15Edward-sanAssigned To => Edward-san
2013-09-17 21:15Edward-sanFile Added: inconsistent_hp_armor.txt
2013-09-17 21:17Edward-sanRelationship addedrelated to 0000071
2013-09-18 04:11ZzZomboNote Added: 0007211
2013-09-18 04:14ZzZomboNote Edited: 0007211bug_revision_view_page.php?bugnote_id=7211#r4032
2013-09-18 04:15ZzZomboNote Edited: 0007211bug_revision_view_page.php?bugnote_id=7211#r4033
2013-09-18 17:38QentNote Added: 0007223
2013-09-18 17:39QentNote Edited: 0007223bug_revision_view_page.php?bugnote_id=7223#r4039
2013-09-18 21:05Edward-sanNote Added: 0007226
2013-09-21 15:49AlienOverlordNote Added: 0007261
2014-01-10 11:23Edward-sanNote Added: 0007940
2014-01-10 11:23Edward-sanStatusassigned => needs review
2014-01-10 12:03ZzZomboNote Added: 0007941
2014-01-10 15:25Konar6Note Added: 0007942
2014-01-10 22:56Edward-sanNote Added: 0007945
2014-01-10 22:57Edward-sanNote Edited: 0007945bug_revision_view_page.php?bugnote_id=7945#r4392
2014-04-13 13:27Torr SamahoNote Added: 0008562
2014-04-13 16:21Edward-sanNote Added: 0008565
2014-04-13 18:13Torr SamahoNote Added: 0008566
2014-04-13 18:26Edward-sanNote Added: 0008567
2014-04-13 19:23Edward-sanFile Added: inconsistent_hp_armor_2.txt
2014-04-13 19:24Edward-sanNote Added: 0008568
2014-04-13 19:27Edward-sanFile Deleted: inconsistent_hp_armor_2.txt
2014-04-13 19:28Edward-sanFile Added: inconsistent_hp_armor_2.txt
2014-04-13 19:36Edward-sanFile Deleted: inconsistent_hp_armor_2.txt
2014-04-13 19:36Edward-sanFile Added: inconsistent_hp_armor_2.txt
2014-04-13 21:37Edward-sanFile Added: inconsistent_hp_armor_3.txt
2014-04-13 21:43Edward-sanNote Added: 0008570
2014-06-08 00:23Edward-sanNote Added: 0008891
2014-06-08 00:23Edward-sanStatusneeds review => feedback
2014-06-08 00:24Edward-sanNote Edited: 0008891bug_revision_view_page.php?rev_id=4827
2014-06-08 00:24Edward-sanNote Deleted: 0008891
2014-06-08 00:24Edward-sanStatusfeedback => needs review
2014-06-08 10:12Torr SamahoNote Added: 0008907
2014-06-08 10:23Torr SamahoNote Edited: 0008907bug_revision_view_page.php?bugnote_id=8907#r4834
2014-06-08 10:23Torr SamahoStatusneeds review => needs testing
2014-07-04 17:36ArcoNote Added: 0009836
2014-07-04 17:36ArcoStatusneeds testing => resolved
2014-07-04 17:36ArcoResolutionopen => fixed
2018-09-30 22:38Blzut3Statusresolved => closed

Notes
(0007211)
ZzZombo   
2013-09-18 04:11   
(edited on: 2013-09-18 04:15)
I think either the client should just show ?/? for HP/AP or SpawnHealth value/MaxArmor (zero?) value.

Q: Why such system do exist in first place? Many (all known competitive TBH) games such as CS/L4D don't hide opponents' health/armor if they are observed in deathcam or by spectators.

(0007223)
Qent   
2013-09-18 17:38   
(edited on: 2013-09-18 17:39)
A couple questions were raised while testing the patch last night:
- When a player dies, should other clients be notified of their remaining armor?
- If not, should the health be shown at maximum or zero for other clients?

My view is that health should drop instantly to zero when spying on a player dying. Armor should remain at whatever the default for that player class was (usually zero, something else in some mods like ZDoomWars).

(0007226)
Edward-san   
2013-09-18 21:05   
BTW: the test went well, with the help of Qent and 75. Apparently there are no regressions, hence this patch can be appliable imo.
(0007261)
AlienOverlord   
2013-09-21 15:49   
Oh, so this explains why spectators observe thick red pain screen after someone gets Soulsphere and immediately receives small damage in competitive modes. Client thinks that player's HP lowers from 200 (local prediction) to 100. This is also a bug btw
(0007940)
Edward-san   
2014-01-10 11:23   
I just remembered I forgot to set the correct status.
(0007941)
ZzZombo   
2014-01-10 12:03   
But don't you find "?/?" being much better solution if we still don't want to stop hiding this information? And I still insist hiding HP and armor shouldn't be so strict (and TBH I never understood why we do it), and at least spectators could see the real state of the game.
(0007942)
Konar6   
2014-01-10 15:25   
I'm wondering as well why spectators are not allowed to see players' health. I can't see how it could be efficiently abused for cheating.
(0007945)
Edward-san   
2014-01-10 22:56   
(edited on: 2014-01-10 22:57)
It seems there's a misunderstanding on the bug and the fix:

in every gamemode which prohibits the knowledge of the other players informations, if spawnhealth is set differently from default and one player is damaged for the first time, independently on the value of the damage, the spying clients will:
1)see the damage palette as if the player had spawnhealth-default damage
2)if custom SBarInfo HUD is used, health bar drops to 100.

This happens because the server sends some bytes to all the clients with the instruction: change the damaged player health/armor to 100/100. If the gamemode doesn't allow players to see each other's status, then the server should respect this and should not send lies at all. The fix is simple: just don't send useless info at all. Nothing changes regarding the general behavior and it's intended because that's the topic of this bug ticket.

Imho, if you want something about the rest, just create a new suggestion ticket with your considerations.

(0008562)
Torr Samaho   
2014-04-13 13:27   
With your patch damaged players are not put into the pain state anymore.
(0008565)
Edward-san   
2014-04-13 16:21   
Does this happen also in coop? Because in deathmatch or in other games where the enemy players info is hidden, the pain state hiding is intentional.
(0008566)
Torr Samaho   
2014-04-13 18:13   
client_DamagePlayer always calls

players[ulPlayer].mo->SetState( pPainState );

no matter which game mode. So you intentionally want to hide the pain state in DM? Can you elaborate why?
(0008567)
Edward-san   
2014-04-13 18:26   
Ah, sorry, I thought you were speaking of the pain red screen ... I'll take a look at it.
(0008568)
Edward-san   
2014-04-13 19:24   
This should do it.
(0008570)
Edward-san   
2014-04-13 21:43   
Updated a new patch which changes some comments. Tested it locally with 2 clients. Pain is heard, can be visible with chasecam, no sudden changes with health and armor.
(0008907)
Torr Samaho   
2014-06-08 10:12   
(edited on: 2014-06-08 10:23)
Looks good. Added!

EDIT: This needs to be tested in 1.3 and 2.0 separately since I had to adapt this change to the recent server commands rewrite in 2.0 when merging this change into 2.0.

(0009836)
Arco   
2014-07-04 17:36   
Works correctly in both v1.3 r140703-1806 and v2.0 r140609-0928.