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: Add 3 new NPC AI rules #29367

Merged
merged 3 commits into from Apr 8, 2019

Conversation

Projects
None yet
3 participants
@mlangsdorf
Copy link
Contributor

commented Apr 7, 2019

Summary

SUMMARY: Features "NPCs: Add 3 new NPC AI rules"

Purpose of change

As part of #29333, add NPC follower AI rules and TALK_COMMON_ALLY dynamic lines and responses to better control NPCs:

  1. NPCs can be told not to open doors, which is useful to keep them from releasing shoggoths or getting shot by turrets.
  2. NPCs can be told to not move into an open doorway or obstacle that you are adjacent to, giving you some ability to hold a chokepoint with an NPC
  3. NPCs can be told to not investigate noises.

Describe the solution

Add new ally_rules.

When an NPC is told not to open doors, any doors on the g->m are adding to the pathfinding avoid set.

When an NPC is told to hold the line, any open doors or tiles with a movecost that are greater than 2 that are adjacent to to g->u.pos() are added to the pathfinding avoid set.

When an NPC is told not to investigate noises, their investigate radius for noises is set to 0.

Additional context

Part of #29365

mlangsdorf added some commits Apr 7, 2019

NPC AI: add an ally rule to not open doors
Add an ally rule to not open doors.  Useful for preventing NPCs from
opening doors onto turrets.
NPC AI: Add a hold the line command
Add a new NPC AI rule "hold the line".  When a follower NPC has
"hold the line" set, they will not move into an open doorway or
obstructed tile adjacent to the PC.  This should allow the PC to
hold chokepoints at windows and doorways without having to worry
about NPCs moving past the chokepoint, and also without having to
worry about the NPC not following the player in general.
@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/followers-and-the-guard-command/19502/15

NPC AI: Add NPC AI rule to ignore noises
Add a new NPC AI rule that prevents NPCs from investigating noises
that they cannot see.

@mlangsdorf mlangsdorf force-pushed the mlangsdorf:npc_new_commands branch from 6172c30 to e02c4d2 Apr 7, 2019

@ZhilkinSerg ZhilkinSerg merged commit e1615c1 into CleverRaven:master Apr 8, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
gorgon-ghprb Build finished.
Details

@mlangsdorf mlangsdorf deleted the mlangsdorf:npc_new_commands branch Apr 8, 2019

@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 10, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/latest-experimental-features/5582/1106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.