# Random Pathing

Story allows NPCs in a location to randomly wander through its sublocations, allowing dynamic NPCs to not just wait in the same location all the time. This system is executed on only NPCs that are spawned, and if there is any players nearby in a configurable radius.

NPCs who have schedules will be ignored, unless, their schedule entry has no location, that means that time slot can be used for random pathing.

Below example displays how a character can work through 6 to 12, and then rest of the day can be spend with randomly wandering around locations sublocations.

For example, if your city is called Stormvale, and you create a location called `Stormvale` you can create sublocations for that location: `Stormvale/Bakery` , `Stormvale/Tavern` and so on. Characters located at Stormvale will pick one of these sub locations to wander off to, making them even more dynamic.

Random Pathing excels in large areas with many NPCs, as it is hard to define a schedule and micromanage them individually, random pathing can give a sense of 'life' in the city, especially early in the playthrough.

Example schedule with random pathing:

```yaml
schedule:
  "6":
    location: "Lysathara/Council_War"
    action: work
    dialogue: ""
    random: true
  "12":
    location: ""
    action: idle
    dialogue: ""
```
