You can't dodge or block after throwing/firing. You can't shoot while running, and it takes more energy to shoot and sprint away than it does to slash and dodge away repeatedly. Blocking and dodging take very little energy whereas sprinting takes up a ton. Mid-level firing skills make you take several moves' worth of time just to shoot and reload. During this time you will be grabbed and hacked-up. I only play archer as flying intelligent creatures. But even then, by the time I train my skills to anything capable of taking on armed opponents and semi-megabeasts, I am useless without an infinite supply of ammo (from a fortress or crafting mod). If all my skills are the same level, it only makes sense to shoot once from 9+ tiles away while surrounded by companions, or chop off the feet of all my attackers and then sprint away. But even then, bolts do less damage than melee attacks, the bolts that miss can never be recovered (unless they fall a z-level), bowyers do not sell bolts/arrows, bowyer workshops are unusable, and if you're not surrounded by companions then a prone enemy can stand up, run at you, and lop off a few limbs or crush some organs before your adventurer has a chance to reload. Why am I forced to reload at point blank range?? This frustrates me. /rant
In the artificially frozen delay after firing a ranged weapon, a
dabbling xbow/bow user can be attacked around 16 times, while a great/legendary xbow/bow user can be attacked around 8 times.
If we think of the lowest tick count attack being 4 and the highest being potentially 10, the tick range for dabbling can be between 64 and 160 ticks. It's half that for a great/legendary at 32/80. Those are the brackets, but the elapsed tick counts are likely in the middle at like 80/100 for dabbling and around 40/60 for great/legendary.
So aside from the very gamey
level 8 or expert shield/dodger, where you can get away with shooting from an adjacent tile, and hop around like a flea, your leeway when shooting is then based on how fast the opponent can close distance and reach you.
I forget if it was Putnam or Bumber who once wrote that a dwarf at 1.000 walking speed crosses a tile at a cost of 9-10 ticks. So a dwarf at top speed, which is say 3, can sprint 1 tile at a cost of 3 ticks.
When you think of it like that, you gauge your time by firing the first shot when your target's just at around the 20 tile mark. Count the tiles they've crossed and then you can decide if you can fire another.
Still the best choice is to keep the target at 22-25 tiles away from you and just volley until they're injured/dead, as at any distance over 20 tiles involves NPCs being oblivious. If you can manage your visual stealth, you can be closer.