Bug #507

Some MOD aren't caught

Added by Spyhawk over 5 years ago. Updated 2 months ago.

Status:Fixed% Done:

100%

Priority:HighSpent time:-
Assignee:Ododo
Category:Mod CGAME
Target version:2.77
OS: Arch:

Description

I’ve seen this more than once, but I’m still unable to pinpoint exactly the issue. When you die, sometimes the obituaries don’t display the reason of your death (nor does the console output). The best I could tell is that the MOD doesn’t display when you die by some big explosion/splash damage(?).

In the code:

FIXME: ... some MODs are not catched - check all!

My best guess would be that some Mean Of Death got caught by the default message = NULL, so it is filtered out.

For reference, here are also some MOD that aren’t used at all in the events list:

  • MOD_GRENADE (related to some explosion stuff?)
  • MOD_KICKED (unused in Legacy)
  • MOD_SYRINGE (unused in Legacy)
  • MOD_AMMO (unused in Legacy)
  • MOD_SMOKEBOMB (unused in Legacy)

507.patch Magnifier (2.81 KB) Ododo, 23.02.2019 15:51


Related issues

Related to ET: Legacy Development - Bug #714: Fix flamethrower New 13.12.2014
Related to ET: Legacy Development - Bug #1201: Improve/extend hitsounds New 08.02.2019
Duplicated by ET: Legacy Development - Bug #712: Kills with airstrike don't always show up in console and HUD Invalid 13.12.2014
Duplicated by ET: Legacy Development - Bug #1200: Obituary messages (and also other events?!) are not alway... Invalid 07.02.2019

Associated revisions

Revision 2813f1c8
Added by Spyhawk about 4 years ago

cgame: CG_CheckEvents() cleanup, refs #507

Revision 12184ce5
Added by Spyhawk about 4 years ago

cgame: check for all event-only entities, refs #507

Revision 50fb9a3a
Added by IR4T4 over 3 years ago

mod: event message for MOD_TRIGGER_HURT refs #507, decreased damage for
MOD_TELEFRAG (just not to waste damage stats in case of usage somewhere)

Revision a077041c
Added by IR4T4 almost 2 years ago

cgame: missing MOD_GRENADE added to CG_Obituary refs #507

Note: This MOD is used for direct damage of barrels, alarm clocks etc.
see map uje_the _ghetto. Barrels might create MOD_EXPLOSIVE (indirect
kill) or MOD_GRENADE (direct kill) obituary events!

Revision 0b50b0a3
Added by Spyhawk 2 months ago

cgame: fixed temp entities aren’t reset correctly, refs #507

History

#1 Updated by IR4T4 over 5 years ago

I did add that note in the code. MOD_GRENADE (see unused propExplosionLarge()) and MOD_KICKED can be removed. Keep in mind to update noq lua scripts too.

The other MODs might be used (we should have a closer look) in G_Damage function of Bullet_Fire_Extended → GetAmmoTableData(attacker→s.weapon)→mod)

#2 Updated by Spyhawk over 5 years ago

  • Target version changed from 2.71rc4 to 2.78

#3 Updated by Spyhawk over 4 years ago

  • Related to Bug #714: Fix flamethrower added

#4 Updated by Spyhawk over 4 years ago

  • Related to Bug #712: Kills with airstrike don't always show up in console and HUD added

