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

Add NPC retreat, no investigate, and investigate limit zones #29867

Merged
merged 3 commits into from
Apr 26, 2019

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Apr 23, 2019

Summary

SUMMARY: Features "Add NPC retreat, no investigate, and investigate limit zones"

Purpose of change

Part of #29333
Add 3 new zones for friendly NPCs:

  • Retreat zones give the NPC a preferred location to retreat to if the zone is within 60 tiles and the NPC is fleeing threats or a fire
  • No investigate noises prevent the NPC from investigating sounds coming from inside the zone.
  • Investigate limit zones prevent the NPC from investigating sounds coming from outside the zone.

Describe the solution

Add two new functions to the zone manager: get_nearest returns the nearest point of a zone type within a specified distance, and has_defined returns true if there is a cached zone type.

In npcmove.cpp, good_escape_dir will attempt to path to the nearest retreat zone in preference to using the threat map.

in npctalk.cpp, handle_sounds will skip investigating sounds that come from inside a no investigate zone, or if a investigate limit zone is defined, from sounds coming from outside of it.

Update the in-dialogue tutorial to include the new features.

@mlangsdorf mlangsdorf changed the title Npc control zones Add NPC retreat, no investigate, and investigate limit zones Apr 23, 2019
@mlangsdorf mlangsdorf added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones NPC / Factions NPCs, AI, Speech, Factions, Ownership Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA Sound Events Sound events handling in the game labels Apr 23, 2019
@I-am-Erk
Copy link
Member

I-am-Erk commented Apr 23, 2019

I wonder if there might be more appropriate names for "no investigate" and "investigate limit". Those aren't very self explanatory. Having it in the dialogue tutorial does help

@mlangsdorf
Copy link
Contributor Author

I am open to suggestions for better names. They make sense to me and all zone names are kind of cryptic, honestly.

@I-am-Erk
Copy link
Member

Yeah, I'm struggling to think of anything better at the moment too. If it comes to mind I'll let you know

@I-am-Erk
Copy link
Member

No investigate zone - how about "ignore sounds" zone?

Investigate limits - I think this one is probably okay if 'no investigate' is changed since it makes them less similar sounding. However I sort of vaguely think "investigation limits" sounds a little clearer in intent.

Make both of these functions take an int range argument that defaults to
MAX_DISTANCE.
Add a new zone that friendly NPCs will prefer to retreat to, instead
of fleeing in a blind panic.

Update the NPC dialogue tutorial.
Add two new zones: one prevents friendly NPCs from investigating
noises coming from it, the other prevents friendly NPCs from
investigating noises coming out of it.
@ZhilkinSerg ZhilkinSerg self-assigned this Apr 24, 2019
@kevingranade kevingranade merged commit acae143 into CleverRaven:master Apr 26, 2019
@ZhilkinSerg ZhilkinSerg removed their assignment Apr 26, 2019
@mlangsdorf mlangsdorf deleted the npc_control_zones branch April 26, 2019 11:23
@RafeHaab
Copy link
Contributor

"Don't investigate"

"Investigate within reason/limits"

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 Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones NPC / Factions NPCs, AI, Speech, Factions, Ownership Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA Sound Events Sound events handling in the game
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants