(March 30th, 2014, 12:43)WilliamLP Wrote: I think we're talking about what the code calls "plotDistance", and I'm pretty sure it's what culture uses.
Yeah. It's also what the game uses for aircraft range. (Your airship can run an airstrike or recon mission up to "8 tiles away" from its base, so anything in what would be the city's 8th ring.) Novice's explanation above is way better than any of the ones I've posted. (It's probably safe to assume that anytime I say something confusing, it's because I explained it poorly, not because of anything to do with my mental plane!)
Quote:Edit: also, based on a superficial understanding, there's also a big penalty for jumping from one landmass to another. (Or maybe from one landmass to another one with a different area, lol. It depends on what the area() function does.)
This is also correct; the penalty is so huge that it took me a long time to discover it could even happen at all. If a tile is on a different landmass than the one your unit started from, you multiply the total effective distance (from EACH of your unit AND your nearest city to the unit on the unit's landmass) by three!
(I should say: After I had figured all of this out by testing it in the game, I discovered that Seven had discovered the formula already by looking at the code and had recorded in one of his old PBeM threads.)
Except!: For ships, the "times three" effect applies to all land tiles (i.e. forts and cities) to which they can teleport. (They don't care which landmass the city or fort is on.) If the ship is on a water tile, the "times three" effect also applies to any tile in a different body of water than the ship's starting point. If the ship teleports from a city or fort though, it prefers to teleport to any body of water rather than another city or fort.
Just one more thing:
(March 30th, 2014, 03:44)Catwalk Wrote: Does anyone know of a good post explaining unit teleportation rules due to borders being closed or borders expanding?
(Emphasis mine.) Border expansion teleportation is a horrible, horrible kluge. It works exactly the same way as closing-borders teleportation, except that borders actually pop one tile at a time, potentially resulting in a whole series of teleportations for the same unit on the same border pop! Worse still, border pops into neutral territory are handled separately from changes of ownership in contested territory:
Neutral territory pops start from the bottom left and proceed up each column from left to right. So a second-ring border pop proceeds from [01] to [12] thus:
Code:
[CC] = City Center, [FR] = First Ring
[05][07][09]
[03][FR][FR][FR][12]
[02][FR][CC][FR][11]
[01][FR][FR][FR][10]
[04][06][08]
Ownership of contested tiles is resolved separately, and is checked from west to east along each row on the map, starting with the southernmost row and proceeding northward.
For some of the weird consequences of all this, see the save games I just reattached to the old RBP3 post to which WilliamLP linked: here.