#5 Updated by Spyhawk over 4 years ago

  • Related to deleted (Bug #712: Kills with airstrike don't always show up in console and HUD)

#6 Updated by Spyhawk over 4 years ago

  • Duplicated by Bug #712: Kills with airstrike don't always show up in console and HUD added

#7 Updated by IR4T4 over 4 years ago

  • Target version changed from 2.78 to 2.74

#8 Updated by Spyhawk over 4 years ago

  • Description updated (diff)

#9 Updated by Spyhawk over 4 years ago

  • Subject changed from Some MOD aren't catched to Some MOD aren't caught

#10 Updated by Spyhawk over 4 years ago

I’m wondering if NUM_PM_STACK_ITEMS isn’t big enough... cg_popupStayTime and cg_popupFadeTime are set to 2.0 and 2.5 sec by default respectively, so if we have more than 32 events during these 4.5 sec some events might not be queued as expected. See CG_FindFreePMItem(). Nope, it’s good.

Edit: After adding some checks, it seems the CG_Obituaries function is not called at all in some circumstances. I’d look into "ent→splashMethodOfDeath" (indirect death, see G_RadiusDamage()) as this might not be taken into account by the current code - and matches the cases I’ve seen that bug happening. Edit: Nope, splashMethodOfDeath works as expected...

Server side is actually fine, but something weird might happen in CG_CheckEvents().

#11 Updated by Spyhawk about 4 years ago

The return in the event-only entities check part of CG_CheckEvents() seems to catch some of the events while it shouldn’t.
When commenting this return, I cannot reproduce the issue - although the game gets spammed by all kinds of temp events (obituaries, sounds, gfx effect, etc.).

The "cent→previousEvent" parameter is sometime not reset - see CG_ResetEntity(), especially in CG_TransitionEntity(). This is related to the client interpolation code, and concerns all kind of temp entities, not only death events.

#12 Updated by Spyhawk about 4 years ago

  • Target version changed from 2.74 to 2.78

Touching anything about the interpolation code is risky - delaying this ticket to 2.74.

#13 Updated by Spyhawk 4 months ago

  • Target version changed from 2.78 to 2.77

We should have a look at these discarded temp entities in the prediction code for 2.77. These might explain quite a few weirdness.

#14 Updated by Spyhawk 4 months ago

  • Priority changed from Normal to High

#15 Updated by Timothy 3 months ago

  • Duplicated by Bug #1200: Obituary messages (and also other events?!) are not always reaching/executed by clients added

#16 Updated by IR4T4 3 months ago

  • Related to Bug #1201: Improve/extend hitsounds added

#17 Updated by Ododo 3 months ago

I think it may come from the fact that this piece of code from cg_snapshot.c (TransitionSnapshot) L293
is not doing what it should be doing:

    for (i = 0 ; i < cg.snap->numEntities ; i++)
    {
        id = cg.snap->entities[i].number;
        CG_TransitionEntity(x%x%cg_entities[id]);

        // ent doesn't exist in this frame, reset it.
        // this is to fix the silent landmines bug, which is caused
        // by a stale miscTime in the cent
             if (cg_entities[id].currentValid == qfalse x%x%x%x% oldValid[id] == qtrue)
        {
            CG_ResetEntity(x%x%cg_entities[id]);
        }

We are iterating on cg.snap→entities after doing cg.snap = cg.nextSnap;
so id is always an entity number that is present on the nextSnap.

1)
cg_entities[id].currentValid will always be qtrue (see CG_TransitionEntity) so Cg_ResetEntity is never reached.
I think we are supposed to reset the entity before doing TransitionEntity.

2)
I think that the programmer wanted to reset the entities that were valid on the oldSnap but that are not present on the nextSnap.
(and pass them to TransitionEntity ?)

but because we are iterating on entities in the nextSnap we may not catch some of the old entity numbers that are not present on the new snap. (the one that we are interested in).

I tried to modify the code without success at the moment but maybe i’m missing something.

#18 Updated by Ododo 3 months ago

So i attached a patch on cg_snaphot.c that should work
unfortunately i have to ad a for loop so i dont know if it fits the required performances.

let me know if the problem is solved (or not)

#19 Updated by Spyhawk 3 months ago

Patch looks good to me, but IR4 has some reserve (please add them in the ticket IR4).

#20 Updated by IR4T4 3 months ago

I’m not convinced the bug is client side and I have two other ideas about it:

1.) Freeing ents: In G_FreeEntity I did a patch so ents are reused much earlier keeping the game ents 'more’ sorted
I’ve keept a cvar so we can test missing death messages are still occuring when G_FreeEntity isn’t optimized:
set l_free 1 at server start

2.) Increasing event life time: I can also imagine default life time of events = 300 msecs is too short. The legacy mod is firing more events compared to vanilla ET and adjusting EVENT_VALID_MSEC might do the trick.

#21 Updated by Spyhawk 2 months ago

Being curious, I’ve tested the proposed patch locally.
While it seems to solve the missing MOD issue, the patch doesn’t work correctly. I can see "Player X was blaster by Spyhawk’s support fire" (Axis airstrike) in obituaries area and console, while I’m playing as engineer (Allies).

#22 Updated by Ododo 2 months ago

Spyhawk wrote:

Being curious, I’ve tested the proposed patch locally.
While it seems to solve the missing MOD issue, the patch doesn’t work correctly. I can see "Player X was blaster by Spyhawk’s support fire" (Axis airstrike) in obituaries area and console, while I’m playing as engineer (Allies).

I can’t reproduce but maybe resetting the entities here is just a bad idea so remove all the
loop for (i = 0; i < oldFrame→numEntities; i++) that i added in the patch.
The other piece of code will cover the missing MOD issue by itself.

#23 Updated by Spyhawk 2 months ago

There was an interference with #1219. So far, the proposed patch seems to work properly.

#24 Updated by Spyhawk 2 months ago

  • Status changed from New to Feedback
  • Assignee set to Ododo

Pushed the fix. Further server-side optimizations can always be done later.

#25 Updated by Spyhawk 2 months ago

  • Status changed from Feedback to Fixed
  • % Done changed from 0 to 100

Also available in: Atom PDF