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 getting stuck trying to path in through a closed window. #51882

Closed
ProfoundDarkness opened this issue Sep 25, 2021 · 8 comments · Fixed by #61272
Closed

NPCs getting stuck trying to path in through a closed window. #51882

ProfoundDarkness opened this issue Sep 25, 2021 · 8 comments · Fixed by #61272
Labels
<Bug> This needs to be fixed NPC / Factions NPCs, AI, Speech, Factions, Ownership (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@ProfoundDarkness
Copy link
Contributor

ProfoundDarkness commented Sep 25, 2021

Describe the bug

It seems like NPC pathfinding is allowing bi-directional use of closed windows when windows can only be opened from one side.

Steps To Reproduce

  1. Load the first included save.
    DBG_NPC_PathWindow.zip

  2. Tell NPC to follow (C, f)

  3. Step inside

  4. close the door

  5. Step down diagonal away from the door or directly down to the window then away from it, the NPC will stand near the window until it is opened.

  6. If done right, player can open the door and NPC will still be stuck near window.

  7. NPC unstuck (usually) when player gets close.

Alternate:

  1. Load the second included save (same world/character btw).
    DBG_NPC_PathWindow2.zip

  2. Tell the NPC to sort the items.

  3. The NPC will head to the window and stand there.

  4. Player can now move freely andthe NPC will be stuck this way until instructed to stop or the player opens the window that the NPC is near.

Expected behavior

NPCs don't try to path IN through closed windows (not like there are many one way terrain types). Pathing out is apt since they can open it without smashing or prying or otherwise damaging the window. This can mean going around for another nearby door or already opened window or walking up to the player and telling them to move.

Oh and yes I've had an NPC decide to try and path through a closed window when a perfectly good open window was one more down.

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version: Distributor ID: Ubuntu; Description: Ubuntu 20.04.3 LTS; Release: 20.04; Codename: focal;
  • Game Version: 0.F-2984-ge6f57792c9 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth]
    ]

Additional context

This pops up a surprising amount when I'm out exploring with 2 NPCs (I don't have more yet). Basically for one reason or another one of the NPCs decides to try coming in through a closed window and then just stands there until I intervene somehow (usually by opening the window).

@Vendidurt
Copy link

Yes, this happened when I cleared a town of zombies and set my NPCs to cleanup work. Soon all four of them were jammed against windows, politely waiting for me to walk past them, through the already opened door, and open it for them. It compounded when they were set to "close the doors," stranding their partner behind them. Eventually I just set the cleaning zones to the street so I didnt have to literally open every window in a city.

@ProfoundDarkness
Copy link
Contributor Author

ProfoundDarkness commented Sep 25, 2021

OK, my question that was here was pointless... I eventually did a checkout back in time about a month.

For all I know it's been in for quite a long while but as the NPC gets better over time the problem starts to get more obvious... I don't remember having this problem with 0.E stable but then I had parts of cars 'welded' onto the side of my home base to let the light in but keep the zombies out (what you do with lots of mechanics skill and no fabrication skill while sick of zombies smashing your hard to replace windows while you sleep). There was no way for the NPCs to path through the window so they didn't do it there... I also didn't have more than 1 NPC until shortly before I was done with that game and it seems like the NPCs stuck on windows thing really only gets more obvious with more than 1 NPC. ...or using 'Sort my loot' to pool a tile's resources for easy picking through which I only recently discovered (doing it myself first).

One more edit, a workaround. I played with some NPC combat and misc options that I normally don't mess with. misc options -> don't go through closed doors (b, h). The NPC doesn't get stuck forever on a closed window anymore. Also won't open doors if it needs to which ends up behaving like the player when the player is performing zone activities (O). I've been leaving the NPC with close doors off anyway so this works fine for me. As a bonus I find it a bit annoying when the NPCs open windows to get to me, now they won't, could be problematic in some situations but I think I'll get used to playing this way for now.

@anothersimulacrum anothersimulacrum added (S1 - Need confirmation) Report waiting on confirmation of reproducibility NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Sep 26, 2021
@hexagonrecursion
Copy link
Contributor

