The idea that Bethesda NPCs even
have "pathing" AI hurts my brain.
For anyone who doesn't know how it works behind the scenes: Bethesda NPCs are essentially blind to the world they're in. They don't see the same world you do. They see a separate, mostly hand-crafted simplified version of the world called the "navmesh" that tells them where they're supposed to go. Basically they're on tracks. Which is why sometimes you'll see one of your companions run around a building rather than cut through the alley you went through, or something of that nature - it's because the designers forgot to tell them that alley existed, so they will never go down it given their own "choice" in the matter.
That red stuff? That's the world as NPCs see it. If it's not on the red floor, NPCs won't go there unless basically forced to. If you somehow force them into an area that has no navmesh data, they become myopic exceptional individuals. They're *supposed* to be able to cope with it, but in practice they rarely do. At all.
It's also why the Settler system Fallout 4 was so damned broken. Ever wonder why an NPC would just run into a wall, energetically, for minutes straight? It's because while his entity was constrained to the physics mesh, his AI wasn't. His AI insisted there was a clear spot there, but you built a fence there. All of the building pieces in FO4 were supposed to have their own bits of navmesh attached, but that's just slapping more bandaids on top of an existing bandaid, and in practice it often just confused the NPCs worse.
Oh, that's not the worst part.
The worst part is that the AI, when scripted to go from point A to point B, they will often do stupid shit like loop around in mid stride if you happen to be following them, even if you are supposed to, simply because they are married to this asinine issue where if you try to stick very close to them, they freak out, forcing you to remain a certain distance away from them at all times lest you make them loop their own tracks.
The AI seems to have a consistent issue with dealing with the player except under incredibly strict parameters, and that's assuming all the AI scripting is working as originally intended, and that also assumes the player won't do anything that is unexpected.
A good example can be seen after "When Freedom Calls" in Fallout 4, as your characters head back to Sanctuary.
The AI scripted characters, led by Preston Garvey, follow a strict routine, and those characters will expect you to follow along at the same pace, make the same stops they do, and otherwise remain a certain distance behind them.
If you just fast travel to Sanctuary, which is the sanest idea, you skip any issues.
It's when you try to walk with them the stupid happens.
They generally can adapt all the way up to the Sanctuary bridge so long as you don't go insane and shoot at them or they don't get attacked between the Red Rocket Station and Sanctuary, which is unlikely, unless you modded the game.
It when they reach the bridge weird shit usually happens.
1. They will walk AROUND the bridge, despite it having a navmesh to walk across, simply because the navmesh of the bridge is very narrow thanks to the fact its partially damaged, meaning they will walk through the river.
2. They will try to walk across the bridge, one or more falls through the damaged portion and this causes a lot of roundabout looping till they all get to Sanctuary.
Rarely do they all make it across the bridge in a relatively single file line across the navmeshing without incident, and if you cross the bridge first before they are generally committed to doing so themselves, they will rarely follow you, usually opting to go around it for some inane reason.