What I think I know:
- "Normal" civs have a 30 tile range.
- Kobolds and necro towers have a 10 tile range.
- Mountain and Ocean world tiles can only be passed through if there's a site on it.
- Range is measured from the closest settlement, not the capital.
- Range is calculated along the closest path, at the cost of 1 per tile, regardless of whether it is diagonal or perpendicular.
- Mid level tile information isn't used at all, i.e. an Ocean world tile that actually has a land bridge across is nevertheless not passable.
- A site on an impassable tile can be reached if a neighboring tile is passable, and makes the tile itself passable.
What I suspect:
- That Lake tiles are treated the same as Mountain and Ocean tiles, i.e. as impassable.
- A civ set to start in caves fail to expand to new sites and does not show up as a neighbor pre embark (according to tests with modded humans).
- Some unknown criteria can cause the neighbor indicator to be "NO TRADE". The wiki explains that the lack of pack animals causes "NO TRADE", and access to pullers does not negate the indication (but does allow for trade). I've just seen "NO TRADE" in a close to vanilla world (gobbos modified to start on glaciers), but won't investigate it further for the time being.
Known Unknowns:
- What are the exact criteria for determining what a civ's neighbor range is (or, even better, if there's a field somewhere that allows you to read what DF has decided, although knowing a controlling token would help modders)? Site type rather than civ type, as proposed by Fleeting Frames is a very reasonable possible alternative criterion. Humans modded to start in caves are hidden like kobolds, but are nevertheless sending a caravan to a fortress at a range of 16 (the range at which I tested it). Kobolds modded to start at mountainhomes have a normal range according to DF pre embark info, so my best guess is that the military range is restricted to 10 when starting in caves, even when the trade range is longer.
- Which sites are considered to be civ settlements from a neighbor range determination perspective? Caves can sometimes be settled by people belonging to a civ (and get linked economically to player fortresses), and there are e.g. refugee camps, but does it make them count?
- What makes a site dead? This is particularly relevant to necro towers, as I haven't found how to distinguish active ones from dud ones. DF does make a distinction for towers pre embark (it's hard to locate any test case that would test civ attached sites).
Unknown Unknowns:
- The things I've failed to realize will have to be taken into account as well.
Why care about the details: The practical use would e.g. be to allow a script to visualize civ/race ranges pre embark, and possibly to search for sites with certain kinds of neighbors. Besides the practical uses, it's DF info...
Edit: Updated the above based on Fleeting Frames feedback.
Edit 2: Further updates based on findings in this thread.
Edit 3: Updated the above. In particular, looking at DF's display shows "inexplicable" access to mountain tiles that can be explained by hidden LairShrines in adjacent tiles making those mountain tiles passable. Thus, "settlement" has been replaced with "site" when it comes to passability above. Note that the range of sites hasn't been explored, though.