There are a large variety of issues that affect settler AI, and this mod serves as documentation and a fix for an extremely specific bug that, to the best of my knowledge, only affects large mod-added or edited settlements. I am investigating other issues that affect settler AI, and in particular I have found one specific cause that needs further investigation but would, if true, cause significant and verifiable breakage.
All right, so I've been looking into Abernathy Farm as requested and have found several causes for issues encountered there:
Lucy's bed is "inaccessible" from her perspective, because the navmesh it is sitting on is completely isolated from the rest of the world by a stray precut.
Blake and Connie's beds are also "inaccessible" to them because they're facing the wrong way. If you select one of their two mattresses in console and run the command "modangle z 180" they will immediately "find" the bed and be able to sleep in it.
Blake and Connie's beds are explicitly owned by them in the base game, and a large variety of mods carry this ownership forward rather than using the unofficial patch's ownership changes. This ownership breaks their bed assignment when a workshop resets, which happens anytime you leave the area and come back.
When using the unofficial patch, their beds are unowned and thus work properly. However, when you assign a new bed to them this can break their sleep package and you may need to leave the area and return in order to get that working.
Is it safe to update to the latest version, mid-game? I'm currently on 1.00 of the mod, on old gen FO4 (been away from this game since last July). Thanks
Dear author! In your mod you solve a very important and unpleasant problem of the vanilla game. Thank you very much for this!
Let me ask you to consider the possibility of fixing another problem of the vanilla game related to mods. The thing is this: in some (not all!) settlements, vanilla natives of settlements such as Abernathy farm, The Slog, Oberland Station,County Crossing (and several others) are tied by the game to vanilla beds. When dismantling vanilla beds, natives cannot choose another bed in any way, even when assigning a bed to a native through the workshop menu. Natives do not sleep at night at all. Other NPCs sleep at night in beds that they "choose themselves". Could it be that this error is related to the natives' bed markers and not their AI?
Can you fix this error? I see from your comments that you have seriously studied this topic and have already done a lot. Thank you very much for your work.
I use such quite popular mods as: 1. Build High - Expanded Settlements 2. Clean and flat settlements 1.2.2 3. Easy Homebuilder and Working Double Beds 4. Snap'n Build - Capital repairs of the real estate add-on 5. Unofficial Fallout 4 Patch-4598-2-1-5 6. the game version 1.10.163
Thank you again for your work!
P.S. This problem is present in the game even without any mods, as I noticed.
This problem was already mostly fixed by the unofficial patch version that you have, but that version has a different problem tied to bed assignments that has been fixed in a newer release. Ultimately, the source of the issue is that Bethesda directly assigned the NPCs to specific beds, and that breaks the workshop scripts. In v2.1.5 of the unofficial patch, there is one settlement that still has that particular issue. The other issues that are present in 2.1.5 are:
A hole in the Abernathy Farm navmesh that makes two beds inaccessible.
Two of the Abernathy Farm beds are turned the wrong way around, preventing NPCs from using them
NPC bed assignment does not work properly unless you have more beds than settlers. Even if you have the same number of beds as settlers, it will break. You need to have at least one more bed than you have settlers in order to assign them properly in v2.1.5.
Thank you very much for the quick reply! May I ask: 1. Are there any plans to release a fix to correct the workshop scripts that bind native settlers to certain vanilla beds in problem settlements? 2. Let me inform you that after removing the vanilla beds in the problem settlements that I wrote about, the number of beds does not affect the distribution of NPCs by sleeping places except for native settlers. Maybe this is only in my game. I tested this both in the game without mods and the unofficial patch and in the game with mods. I think the problem is not in my set of mods and not in my game. I am sure you are completely right about the workshop scripts broken by the authors of the game.
It cannot be directly fixed, it is a game engine problem. The workshop assigns jobs and beds by using scripts to set specific NPCs as the owner of the bed/work station they use. These script calls will fail of the bed was already set to be owned by a specific NPC via the creation kit, which is how Bethesda assigned bed ownership for settlers in places like Abernathy Farm. The unofficial patch actually removes ownership from beds in order to fix this problem, but that only fixes things for new games.
The other script issue I mentioned is already fixed in the current version of the unofficial patch, which is the one I use. It is also fixed in a different way in Workshop Framework.
The specific problem (and I did all my testing for this problem at Abernathy Farm) was that the code that assigns settlers to new beds would only remove their preexisting ownership if every settler in the settlement had an assigned bed. Otherwise, the actor would be set to own the new bed while continuing to own the old one, and that would break their AI. If you then leave and come back, the workshop script removes their ownership of the new bed.
In current versions of the unofficial patch, that bit of code works properly but NPCs such as the Abernathy family will still get "stuck" standing around rather than sleeping until you leave the settlement and come back. The specific cause of this is something I've looked into and not been able to identify - their bed assignment works properly and their AI packages seem to work properly as well, but something about a preexisting NPC is impacting things in a way that hasn't been tracked down. That said, the issue is cosmetic and fixes itself just by leaving and coming back.
Thanks for the clarification. Unfortunately, the Workshop Framework mod is "taboo" for me. And my game is version 1.10.163 and I won't be switching to next gen. And so the unofficial patch will remain old. It's a pity, but there's nothing to be done. I'll continue building. Thanks again for your answer and your wonderful mods! Of course I voted!
For the problem the fix addresses, mostly not. The extended file in misc fixes the same problem on other settler AI packages, but that AI is used by thousands of NPCs in the game world for all sorts of things and as a result I'm not confident enough to declare such an invasive change as "safe" (and thus included it in the main file) until I've run a few more start-to-finish save files of my own with it to make sure.
Essentially, it's there for people to try and test for themselves if they're willing to take risks. If a problem is found (such as the one ArcanicVoid reported earlier), I'll fix it as best I can. But I assume there are probably more problems yet to be found, so it's still going to be a file that players will be using at their own risk.
Theoretically it fixes the same problem at all times of day. Unfortunately, I haven't received enough testing or feedback to be sure of its effectiveness or safety, which is why it has a big bold warning on it.
So, I believe somehow the EXT addon affects NPCs that may have quests... I went to Graygarden multiple times and tested with and without the changes. They leave mid-conversation and are unresponsive afterwards. The only action I could do was test a hit on them and then they clicked back into the quest dialogue. The specific NPCs were Supervisor Green (prize dialogue) and Supervisor White (quest dialogue). I removed the changes and they were responsive without any issues. No other issues of note after playing with the changes active for the past couple of months.
Good shout. I'll look into making a list of settlement NPCs to exempt. It'll make them potentially subject to the original bugs, but better that than breaking quests and dialogue. Are there any similar issues with Minutemen quests?
None that I noticed. I'll play around a bit more and let you know if so. At least in the case of the robots, dialogue mentions them being able to work "around the clock", so uh the irony I guess.
I have updated both the main file and the EXT file with an exemption list that should resolve the issue for possible cases I found. Please let me know if you find any I missed.
I standardized both this fix and the one in 1.01 to all edited packages because it's better to accidentally leave an NPC affected by the original bug than it is to risk breaking something I'm not aware of. Especially because there's always the chance that a mod somewhere uses one of these packages in a way I haven't thought of before.
So idk if it's in the scope of the midnight cult fix -ext but is it possible to fix the settler behavior wanting to go through walls instead of using doors?
That's an issue with navmeshing. Workshop objects that NPCs can't walk through are supposed to have navcuts that prevent NPCs from trying to walk through them, and those don't always get added and aren't always sufficient to work based on how the object was placed.
Not any kind of one-size-fits-all solution. no. Depending on the problem it could mean the object's model needs to be edited, or that the object needs to be edited in the creation kit, or that it's just bad placement in the settlement itself.
Dude, thanks a lot. Now when I get to my camp at night the settlers are all sleeping in their beds. Even the beverage robot, it appeared inside the ground floor, but it corrected itself by coming out of the concrete block. Do you really think the EXT file is dangerous? Or are you just warning and don't want to take responsibility for a minimal risk? If I want to use it, can I uninstall the main file to install the EXT? Here from Brazil.
Theoretically the EXT file is fine at this point, but there are too many AI packages that will be affected by its changes for me to be confident about that. As for using the EXT file, it's an additional file rather than a replacement. So use both it and the main file together.
Hrm. After installing the mod, letting several in-game days go by (naturally, not by force-sleeping) and spending half an hour (realtime) standing in an interior cell (small bunker), half of Starlight is still standing around the dead center of the lot, staring each other down. Is Starlight not affected by this specific fix?
I have folks just standing around the center of Sanctuary and the Castle as well but it doesn't seem to have anything to do with nightfall so oh well.
I've pretty much given up on settlers doing any of their jobs at this point. You were my last hope, Obi-Wan. Ah well, thanks anyway.
The AI package I updated is only used by settlers between midnight and 8AM, so if you see the problem at all times of day it's likely to be another issue that affects pathfinding and/or NPC AI. You can check to see if it's a pathfinding issue by using console to move one of the NPCs to another part of the settlement. If you select the NPC by clicking them, you can then use "moveto player" in console and it will move them to you.
If they stay where you moved them, then the likely issue is the pathfinding, and the cause is probably from stacking navmeshed workshop objects too closely. If they walk back to the center of the settlement, then pathfinding is working properly and their AI is at fault instead.
With all that said, I just uploaded a copy of the test build that I had been getting people to give me testing and feedback data on. It's under miscellaneous files. The test build applies the same fix to all AI packages used by settlers in settlements, which should extend the effect of this fix to the entire ingame day. The warning on that file is because there's a small chance that Bethesda relied on this broken behavior elsewhere in the game, sort of like how Morrowind AI has a bug with pathfinding AI that, if fixed, will result in several NPCs swimming out to sea after their quests are complete.
will result in several NPCs swimming out to sea after their quests are complete.
....omg lol i'm dying. I never knew that. Hoo boy.
At this point I'd say it's worth the risk to try at least.... i thought the issue all these years was my crap machine and script lag and not throttling mods enough, but today on a new PC with modern hardware Bethesduh AI and pathfinding STILL sucks. -_- Cheers for the tip I'll let you know if anyone tries to swim to Fah Hahbah
Has EXT helped your settlement issues at all? It has a much broader coverage, which is part of why I really wanted to do a lot more testing prior to sharing it since that coverage is both a blessing and a curse.
I'm honestly not sure. There are still people standing around the center of Starlight, my most built-up settlement, at all hours. I have also installed the Navmesh Fix for several locations to eliminate that as a variable. However, while it may be too soon to tell, it feels like there's less "idlers" in the damn water pit (gg Todd, putting the center marker in the damn water pit, ffs). I'll see 2-4 at most at any given moment, instead of there routinely being half a dozen or more all clustered 'round doing nothing.
TL;DR tentatively yes i think, so far so good. At worst, I haven't noticed anything breaking other than the issues noticed with those in the NoPackages factions which is now fixed.
EDIT: thinking about my observations more, this may be a bit of a catch-22 situation. Because I noticed that for a while, shopkeepers for instance would actually go to their damn counters for once, but then a short time later, they'd be just standing around near their stores again. So i wonder if EXT is interrupting the "be a shopkeeper and stand on the damn marker" package?
Would it be possible to test this by exempting certain AI packages from being interrupted? I hate to turn a simple fix into a complex overhaul, but if it for example had a list of certain packages - jobs - not to halt, like manning Artillery or a shop counter marker - that might be a huge improvement to the game :O
I actually can't blame Todd for this one - the center marker is actually between the water pit and the concession stand. The NPCs are actually idling as close to the center of the settlement's sandbox area as they can get, which in this case happens to be the water.
Packages are evaluated several times a minute, and each step in the package has its conditions evaluated as part of that process. Unless you have your shops way out near (or beyond) the edge of the settlement, I don't really see that happening.
For context, the faulty portion of the package is a "Travel" package, which is set up to make the NPC travel to the settlement. This is mostly a safety measure in case NPCs are super far away from whatever they're supposed to be doing, and in the case of settlement NPCs it typically shouldn't need to run at all.
With that said, the travel package appears to have a flaw when the destination is a large enough area - it simply never completes, which results in the NPC "traveling" to the center of their destination forever. I added a condition on that travel package that ensures it only runs when the NPC is outside of the destination area. In the case of settlers, that typically means they have to be outside the settlement sandbox, and the sandbox itself typically overflows past the settlement boundaries. For starlight, that sandbox is the big red box in this screenshot:
so THAT'S why i see these f*kers wandering around that little hilltop....
OK, thanks. So the other standing-around-ness is nothing to do with the flaw this mod fixes, then. Ah well. After all these years I thought we'd finally be able to make those lazy sods get back to work xD
FWIW, they definitely ARE, on average, manning their various posts more than they used to, likely as an effect of them not being on the Road to Nowhere forever any more.
Thanks for this. I'm new to Fallout 4. Was so disappointed when all my hard work settlement building seemed to be pointless since everyone would just stand around all day and night doing nothing. This has greatly helped both the bedtime issues and just general sandbox issues. I came back to Sanctuary today to actually see Dogmeat in her doghouse!
I have noticed this weirdness with some unique npcs like the two hunters that hide near a cage with that one trader's dog in there and when you unlock the cage they are scripted to attack you. These two hunters bug out for me and attack the dog while it is still in the cage because they spawn very near and inside the cage when I first arrive in the area. This didn't happen earlier in the year I think it is because of some mods I have installed and or some F4SE mods installed to extend fallout 4 so it ain't so buggy with too many mods loaded and to bypass the BA2 limit like the x-cell mod for example. For YEARS though I always got the bug with mines in dungeons exploding the moment I enter the dungeon instead of lying in wait as they should be doing.
FWIW I'm pretty sure the mines issue is actually related to silly errors Beth made with their factions. I've noticed similar things with some mines and traps - the locals are incorrectly not in the same faction as the mines and traps, so as soon as the area loads, if the locals are near a mine, it detonates because it detects a non-ally near it -_- this has been a thing since release and Beth has no will to fix it.
However, this mod works mostly by putting a stop to an AI package running too long... i don't think there's any way this mod could CHANGE a raider's hostility from you to their own dog. So it's something else. Maybe even vanilla bugs. I have frequently noticed groups of Rust Devils spawning along with their robots, and they immediately begin killing each other /eyeroll
114 comments
There are a large variety of issues that affect settler AI, and this mod serves as documentation and a fix for an extremely specific bug that, to the best of my knowledge, only affects large mod-added or edited settlements. I am investigating other issues that affect settler AI, and in particular I have found one specific cause that needs further investigation but would, if true, cause significant and verifiable breakage.
All right, so I've been looking into Abernathy Farm as requested and have found several causes for issues encountered there:
Thanks
Dear author!
In your mod you solve a very important and unpleasant problem of the vanilla game.
Thank you very much for this!
Let me ask you to consider the possibility of fixing another problem of the vanilla game related to mods.
The thing is this: in some (not all!) settlements, vanilla natives of settlements such as Abernathy farm, The Slog, Oberland Station,County Crossing (and several others) are tied by the game to vanilla beds.
When dismantling vanilla beds, natives cannot choose another bed in any way, even when assigning a bed to a native through the workshop menu.
Natives do not sleep at night at all.
Other NPCs sleep at night in beds that they "choose themselves".
Could it be that this error is related to the natives' bed markers and not their AI?
Can you fix this error?
I see from your comments that you have seriously studied this topic and have already done a lot.
Thank you very much for your work.
I use such quite popular mods as:
1. Build High - Expanded Settlements
2. Clean and flat settlements 1.2.2
3. Easy Homebuilder and Working Double Beds
4. Snap'n Build - Capital repairs of the real estate add-on
5. Unofficial Fallout 4 Patch-4598-2-1-5
6. the game version 1.10.163
Thank you again for your work!
P.S. This problem is present in the game even without any mods, as I noticed.
May I ask:
1. Are there any plans to release a fix to correct the workshop scripts that bind native settlers to certain vanilla beds in problem settlements?
2. Let me inform you that after removing the vanilla beds in the problem settlements that I wrote about, the number of beds does not affect the distribution of NPCs by sleeping places except for native settlers. Maybe this is only in my game. I tested this both in the game without mods and the unofficial patch and in the game with mods.
I think the problem is not in my set of mods and not in my game.
I am sure you are completely right about the workshop scripts broken by the authors of the game.
The other script issue I mentioned is already fixed in the current version of the unofficial patch, which is the one I use. It is also fixed in a different way in Workshop Framework.
In current versions of the unofficial patch, that bit of code works properly but NPCs such as the Abernathy family will still get "stuck" standing around rather than sleeping until you leave the settlement and come back. The specific cause of this is something I've looked into and not been able to identify - their bed assignment works properly and their AI packages seem to work properly as well, but something about a preexisting NPC is impacting things in a way that hasn't been tracked down. That said, the issue is cosmetic and fixes itself just by leaving and coming back.
Unfortunately, the Workshop Framework mod is "taboo" for me.
And my game is version 1.10.163 and I won't be switching to next gen. And so the unofficial patch will remain old.
It's a pity, but there's nothing to be done.
I'll continue building.
Thanks again for your answer and your wonderful mods!
Of course I voted!
Essentially, it's there for people to try and test for themselves if they're willing to take risks. If a problem is found (such as the one ArcanicVoid reported earlier), I'll fix it as best I can. But I assume there are probably more problems yet to be found, so it's still going to be a file that players will be using at their own risk.
I have folks just standing around the center of Sanctuary and the Castle as well but it doesn't seem to have anything to do with nightfall so oh well.
I've pretty much given up on settlers doing any of their jobs at this point. You were my last hope, Obi-Wan. Ah well, thanks anyway.
If they stay where you moved them, then the likely issue is the pathfinding, and the cause is probably from stacking navmeshed workshop objects too closely. If they walk back to the center of the settlement, then pathfinding is working properly and their AI is at fault instead.
With all that said, I just uploaded a copy of the test build that I had been getting people to give me testing and feedback data on. It's under miscellaneous files. The test build applies the same fix to all AI packages used by settlers in settlements, which should extend the effect of this fix to the entire ingame day. The warning on that file is because there's a small chance that Bethesda relied on this broken behavior elsewhere in the game, sort of like how Morrowind AI has a bug with pathfinding AI that, if fixed, will result in several NPCs swimming out to sea after their quests are complete.
....omg lol i'm dying. I never knew that. Hoo boy.
At this point I'd say it's worth the risk to try at least.... i thought the issue all these years was my crap machine and script lag and not throttling mods enough, but today on a new PC with modern hardware Bethesduh AI and pathfinding STILL sucks. -_-
Cheers for the tip
I'll let you know if anyone tries to swim to Fah Hahbah
I have also installed the Navmesh Fix for several locations to eliminate that as a variable.
However, while it may be too soon to tell, it feels like there's less "idlers" in the damn water pit (gg Todd, putting the center marker in the damn water pit, ffs). I'll see 2-4 at most at any given moment, instead of there routinely being half a dozen or more all clustered 'round doing nothing.
TL;DR tentatively yes i think, so far so good. At worst, I haven't noticed anything breaking other than the issues noticed with those in the NoPackages factions which is now fixed.
EDIT: thinking about my observations more, this may be a bit of a catch-22 situation. Because I noticed that for a while, shopkeepers for instance would actually go to their damn counters for once, but then a short time later, they'd be just standing around near their stores again. So i wonder if EXT is interrupting the "be a shopkeeper and stand on the damn marker" package?
Would it be possible to test this by exempting certain AI packages from being interrupted? I hate to turn a simple fix into a complex overhaul, but if it for example had a list of certain packages - jobs - not to halt, like manning Artillery or a shop counter marker - that might be a huge improvement to the game :O
Just updated previous post with an idea, lemme know what you think.
For context, the faulty portion of the package is a "Travel" package, which is set up to make the NPC travel to the settlement. This is mostly a safety measure in case NPCs are super far away from whatever they're supposed to be doing, and in the case of settlement NPCs it typically shouldn't need to run at all.
With that said, the travel package appears to have a flaw when the destination is a large enough area - it simply never completes, which results in the NPC "traveling" to the center of their destination forever. I added a condition on that travel package that ensures it only runs when the NPC is outside of the destination area. In the case of settlers, that typically means they have to be outside the settlement sandbox, and the sandbox itself typically overflows past the settlement boundaries. For starlight, that sandbox is the big red box in this screenshot:
OK, thanks. So the other standing-around-ness is nothing to do with the flaw this mod fixes, then. Ah well. After all these years I thought we'd finally be able to make those lazy sods get back to work xD
FWIW, they definitely ARE, on average, manning their various posts more than they used to, likely as an effect of them not being on the Road to Nowhere forever any more.
However, this mod works mostly by putting a stop to an AI package running too long... i don't think there's any way this mod could CHANGE a raider's hostility from you to their own dog. So it's something else. Maybe even vanilla bugs. I have frequently noticed groups of Rust Devils spawning along with their robots, and they immediately begin killing each other /eyeroll
DLed, endorsed asap and tracking