an unacceptable number of casualties,
See, there's your problem.
Yes, I know. Thing is I'm also trying to train up a competent military and workers, so losing them left and right is counter productive regardless.
Send out Marksdwarves with those 20 Dwarves.
I started doing that, and it does help. That 20 was a squad of 10 with swords and shields, and 10 with crossbows. I only have that one squad of 10, so I guess this is probably my fundamental problem. Time to spam more crossbows?
Try setting up patrol routes for your military so they spot gobbos before they get near civs.
I've had hunters spot ambush and fire upon it without being attacked in return.
Though I agree that wall would be most reliable. You could also place shooters atop it to provide cover fire for near wall outside operations.
This is a feature I've never uesd before, but have been considering it. Part of the problem is that I'm loathe to take soldiers away from training since they aren't making much progress before half of them get killed, but live training works better than barracks training anyway so this is probably a win in the end. I should start another marksman squad or two and try something like this.
What kind of injuries are causing the deaths that your current soldiers are suffering from?
Before I managed to get them all armored, it was things like having half of their limbs removed by axes. After I got steel armor on all of them for all of their body parts, it turned into the typical whip to the brain through a steel helmet. So I went and fixed
that (still causes shattered bones through clothes, but armor actually stops them mostly now), and now it's a problem with maces killing them through their helmets. That's mostly unavoidable I assume, so I guess I'm going to have to rely on more marksmen and crippling the hammer and macemen I'm facing.
Relying on the surface sucks once your fort's been around for a few years and you're attracting attention. Underground tree farming is one solution. If you need surfrace trees, make the most worthless dwarves tree cutters, and enable only woodcutting and wood hauling, and then everyone else in the fort gets wood hauling turned off. Then only useless chumps will be out there to grab the wood. You could also turn on the wood hauling on your military so when they have "no scheduled orders" they'll start bringing it inside for you (but this will cause your woodcutters to idle a lot!)
Call me an elf, but I don't like the idea of cannon fodder woodcutters.
More practically though, with .34.x many migrants arrive already married and potentially with existing familial relationships from previous or later migrant waves. The result that I've seen is quite a lot of unhappy soldiers because their sister or son or grandmother just got their skull jammed through their brain. So even 'useless' migrants aren't so expendable.
Having wood hauling only turned on for soldiers is an idea... hadn't considered that. It would probably end up with a lot of suicidal last stands though, which I've seen a few of because one soldier is faster than the rest of his squad for example...
That actually leads into a related problem of cleaning up after these ambushes... I'm barely able to smash all of their junk before the next ambush shows up. So civvies are getting caught with a pair of pants in their hands running back to the trash compactor when yet another ambush arrives.
The suggestion about the wall is probably going to be the best thing in the end, and I did start a wall. It's hard to enclose much in the way of trees this way though, so I haven't really finished much of it yet. I considered an underground tree farm, but haven't tried it yet because I figured it would be too slow to be useful. Might be worth another look.
That suggestion for the watch towers sounds like a great one actually, I think I'll try something like that and see how well it works. How many do you need to deploy, and how far apart? I've got tons of turkeys I can toss in the towers.
Man, if magma wasn't so deep in this world I'd just try a Boatmurdered style flood the world with liquid death to kill the ambushers and destroy their crap at the same time. Although then the trees would be less accessible...