Confirmed by using your save file.

DeepinScreenshot_select-area_20220104161613

  • OS: Linux
    • OS Version: LSB Version: :core-4.1-amd64:core-4.1-noarch; Distributor ID: Fedora; Description: Fedora release 34 (Thirty Four); Release: 34; Codename: ThirtyFour;
  • Game Version: eacb7d9 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth]
    ]

@LeahLuong
Copy link

NPC pathfinding is a little wonky in general. Don't get me wrong, I like the inclusion of NPC's & think their pathfinding is fairly decent. Personally, I have an issue where a central assigned seat in a Humvee can't be found by the NPC w/out my intervention; prob an issue w/ equal distance calcs & the algo flipflopping betw/ them. I think that a piecemeal approach to fixing these sorts of problems is likely to generate as many issues as it fixes. A general overhaul needs to be made & there are so many corner cases the problem is overwhelming. There should prob be a thread for collecting as many of these cases as possible for when a general overhaul attempt is made.

Another time, my NPC got stuck betw/ a noxious gas cloud & a Z hulk despite my being able to navigate a clear path by stepping diagonally twice around the cloud. NPC was yelling, "Can't run! Have to fight!" until he got super punched onto my side of the gas.

@hexagonrecursion
Copy link
Contributor

Personally, I have an issue where a central assigned seat in a Humvee can't be found by the NPC w/out my intervention

@LeahLuong Please report this as a separate issue instead of hijacking an existing thread - this makes it easier to keep track of troubleshooting and debugging efforts. You can link the issues together, but they should all be separate threads. Thank you.

Another time, my NPC got stuck betw/ a noxious gas cloud & a Z hulk despite my being able to navigate a clear path by stepping diagonally twice around the cloud.

same

@LeahLuong
Copy link

@hexagonrecursion Andrey, I think you missed the point of my post. Creating separate threads is likely to compound this issue (not this particular issue but the greater issue of NPC pathfinding in general) because whomever ends up tackling it won't have easy access to the many corner cases that pop up. I don't have much understanding of this game's code so don't feel qualified to start a centralized thread. I also don't feel like starting a separate thread for each foible I encounter w/ NPC pathfinding. I apologize for "hijacking" the thread & will make no further comment here.

@wapcaplet wapcaplet added (S2 - Confirmed) Bug that's been confirmed to exist <Bug> This needs to be fixed and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Jan 17, 2022
@RabblerouserGT
Copy link
Contributor

RabblerouserGT commented Feb 18, 2022

I wasn't sure if I should make a new issue out of this or just comment here but...
There's an even worse thing here I've noticed. I've had an NPC smash my window when he tried to pathfind through the window... when there were two open doors directly to the side. It's very, very irksome.

I have two theories as to why it was smashed

  • the NPC was literally one tile away when I closed the window. Maybe he already had his path "locked in" that he was going onto the window tile and auto-smashed? I'm not familiar with the pathfinding code so I can't rule it out.
  • MOST LIKELY, in my opinion, it may be because he's the "I wanna set my enemy's house on fire" MISSION_PYROMANIAC mission NPC. To clarify, this means
    -- a) I don't have him on my side to tell him not to smash obstacles, but the mission means he's following me with my being able to direct his behavior.
    -- b) I don't have him on my side to create a faction base, which I'm not sure if the code explicity tells NPCs "don't trash faction stuff" as opposed to just trashing some random house's window.

Others have told me NPC pathfinding has been bugged for a long time. I'm thinking if it's been this long and there's nothing on the horizon for fixing, perhaps MISSION_PYROMANIAC needs to be reworked. Players shouldn't have to expect this window-smashing behavior from a follower.

image

@LeahLuong
Copy link

@RabblerouserGT There are other issues raised about that NPC in #54263. As you noted, faction followers have a "don't smash" order which is in effect by default & the problem likely lies w/ that specific NPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed NPC / Factions NPCs, AI, Speech, Factions, Ownership (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants