aboutsummaryrefslogtreecommitdiff
path: root/building_guide/wandering_mobs.md
blob: 7e2bfb68deedd9ba7f52aea1f06dc7b734c52f9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## Wandering Mobs

Mob wandering is configured per-instance in the room YAML, not on the mob definition. (`- id: man` here references the mob whose **filename** is `man.yaml`.)
```yaml
# In a room:
mobs:
  - id: man
    wander_interval: 10       # attempt to wander every 10 ticks
  - id: man
    wander_interval: 15
    wander_rooms: [5, 6, 7]   # optional — restrict which rooms via exits
```

Mobs wander through legal (unconditioned) room exits. When the wander interval expires,
the mob picks a random exit with no conditions and moves through it. If `wander_rooms`
is set, only exits leading to those room IDs are legal. Mobs without `wander_interval`
never wander. Mobs stop wandering while in combat. Dead mobs respawn at their home room.

---