I suggest a new tile attribute,
Safety. Calculations of a tile's safety would largely be performed automatically by the game, but the player would also have the option to artificially designate the safety of a tile or area. There may be a "safety continuum", something like Very Safe / Safe / Mildly Safe / Neutral / Mildly Unsafe / Unsafe / Very Unsafe, or it might just be a simple Safe / Unsafe boolean like the other tile attributes.
Civilians, especially children & nobles, would try to avoid Unsafe tiles (with allowances for personality traits like Thrill-Seeking), venturing into them only to perform their jobs before hustling back to safe ground. Active militiadwarves, on the other hand, could feel a sense of importance from being stationed to guard the fort from an actual threat, rather than just standing around to ornament the duke's throne room . . . again, personality traits may play a factor. Migrants and merchants will no longer path to your meeting area / Trade Depot: Instead, they will path directly to the nearest Safe tile, and
then path to the meeting area / depot, preferring to remain on Safe tiles the whole way. This will help newcomers actively move toward the protection of the militia, which hopefully you've sent out to guard them.
What makes a tile Safe?- It's a Meeting Area, Dining Room, Office, Bedroom, or especially an active Barracks.
- Active militiadwarves project an aura of Safety around them.
- Trained war & hunting animals do so as well, but with a shorter radius & only if the animal is at least 1/2 the size of the average dwarf.
- There is NO navigable path from that tile to any map edge (including cavern exits) or unexplored tile, that does NOT pass over an operable Trap or through an active Barracks.
- In areas with flying hostiles and/or aggressive wildlife, there is NO flyable path between that tile and any map edge (including cavern exits) or unexplored tiles, that does NOT pass directly over an operable Trap or through an active Archery Range.
- In areas with Evil weather, all Inside tiles.
- The tile is completely filled, by either natural stone/earth or a constructed wall, rendering it impassible to (almost?) all creatures.
- The player has designated the tile/area as Safe.
What makes a tile Unsafe?- At embark, the entire map.
- There is a path by which a potentially dangerous creature could walk/swim/climb/jump between that tile and any map edge (including cavern exits) or unexplored tile, without passing over an operable Trap or through an active Barracks.
- In areas with flying hostiles and/or aggressive wildlife, there is a path by which a potentially dangerous creature could fly between that tile and any map edge (including cavern exits) or unexplored tile, without passing directly over an operable Trap or through an active Archery Range.
- In areas with Evil weather, all Outside tiles.
- If a necromancer or his handiwork has been sighted, all areas near a graveyard, refuse dump, or stockpile that accepts corpses or corpse parts.
- All openly hostile creatures project an aura of danger around them.
- Potentially aggressige wildlife does do as well, but with a shorter radius.
- All tiles containing operable Traps. (Even though they usually aren't dangerous to dwarves, the dwarves should probably still treat them as if they are.)
- All tiles in, above, or adjacent to: Water deeper than 2/7ths, magma of any depth, or a drop of at least 3 z-levels.
- All tiles resting on any structure (natural or constructed) that is held up by only 1 tile of support. Also, all tiles beneath such a structure.
- All tiles that are separated from water or magma (on the same z-level or higher) by nothing but floodgates.
- The player has designated the tile/area as Unsafe.
This suggestion will almost certainly never be implemented, as it's a lot of work for, as far as I can tell, very negligible change: Dwarves will no longer go free-climbing directly over a volcano for no reason, or go On Break outside under an unholy gloom, and their children will no longer wander around outside to climb directly into a baby-snatcher's bag, but that's about it. But I still feel that it's a good, realistic suggestion that adds a bit of depth, so I should at least mention it.