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

NPC hearing #27152

Merged
merged 2 commits into from
Dec 21, 2018
Merged

NPC hearing #27152

merged 2 commits into from
Dec 21, 2018

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Dec 17, 2018

Summary

SUMMARY: Infrastructure "NPC hearing"

Purpose of change

Addresses #22710, #22711
Give NPCs the ability to hear stuff, and eventually respond to things that they heard.

Describe the solution

call process_sound_markers() on all NPCs within MAP_VIEW_DISTANCE of the player, and have them call a new npc::handle_sound() function for each sound marker, and then bail before actually placing the sound markers which remains a player only function.

in npc::handle_sound(), the NPC checks to see if their total danger assessment (from npcmove.cpp) is below 1. If it is and they hear footsteps or combat noises but they can't see the source, they will complain/warn the player.

Describe alternatives you've considered

NPCs hear sounds before activity is processed. It might make more sense for activity to be processed and then have NPCs hear the resulting sounds.

This probably needs integration into npcmove.cpp.

@mlangsdorf mlangsdorf added <Enhancement / Feature> New features, or enhancements on existing NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` labels Dec 17, 2018
@mlangsdorf mlangsdorf added this to In progress in NPC dialog overhaul via automation Dec 17, 2018
Force all sounds to have descriptions and categories, and then tighten up
the conditions for printing out a description of the sound.
call process_sound_markers() on all NPCs within MAP_VIEW_DISTANCE of the
player, and have them call a new npc::handle_sound() function for each
sound marker, and then bail before actually placing the sound markers
which remains a player only function.

npc::handle_sound() ignores speech (for not) and sounds from locations
that the NPC can see.  If the NPC currently has a low assessment of
danger and hears combat noises or movement, they will complain to the
player.
@mlangsdorf mlangsdorf changed the title [WIP] NPC hearing NPC hearing Dec 20, 2018
@mlangsdorf
Copy link
Contributor Author

More to do, but this is a good start.

@kevingranade kevingranade merged commit db52035 into CleverRaven:master Dec 21, 2018
NPC dialog overhaul automation moved this from In progress to Done Dec 21, 2018
@mlangsdorf mlangsdorf deleted the npc_hearing branch December 21, 2018 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants