Skip to content

Conversation

@Rainyan
Copy link
Collaborator

@Rainyan Rainyan commented Sep 21, 2025

Description

Fix a case where the ear-ringing effect from a nearby grenade explosion could carry over to the next round with really unfortunate timing, where the nade goes off just as the round is about to end.

Toolchain

  • Windows MSVC VS2022

Linked Issues

@Rainyan

This comment was marked as outdated.

@Rainyan Rainyan requested review from a team and removed request for a team September 21, 2025 18:09
@Rainyan Rainyan changed the title Fix grenade ear-ringing carrying over to next round WIP: Fix grenade ear-ringing carrying over to next round Sep 21, 2025
@Rainyan

This comment was marked as outdated.

@Rainyan Rainyan marked this pull request as draft September 21, 2025 21:41
@Rainyan Rainyan force-pushed the bug/event-carryover branch from 560cae7 to 3f3f32f Compare September 21, 2025 23:03
@Rainyan Rainyan marked this pull request as ready for review September 21, 2025 23:12
@Rainyan Rainyan requested a review from a team September 21, 2025 23:12
@Rainyan
Copy link
Collaborator Author

Rainyan commented Sep 21, 2025

I wasn't able to reproduce the problem, tested with mp_restartgame 5 to time the reset at 5 seconds, and also with a lower neo_ctg_round_timelimit to time it after a round timeout. I suspect the timing window might be quite precise... But hopefully this change should address it.

edit: The server-sided ear-ringing SFX clear was not sent as a reliable message, so this might explain why it's so hard to reproduce. More info in the 37c28b1 commit message.

@Rainyan Rainyan changed the title WIP: Fix grenade ear-ringing carrying over to next round Fix grenade ear-ringing carrying over to next round Sep 22, 2025
@AdamTadeusz
Copy link
Contributor

I'm surprised dsp_off isn't cheat protected

@Rainyan Rainyan marked this pull request as draft September 24, 2025 13:00
@Rainyan Rainyan removed the request for review from a team September 24, 2025 13:00
Rainyan added a commit to Rainyan/rebuild that referenced this pull request Oct 7, 2025
Reset the ear-ringing sound effect caused by standing near
grenade/det explosions at spawn/respawn at client side. The server
already does this by default via `CBasePlayer::Spawn`, but we want to
ensure that reset arrives on time (and reliably; the default recipient
filter is not marked reliable) for the remote client.

This is done to address NeotokyoRebuild#1376

The reason this bug seems difficult to reproduce may be related to the
fact the server-sided recipient filter wasn't marked reliable, so you
might need a dropped packet for it to occur, but this is just speculation on my part.

For alternatives considered, see the orphaned commits from before the
rebase, and the dicussion at NeotokyoRebuild#1383:
* 0d4ef5f
* 3f3f32f
* 564a57c
@Rainyan Rainyan force-pushed the bug/event-carryover branch from 564a57c to 1bd8a72 Compare October 7, 2025 16:58
@Rainyan
Copy link
Collaborator Author

Rainyan commented Oct 7, 2025

I'm surprised dsp_off isn't cheat protected

Hmm, it should be. As far as I can tell, it's defined in the engine library, with flags 0x44000 (so FCVAR_CHEAT | FCVAR_ALLOWED_IN_COMPETITIVE).

Also shows up as cheat-protected for both NT & NT;RE in the client console:

dsp_off_ntre

Reset the ear-ringing sound effect caused by standing near
grenade/det explosions at spawn/respawn at client side. The server
already does this by default via `CBasePlayer::Spawn`, but we want to
ensure that reset arrives on time (and reliably; the default recipient
filter is not marked reliable) for the remote client.

This is done to address NeotokyoRebuild#1376

The reason this bug seems difficult to reproduce may be related to the
fact the server-sided recipient filter wasn't marked reliable, so you
might need a dropped packet for it to occur, but this is just speculation on my part.

For alternatives considered, see the orphaned commits from before the
rebase, and the dicussion at NeotokyoRebuild#1383:
* 0d4ef5f
* 3f3f32f
* 564a57c
@Rainyan Rainyan force-pushed the bug/event-carryover branch from 1bd8a72 to 37c28b1 Compare October 7, 2025 17:10
We already reset the ear-ringing explosion SFX for clients locally at
spawn in `C_NEO_Player` first spawn tick, but we should also send the
server sided message reliably for the benefit of in-eye spectators
(since they would not be the local player and hence not receive the
client-sided clear).
@Rainyan Rainyan marked this pull request as ready for review October 7, 2025 18:33
@Rainyan Rainyan requested a review from a team October 7, 2025 18:33
@Rainyan
Copy link
Collaborator Author

Rainyan commented Oct 7, 2025

Also snuck in 66caecb for playing the ear-ringing SFX for in-eye observers.

@Rainyan Rainyan merged commit f0526bf into NeotokyoRebuild:master Oct 12, 2025
7 checks passed
@Rainyan Rainyan deleted the bug/event-carryover branch October 12, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants