-
Notifications
You must be signed in to change notification settings - Fork 24
Bots hear footsteps/cloaking player sounds #2022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sunzenshen
wants to merge
1
commit into
NeotokyoRebuild:master
Choose a base branch
from
sunzenshen:bots-hear-footsteps
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,40 @@ enum | |
| #define SOUNDENT_VOLUME_PISTOL 1500.0 | ||
| #define SOUNDENT_VOLUME_EMPTY 500.0 // volume of the "CLICK" when you have no bullets | ||
|
|
||
| #ifdef NEO | ||
| // Used for calibrating bot detection distances for CSoundEnt::InsertSound() | ||
|
|
||
| // Murata shotgun sound uses SNDLVL_150dB with volume 1.0 [weapon_murata.single in game_sounds_weapons.txt] | ||
| // Human player recipient list hearing distance calculation: | ||
| // maxAudible = (2 * SOUND_NORMAL_CLIP_DIST) / attenuation [recipientfilter.cpp] | ||
| // SOUND_NORMAL_CLIP_DIST = 10000.0f [public/const.h] | ||
| // attenuation = SNDLVL_TO_ATTN(150) = 20.0f / (150 - 50) = 0.2 [public/soundflags.h] | ||
| // maxAudible = (2 * 10000.0) / 0.2 = 100000 units | ||
| // Volume multiplier: 100000 * 1.0 = 100000 units | ||
| // SOUNDENT_VOLUME_SHOTGUN = 1500.0 | ||
| // ratio = 100000 / 1500 = 66.666...u | ||
|
|
||
| // Cloak sound uses SNDLVL_75dB with volume 0.7 [NeoPlayer.ThermOpticOn/Off in game_sounds_player.txt] | ||
| // Human player recipient list hearing distance calculation: | ||
| // maxAudible = (2 * SOUND_NORMAL_CLIP_DIST) / attenuation [recipientfilter.cpp] | ||
| // SOUND_NORMAL_CLIP_DIST = 10000.0f [public/const.h] | ||
| // attenuation = SNDLVL_TO_ATTN(75) = 20.0f / (75 - 50) = 0.8 [public/soundflags.h] | ||
| // maxAudible = (2 * 10000.0) / 0.8 = 25000 units | ||
| // Volume multiplier: 25000 * 0.7 = 17500 units | ||
| // SOUNDENT_VOLUME_CLOAK = 17500 / 66.666... = 262.5 units | ||
| #define SOUNDENT_VOLUME_CLOAK 262 // round down in context of int volume param | ||
|
|
||
| // Footstep sounds use SNDLVL_75dB with volume 1.0 [Lowest of StepLeft/StepRight in game_sounds_physics.txt] | ||
| // Human player recipient list hearing distance calculation: | ||
| // maxAudible = (2 * SOUND_NORMAL_CLIP_DIST) / attenuation [recipientfilter.cpp] | ||
| // SOUND_NORMAL_CLIP_DIST = 10000.0f [public/const.h] | ||
| // attenuation = SNDLVL_TO_ATTN(75) = 20.0f / (75 - 50) = 0.8 [public/soundflags.h] | ||
| // maxAudible = (2 * 10000.0) / 0.8 = 25000 units | ||
| // 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 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| enum | ||
| { | ||
| SOUND_PRIORITY_VERY_LOW = -2, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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