MantisBT - Zandronum
View Issue Details
0002548Zandronum[All Projects] Bugpublic2015-12-12 23:092018-09-30 21:52
Dusk 
Dusk 
normalminorhave not tried
closedfixed 
3.0-beta 
3.03.0 
0002548: Potential bandwidth waste in P_DamageMobj
Let's observe this code block P_DamageMobj:

    // [BC] Tell clients that this thing was damaged.
    if ( NETWORK_GetState( ) == NETSTATE_SERVER )
    {
        if ( player )
            SERVERCOMMANDS_DamagePlayer( ULONG( player - players ));
        else
            // Is this even necessary?
            SERVERCOMMANDS_DamageThing( target );
    }


SERVERCOMMANDS_DamageThing sends a 3 byte packet for each non-player actor that gets damaged. On the client end, all this does is call

P_DamageMobj( pActor, NULL, NULL, 0, NAME_None );


Analyzing P_DamageMobj's source, it seems apparent that such a call, considering that damage==0 and pActor->player==NULL, only can have 2 effects:
* flashing stealth monsters
* shattering ice corpses.

If these indeed are the only effects, we could shave off some bandwidth use by replacing this server command with two separate server commands for flashing stealth monsters and shattering ice corpses, respectively.
No tags attached.
Issue History
2015-12-12 23:09DuskNew Issue
2015-12-13 00:04DuskNote Added: 0013968
2015-12-13 00:04DuskAssigned To => Dusk
2015-12-13 00:04DuskStatusnew => needs review
2015-12-20 17:26Torr SamahoNote Added: 0014000
2015-12-20 17:26Torr SamahoStatusneeds review => needs testing
2016-01-03 18:35cobaltTarget Version => 3.0
2016-01-03 18:35cobaltDescription Updatedbug_revision_view_page.php?rev_id=8389#r8389
2016-01-03 18:35cobaltNote Added: 0014040
2016-12-17 01:37Ru5tK1ngNote Added: 0016512
2016-12-17 01:37Ru5tK1ngStatusneeds testing => resolved
2016-12-17 01:37Ru5tK1ngResolutionopen => fixed
2016-12-17 01:37Ru5tK1ngFixed in Version => 3.0
2016-12-17 01:37Ru5tK1ngDescription Updatedbug_revision_view_page.php?rev_id=9977#r9977
2018-09-30 21:52Blzut3Statusresolved => closed

Notes
(0013968)
Dusk   
2015-12-13 00:04   
It appears that ice corpses still work after removing the SERVERCOMMANDS_DamageThing call. The stealth monster thing is real though and needs a new SVC2 to be addressed.

'https://bitbucket.org/crimsondusk/zandronum-sandbox/commits/3473fb14b508 [^]'
(0014000)
Torr Samaho   
2015-12-20 17:26   
Looks good. I added your patch.
(0014040)
cobalt   
2016-01-03 18:35   
Issue addressed by commit e8e5c287a91c: Removed the mostly useless SVC_DAMAGETHING, added SVC2_FLASHSTEALTHMONSTER to cover the stealth monster case. This should save some traffic. (fixes 2548)
Committed by Teemu Piippo [Dusk] on Sunday 13 December 2015 02:02:46

Changes in files:

 src/cl_main.cpp | 46 ++++++++++++----------------------------------
 src/network_enums.h | 2 +-
 src/p_interaction.cpp | 7 ++++---
 src/sv_commands.cpp | 24 ++++++++++++------------
 src/sv_commands.h | 2 +-
 5 files changed, 30 insertions(+), 51 deletions(-)

(0016512)
Ru5tK1ng   
2016-12-17 01:37   
The shattering ice corpses from Hexen and the StealthZombies seem to work without issues.