My current megaproject is sprouting (at the expense of a quicker conclusion of the megaproject) a defence system consisting of a long tunnel (edge to near-centre) from the usual Dwarven Wagons entry point (I'm too lazy to restrict everyone to limited entry position, so I'll replicate this tunnel in two other directions, and maybe make a modified concession in the fourth direction). The tunnel can be closed by drawbridge, but that's mainly just a concession to its construction (keeping it closed while things are being perfected), and while it's wagon-width, it is criss-crossed by single-width trapped tunnels that an enemy would have to path through (incoming
or outgoing) if I switched some strategic 'cattle-grid' bridges to a retracted status.
Shortly beyond that are a couple of tame elephants, chained in special alcoves in the tunnel walls (for aesthetic purposes), and shortly after that the tunnel to the depot branches off to one side while the 'main' branch dives down some ramps in front of a staggered Siege Engine battery position. The Depot has bridges capable of isolating it from the entrance tunnel, the inside and a third exit which takes a long (wagon-capable) winding route round to the sub-siege element of the tunnel. It also passes through/connects to the channels that the Depot's main bridges cross. Other features also (or will also) flank the routes, but they don't bear worth expounding upon.
Theoretically, friendlies (and any of my own population who are working outdoors) will travel in and out through this entrance, or suitably equipped alternatives, which will be normally kept open (but could be sealed if I really don't like the look of any full-blown siege). It's a relatively short path through to the depot and the fortress and shouldn't hinder wagons.
If traps, animals or full-scale notifications detect hostiles/invaders/siegers, I can decide to 'allow' them access to the length route to my fortress, allowing me more than enough time to prepare, and behind them shut off the 'easy' routes back out again. They should also be decoyed by the guard animals. I have an option of firing catapults
and ballistas down the tunnel (if I feel like it), or injecting troops at various points along the path at whim. I can also effectively confine most creatures (flying megabeasts would probably overcome the restrictions, and HFS-level creatures haven't currently been specifically catered for) to segments of redundant tunnel by switching things so that a tendency to path towards/away from my fortress-proper guides them to where I feel happiest for them to be.
I'm trying to avoid metagaming by actually overdesigning the system to be
capable of more intelligent/capable enemies, even if the ones I get are relatively easy to coerce into a trap. I'm also generally avoiding water/magma defences, bu that might change when I have my "Valley(/Quarry) Of The Kings"-style megaproject complete and I actually seek out and tap into the respective underground resources that I know are on my map (plus the HFS, that'll I'll at least scrape the surface of to encourage the arrival any nobles who haven't already turned up to live in the pyramids I'll have carved from the living rock).
As I've also been carving through sandstone, I've also been playing with a sandstone-block "Pyramid of Doom" on the edge of my digging site which is going to be my one and only non-carved 'external' building (barring an isolated windmill or two, perhaps) by the time I've cleaned everything up. I'll coat it in ramps of whatever white fluxstone I can aquire, to mirror actual pyramid construction, and it is being constructed to be riddled with trap-filled corridors for an additional homage to tradition. Albeit (in the latter case) to B-movies and other adventure capers.
Oh, nearly forgot. I've also got a pit for caged enemies that (after an interesting unplanned experience of this kind) lets me open/close various 'escape' routes to the open air to direct them into different configurations of trap (spiked balls, etc) for FNU! Or I could use it as a 'live-fire' training arena for melee or ranged troops. Depends what mood I'm in, I suppose.
Of course, an awful lot could go wrong, and I can only spare an hour or two working on this, per night, on a low-spec machine, so it's taking a long time to organise things.