Skip to content

Bots hear footsteps/cloaking player sounds - #2022

Draft
sunzenshen wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:bots-hear-footsteps
Draft

Bots hear footsteps/cloaking player sounds#2022
sunzenshen wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:bots-hear-footsteps

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Emit sound entities for bots to detect player cloak/footstep sounds. While existing EmitSound() calls play sounds for humans, bots did not detect those sounds. Adding InsertSound entities allows bots to react to cloak and footsteps as additional significant sound emissions to react to.

The lack of bot reactivity to footsteps and cloak was made more apparent in PR #1795 where bots lay detpack traps. Before this change, bots did not react to footsteps or cloak, but they did react to gunfire.

Toolchain

  • Windows MSVC VS2022

Linked Issues

@sunzenshen
sunzenshen requested a review from a team July 16, 2026 05:26
@sunzenshen sunzenshen changed the title Bots hear footsteps Bots hear footsteps/cloaking player sounds Jul 16, 2026
@sunzenshen sunzenshen added the Bots Related to bot players label Jul 16, 2026

@DESTROYGIRL DESTROYGIRL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to observe any changes in enemy bot behaviours when spamming cloak around them before they see me. Do you have a clean way of testing it?

@sunzenshen

Copy link
Copy Markdown
Contributor Author

I wasn't able to observe any changes in enemy bot behaviours when spamming cloak around them before they see me. Do you have a clean way of testing it?

This code was split off from a larger branch that included:

#1795
and
#2024

... so those might need to get in first for behavior to be more apparent.

Or we could increase the range of the calls.

@sunzenshen
sunzenshen force-pushed the bots-hear-footsteps branch from 32d56f4 to d94c948 Compare July 26, 2026 00:26
@sunzenshen
sunzenshen marked this pull request as draft July 26, 2026 03:33
@sunzenshen
sunzenshen force-pushed the bots-hear-footsteps branch from d94c948 to 626a6ae Compare July 26, 2026 04:53

@sunzenshen sunzenshen left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably better to wait for #1795, or maybe even to bundle this PR with #2022, so that there's a clearer A/B test scenario for verifying this addition.

So putting this PR into draft for now until the prerequisite changes go through.

}

if (!(pSound->SoundType() & SOUND_COMBAT))
if (!(pSound->SoundType() & (SOUND_COMBAT | SOUND_PLAYER)))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking for feedback on whether it makes sense to use the SOUND_PLAYER flag in this way, or if it's cleaner to treat footsteps as a SOUND_COMBAT

// Volume multiplier: 25000 * 1.0 = 25000 units
// SOUNDENT_VOLUME_FOOTSTEP = 25000 / 66.666... = 375.0 units
#define SOUNDENT_VOLUME_FOOTSTEP 375 // round down in context of int volume param
#endif

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure what to input for CSoundEnt::InsertSound as the volume parameter, so I estimated a rough scale based on the existing shotgun volume used elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants