Skip to content

Bots hear footsteps/cloaking player sounds#2022

Open
sunzenshen wants to merge 3 commits into
NeotokyoRebuild:masterfrom
sunzenshen:bots-hear-footsteps
Open

Bots hear footsteps/cloaking player sounds#2022
sunzenshen wants to merge 3 commits 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
surfacedata_t *psurface, float fvol, bool force )
{
// For bots to hear footsteps
CSoundEnt::InsertSound(SOUND_PLAYER, GetAbsOrigin(), 150, 0.1, this);

@sunzenshen sunzenshen Jul 16, 2026

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 honestly have no idea if the distance numbers I chose for these InsertSound calls make sense. I estimated them assuming that a player width is 32 units.

@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
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.

1 participant