So, we all know that sooner or later the new mechanics being added for Adventure Mode will be extended to Dwarf Mode in some way, shape or form, meaning that enemies will theoretically have the ability to scale cliffs and tear down our walls, not to mention jump across our magma-filled trenches. This means that we will need some new methods of separating above-ground areas from the rest of the world, for those who do not simply put their whole fort behind a military-grade booby-trap-lined Entrance Hallway o' Doom and restrict their dwarves to the fortress innards. You know, those of us who like being able to gather tree wood from the surface, or who for some stupid reason decided to embark with animals that need to eat the grasses that only grow up there, or whatever. Plus, if you can make the fortress cool in the process of securing it against climbing, jumping, wall-smashing enemies, you get Plump Helmet Points (Dwarven equivalent of Brownie Points).
So, I've come up ahead of time with a basic design that should do. Implementation will first require a certain amount of !!science!! to measure (theoretical or practical -- depends only on whether you feel confident in the practical measurement holding true for your world) maximum enemy jumping distances both vertically and horizontally, but the basic scheme should be foolproof. (It should also be unnecessary if, say, enemies are only able to jump or climb up one story, or some such practical limit that's easy to work around. But my planned method is cool anyway.)
Here's the gist of it:
Measure the maximum horizontal enemy jumping distance in tiles. Call this "X".
Measure the maximum vertical enemy jumping distance in z-levels. Call this "Y".
Around your fort or across a desired block-off area, dig a channel X tiles wide.
Once one level down, mine one tile toward the protected side.
Now from this space X+1 tiles wide, channel down Y more z-levels.
Pave the bottom so giant trees don't grow!
The result should be a trench just barely too wide to jump across, just barely too tall to jump out of, and with a natural (and presumeably for now therefore indestructible) overhang preventing scaling of the protected side of the trench.
You may, if you wish, carve out fortifications in the topmost of the underground levels facing out into this trench, allowing your crossbowdwarves to pick off enemies who for any reason venture into the trench.
Known complications:
This design does nothing to solve the problem of securing an entryway, and said entryway must go through the Trench o' Defense somehow. A bridge over it would be cool, but afford more risk in terms of having to build constructed gate/guardhouses on top that could be destroyed. It is, on the other hand, possible to leave a land bridge (or build a retractable bridge) at the bottom of the trench's necessary level and dig the actual trench level a bit deeper below that bridge. You could also fill the bottom of the trench below the entry bridge with magma, and then if the bridge is retractable...
You may wish to leave a way to climb back up the far side of the trench. If so, you will need to account for this space if, say, putting the trench as close to the edge of the map as possible. Note however that you only need one extra tile for a ramp that runs in the same direction as the trench rather than perpendicular (leading down toward it). On the other hand, if horizontal and vertical limits on jumping don't compound well for the jumper, it might be reasonable to have the entire trench instead be a slope down to the cliff with the overhang and all. !!Science!! will determine this once we have jumping, climbing, wall-shattering baddies.
Enemies can still shoot arrows over the top. Construct a wall atop the overhang just to block arrows. If X turns out to be less than the distance between the edge and where you can build walls, decide whether to build the walls back from the trench edge (hey, it may be uglier looking, but it gives you the most entrenched underground area), build the trench back from the map edge, or build the trench wider than necessary. (I'm for wider than necessary trenches, personally, but any of the three would work.)
Ground level differences. I don't have an exact solution for this except where the difference is that a slope lowers away from your fortress and so the area where the ground falls away anyway can be evened and built into your trench (basically, the outer side of the trench is naturally missing). Anyone with good ideas for handling notably higher ground or lower ground that would cut into your trench area, please post them.
Rivers. Oh man, rivers. Quite frankly, I also don't know how to handle rivers in the channel-next-to-map-edge-and-remove-the-ramps-to-block-off-the-edge-of-the-map exploit, except possibly to make your legit entrance be a bridge over the river anyway. So if anyone knows what to do about rivers for that older exploit, PM me or point me to a post on the matter, and if anyone has a suggestion for handling rivers in this new anti-climbing-jumping-wall-tearing-enemies trench design, please post it.
And speaking of edge of map issues, if anyone could figure out some way to make this work at the edge of the map (hacky or not) we could potentially use the upcoming fort retirement mechanics plus this method of walling to build a Great Wall across a continent a la China, defending an entire dwarven civilization!
I may be back to post more complications that occur to me.
If anyone wants to draw ASCII pictures showing the actual DF implementation of this design, feel free; I'd rather make it in DF and take screenshots, myself.