Bots hear footsteps/cloaking player sounds - #2022
Conversation
DESTROYGIRL
left a comment
There was a problem hiding this comment.
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: ... so those might need to get in first for behavior to be more apparent. Or we could increase the range of the calls. |
32d56f4 to
d94c948
Compare
d94c948 to
626a6ae
Compare
| } | ||
|
|
||
| if (!(pSound->SoundType() & SOUND_COMBAT)) | ||
| if (!(pSound->SoundType() & (SOUND_COMBAT | SOUND_PLAYER))) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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
Linked Issues