The wiki article on siege engines says that it’s “up to” 10 tiles.
I'm 99% sure it's only the dwarves' observer skills determine how close the enemy can get before spooking them.All dwarvesAny dwarf that can see will get spooked at a certain distance.
Further testing lead to a range of 17 to 25 tiles of space needed depending on whether the dwarf is just a dabbling observer or a legendary +5 observer.
The first test was entirely done with 1 dwarf with the following stats (I'm just guessing which ones might have an effect here):
Gap Required: 20 tiles
Discipline: Dabbling (0)
Siege Operator: Talented (6)
Concentration: Dabbling (0)
Observer: Adequate: (2)
In the second round of tests, the ballista was moved 1 tile closer to the zombie, such that 19 tiles of space (including 1 tile of ballista and 1 tile of fortification) separate the operator; the military commander was ordered to prepare the ballista to fire; and the lever was pulled. The commander immediately fled. The ballista was then moved back 1 tile such that 20 tiles of space separate them. This caused the commander to also flee. Ultimately, the ballista had to be relocated such that 25 tiles separate are between the center of the ballista and the undead in order for the commander to hold strong. The commander's stats are:
Gap Required: 25 tiles
Discipline: Legendary +5 (20)
Siege Operator: No experience (-)
Concentration: Talented (6)
Observer: Legendary +5 (20)
I'm thinking it's the observer skill at work. Discipline (unless offset by observer) skill does not seem to have any effect. It also appears that siege operator skill has no effect on the spook range. Interestingly, the change from 0 observer skill to 2 observer skill increased the distance required by 3. Lower level skill gains here seem to have greater effects.
A stonemason with the following skill levels was also tested to find the other end of the minimum fright distance:
Gap Required: 17 tiles
Discipline: No experience (-)
Siege Operator: No experience (-)
Concentration: No experience (-)
Observer: Dabbling (0)
The stonemason was able to man the ballista with a gap of only 17 tiles between their operator position and the undead.In the image above, the crosshairs vertically line up with the center point of the ballista when the commander or the stonemason fled. The up stairs align with the center of the ballista where they would sit happily awaiting to fire. And the upward pointing triangles indicate the width of the ballista to make counting tiles of space easier.Spoiler: Ranges Visible Here (click to show/hide)
Setting up ballistas with a 25 tile gap is just about a whole vertical screen for me:Spoiler: In Practice (click to show/hide)
I ran some tests along these lines some time ago, and since it seems to depend entirely upon their observer skill, I wouldn't expect that to have changed over the versions since the test was conducted.I'm 99% sure it's only the dwarves' observer skills determine how close the enemy can get before spooking them.All dwarvesAny dwarf that can see will get spooked at a certain distance.
Further testing lead to a range of 17 to 25 tiles of space needed depending on whether the dwarf is just a dabbling observer or a legendary +5 observer.
The first test was entirely done with 1 dwarf with the following stats (I'm just guessing which ones might have an effect here):
Gap Required: 20 tiles
Discipline: Dabbling (0)
Siege Operator: Talented (6)
Concentration: Dabbling (0)
Observer: Adequate: (2)
In the second round of tests, the ballista was moved 1 tile closer to the zombie, such that 19 tiles of space (including 1 tile of ballista and 1 tile of fortification) separate the operator; the military commander was ordered to prepare the ballista to fire; and the lever was pulled. The commander immediately fled. The ballista was then moved back 1 tile such that 20 tiles of space separate them. This caused the commander to also flee. Ultimately, the ballista had to be relocated such that 25 tiles separate are between the center of the ballista and the undead in order for the commander to hold strong. The commander's stats are:
Gap Required: 25 tiles
Discipline: Legendary +5 (20)
Siege Operator: No experience (-)
Concentration: Talented (6)
Observer: Legendary +5 (20)
I'm thinking it's the observer skill at work. Discipline (unless offset by observer) skill does not seem to have any effect. It also appears that siege operator skill has no effect on the spook range. Interestingly, the change from 0 observer skill to 2 observer skill increased the distance required by 3. Lower level skill gains here seem to have greater effects.
A stonemason with the following skill levels was also tested to find the other end of the minimum fright distance:
Gap Required: 17 tiles
Discipline: No experience (-)
Siege Operator: No experience (-)
Concentration: No experience (-)
Observer: Dabbling (0)
The stonemason was able to man the ballista with a gap of only 17 tiles between their operator position and the undead.In the image above, the crosshairs vertically line up with the center point of the ballista when the commander or the stonemason fled. The up stairs align with the center of the ballista where they would sit happily awaiting to fire. And the upward pointing triangles indicate the width of the ballista to make counting tiles of space easier.Spoiler: Ranges Visible Here (click to show/hide)
Setting up ballistas with a 25 tile gap is just about a whole vertical screen for me:Spoiler: In Practice (click to show/hide)
I'm fairly certain the results also apply to civilians walking past a zombie-filled pit of various depths.
Here's the fort in case you want to decide its fate from here:
https://dffd.bay12games.com/file.php?id=15327 (https://dffd.bay12games.com/file.php?id=15327)
The DFHack command "gui/mechanisms" is your friend when you look with q at a bridge or lever.