I was reading this thread...
http://www.bay12games.com/forum/index.php?topic=20368.0When I got an idea for a better system for "Dwarf Stay Inside". The idea is similar for the Depot Access in the game. In this case, a point (or several) in the map can be marked as "Safe Spots". The safe spots then mark in a Depot Access style fashion (except using one tile wide access) and room designation fashion (only update the pathing map when requested, don't update with every changes in pathing) any squares they can reach (or any square that can reach the safe spot). A separate designation can mark certain location as "Unsafe Zones", which will behave like a wall for the Safe Spot access check. There will be a total of 2 zones: Safe, Unsafe
Safe Zones - Counts as inside by the "Dwarves Stay Inside" order
Unsafe Zones - Counts as outside, any point not reachable from a "Safe Spots"
I think this system could offer several advantage.
1. Using a few safe-spots (one in the meeting hall, for example), allow designation of any areas without having to designate a large map manually.
2. Using room-designation style update, where the pathing map is only updated when you tell it to the zones. This should eliminate any computation required during peace time (until you choose to update it, then the game computes it once).
3. As raised by
http://www.bay12games.com/forum/index.php?topic=20368.msg218884#msg218884. The game can keep store a second accessibility map (one which is not updated at all unless requested to). When the "Dwarf stay Inside" command is activated, the game's preliminary check will make the pathing check against the two map, and if one of them failed, not allow the dwarf to go there. This could mean that civilian pathing could take somewhat twice as long during siege time(it having to check two maps initially).
4. And order to "Dwarf Stay Inside" could also trigger any civilian dwarf (or dwarf that should stay inside) caught outside to path to one of the Safety Zone (or in Toady's job allocation system, the Safety Spot designate dwarfs with an Outside tag to come towards it, ignoring the Unsafe zone limitation until they reach the Safe Spot).
It would be nice if Toady could fix the entrance dance. The above system will still cause a dance at the boundary.
Or maybe using the above to designate burrows... hm...