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 AI + interaction update #13486

Merged
merged 5 commits into from Sep 6, 2015

Conversation

Coolthulhu
Copy link
Contributor

  • NPC pathfinding will now avoid traps. It is clairvoyant: NPCs see all non-benign trap. Null trap is now benign, to simplify the code.
  • NPC finding a seat on vehicle should work better now. Closes NPC not entering vehicles  #13468 and allows NPCs to tell apart seats and aisles when selecting a good spot to sit on. Removes the "hop" that NPCs were doing before (a short-ranged teleport that they would do when getting into the vehicle)
  • Implemented a NPC menu, similar to zlave menu. Activated by examining a friendly NPC or walking into one. Allows pushing NPCs (more or less like old pushing, except won't make NPCs bash stuff), swapping places with NPCs, examining their wounds (no using healing items, but this makes it way simpler to implement) and attacking. Pushing and swapping is only for friendly NPCs, all can be examined. Good first aid and perception allows seeing exact hp, as Self Aware does for player.
  • Big refactoring of "limb menu". Moved from iuse to Character and got rid of a page worth of redundant code (per-limb code was literally ctrl+c+v, 4 times)
  • Walking into a zlave will displace it rather than attacking
  • Allowed NPCs to push each other out of the way. They don't path around each other yet, but pushing should prevent deadlocks (except when the target NPCs sleeps...)
  • Fixed NPC "roaming" (long term goal of acquiring stuff). Due to performance limitations on pathfinding, old deterministic roaming would often result in them getting locked up, trying to wall into a wall of a building. New one will have them stare into the wall for a while, then change direction and get unblocked.

@stk2008
Copy link

stk2008 commented Sep 4, 2015

Wow dude thank you so much :)

I love npc fixes etc :)
On 4 Sep 2015 20:43, "Coolthulhu" notifications@github.com wrote:

  • NPC pathfinding will now avoid traps. It is clairvoyant: NPCs see
    all non-benign trap. Null trap is now benign, to simplify the code.
  • NPC finding a seat on vehicle should work better now. Closes NPC not entering vehicles  #13468
    NPC not entering vehicles  #13468 and allows
    NPCs to tell apart seats and aisles when selecting a good spot to sit on.
    Removes the "hop" that NPCs were doing before (a short-ranged teleport that
    they would do when getting into the vehicle)
  • Implemented a NPC menu, similar to zlave menu. Activated by
    examining a friendly NPC or walking into one. Allows pushing NPCs (more or
    less like old pushing, except won't make NPCs bash stuff), swapping places
    with NPCs, examining their wounds (no using healing items, but this makes
    it way simpler to implement) and attacking. Pushing and swapping is only
    for friendly NPCs, all can be examined. Good first aid and perception
    allows seeing exact hp, as Self Aware does for player.
  • Big refactoring of "limb menu". Moved from iuse to Character and got
    rid of a page worth of redundant code (per-limb code was literally
    ctrl+c+v, 4 times)
  • Walking into a zlave will displace it rather than attacking
  • Allowed NPCs to push each other out of the way. They don't path
    around each other yet, but pushing should prevent deadlocks (except when
    the target NPCs sleeps...)
  • Fixed NPC "roaming" (long term goal of acquiring stuff). Due to
    performance limitations on pathfinding, old deterministic roaming would
    often result in them getting locked up, trying to wall into a wall of a
    building. New one will have them stare into the wall for a while, then
    change direction and get unblocked.

You can view, comment on, or merge this pull request online at:

#13486
Commit Summary

  • Bunch of NPC enhancements
  • Minor pathfinding bug
  • Remove debug stuff
  • Add no_bashing parameter to npc moving
  • Don't push sleeping NPCs

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#13486.

@Rivet-the-Zombie
Copy link
Member

NPC pathfinding will now avoid traps. It is clairvoyant: NPCs see all non-benign trap.

So no more killing/driving off NPCs using traps? I hope this is a temporary thing.

@Coolthulhu
Copy link
Contributor Author

Just pathfinding, they still can be murdered by pushing them into traps and it still won't credit the player for the murder with -100 morale.

This was mostly to make them not blunder into open air and pits.

@chaosvolt
Copy link
Contributor

Interesting. If there was a way to make them ignore undiscovered traps without adding to complexity or lag, though...

@kevingranade
Copy link
Member

kevingranade commented Sep 5, 2015 via email

@chaosvolt
Copy link
Contributor

Ah. Now if we further made a distinction between "spotted by player" and "spotted by NPC" that would be useful. However, that would add more code to juggle. Simply one list for players and one for NPC would be a step up and not too complex, but giving EVERY NPC their own detection list would get out of hand rapidly.

@kevingranade
Copy link
Member

kevingranade commented Sep 5, 2015 via email

@chaosvolt
Copy link
Contributor

Hmm. I do wonder how many traps, and how many NPCs, it takes to cause problems using that method. X3

@kevingranade
Copy link
Member

kevingranade commented Sep 5, 2015 via email

@chaosvolt
Copy link
Contributor

Ah right. And compared to map data and other stats, guess it wouldn't be a substantial addition to the amount of data tracked and saved.

@Zireael07
Copy link
Contributor

I <3 this, @Coolthulhu!

@Rivet-the-Zombie Rivet-the-Zombie self-assigned this Sep 6, 2015
Rivet-the-Zombie added a commit that referenced this pull request Sep 6, 2015
@Rivet-the-Zombie Rivet-the-Zombie merged commit 4b8c3de into CleverRaven:master Sep 6, 2015
@Coolthulhu Coolthulhu deleted the minion-boost branch February 23, 2016 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants