Skip to content
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

NPCs use their indoor voices when not in danger #72021

Merged
merged 9 commits into from
Mar 6, 2024

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Feb 27, 2024

Summary

Balance "NPCs don't scream at loudness 16 when just saying normal stuff, unless they're in danger"

Purpose of change

Mentioned in #71865 (does not close issue)

NPCs yelling like maniacs in the middle of the night because they wanted to step past you. Then yelling like maniacs to apologize to all the people they just woke up. Brilliant.

Describe the solution

Replaced the number 16 with 6 if not in danger math!

Calculate a good volume to use instead of magic numbers, based on whether the player will be able to hear (speak louder if PC is far away)/NPC wants the player to hear. Respects if friends are sleeping (intentionally whispers to avoid waking them up).

Describe alternatives you've considered

Why don't we make a slider for the player to micromanage how loud they want their NPCs to yell? (this is not a serious question)

Testing

Confirmed it compiles and launches only

Additional context

Technically speaking if get_shout_volume() is below 16, they were actually louder when speaking normally during danger 🤔

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 27, 2024
@Nebnis
Copy link
Contributor

Nebnis commented Feb 27, 2024

Why don't we make a slider for the player to micromanage how loud they want their NPCs to yell? (this is not a serious question)

I mean, i would love this. Something like:

"Try to be quiet as much as possible but scream really loud if you in danger and alone(not following player)."

@RenechCDDA
Copy link
Member Author

Why don't we make a slider for the player to micromanage how loud they want their NPCs to yell? (this is not a serious question)

I mean, i would love this. Something like:

"Try to be quiet as much as possible but scream really loud if you in danger and alone(not following player)."

Exactly why it is going to be done programmatically and not by having the player repeatedly change settings for things the NPCs should be smart enough to handle.

@RenechCDDA RenechCDDA marked this pull request as ready for review February 27, 2024 15:07
@XygenSS
Copy link
Contributor

XygenSS commented Feb 28, 2024

Can this be done with the player character as well?

@RenechCDDA
Copy link
Member Author

RenechCDDA commented Feb 28, 2024

Can this be done with the player character as well?

The player does not make verbal sound except when using the You yell... command. (And working out, and casting verbal spells, and occasionally when in pain. But none of those are terribly relevant.)

As far as I can tell, yelling orders doesn't make any noise either.

So there is nothing to be done here, except maybe add noise from talking.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 28, 2024
@XygenSS
Copy link
Contributor

XygenSS commented Feb 28, 2024

As far as I can tell, yelling orders doesn't make any noise either.
So there is nothing to be done here, except maybe add noise from talking.

Is that really the case? Telling followers to guard or follow via the C menu seems to produce sound equal to your usual yelling volume.

talking to them does seem to be completely silent on your part though, noise definitely should be added.

@Theawesomeboophis
Copy link
Contributor

The player talking should definitely make sound.

@Theawesomeboophis
Copy link
Contributor

Why don't we make a slider for the player to micromanage how loud they want their NPCs to yell? (this is not a serious question)

I mean, i would love this. Something like:

"Try to be quiet as much as possible but scream really loud if you in danger and alone(not following player)."

We should probably have a be quiet command so they're not screaming during night raids and stuff and alerting everything nearby. Because stealthing with npcs is kinda hard when they're yelling at you that they see a zombie 4 miles down the road.

src/npc.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Feb 29, 2024
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 29, 2024
@dseguin dseguin merged commit 34c37cb into CleverRaven:master Mar 6, 2024
20 of 26 checks passed
@RenechCDDA RenechCDDA deleted the WHY_ARE_YOU_SHOUTING branch March 6, 2024 22:47
@Montimorency
Copy link
Contributor

Montimorency commented Mar 7, 2024

Can this be done with the player character as well?

The player does not make verbal sound except when using the You yell... command. (And working out, and casting verbal spells, and occasionally when in pain. But none of those are terribly relevant.)

As far as I can tell, yelling orders doesn't make any noise either.

So there is nothing to be done here, except maybe add noise from talking.

Are we sure about that?

2543r
235gw4
ag433

"Everyone take it easy", Dumbledore said calmly.

No, but for real, some chat menu commands are single-digit volume, while others are - maximal? I can't find the consistency.

@RenechCDDA
Copy link
Member Author

You're right, it looks like the player actually shouts for those commands. I didn't find it because it's in npctalk.cpp, the last place I expected to find the player talking.

Any problems you find there should be made into a new issue though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants