Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Revisions: Issue #2548 All Revisions ] Back to Issue ]
Summary 0002548: Potential bandwidth waste in P_DamageMobj
Revision 2016-12-17 01:37 by Ru5tK1ng
Description 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.
Revision 2016-01-03 18:35 by cobalt
Description 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.
Revision 2015-12-12 23:09 by Dusk
Description 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.






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker