Quotes from the 'Coming Out in Tarsus' thread:
Almost every building on the map is given a value at offset 26 (decimal) which I could not for the life of me make sense of. Almost every building on the map is also given coordinates at offet 32/33 which represent the building's access tile. The access tile is often, but not always, the tile on which walkers spawn. It appears to be determined as the first road tile encountered when circling the building clockwise starting NE of the northern tile.
If no road tile is encountered the access tile is the nearest unoccupied tile to the map entry point. Note that this applies to all buildings regardless of whether they have workers, require road access, etc. except that native huts access on the first available tile whether or not road tiles are involved and native fields have no access tile if they are not within 2 tiles of a road. Where a valid access tile cannot be identified (either because there are no unoccupied tiles or they are 'boxed in') the coordinates are set to zero. Curiously, no access tile is stored in the Buildings List for housing, which is apparently computed at need.
Where there is no access tile there is no value stored at offset 26. Clue number one. It transpires that the value stored at offset 26 is derived from the access tile coordinatesrelative to the map entry point. To illustrate, the career 'Tarsus' has its entry point at x=0, y=78. In my Tarsus, I have a weapons workshop at 28,29 which has access at 29,31. We take the difference in 'x' (29 - 0 = 29) and the difference in 'y' (78 - 31 = 47). Add them together and add 1 (don't ask me why plus one, it just is, okay?) - result 77. This, we find, is the value stored at offset 26. So the value is essentially the sum of the distances along each axis - not just as the crow flies.
Another example - a fountain at 25,70 has access at 25,71. Applying the same formula results in a value of 33, but when we look at offset 26 we find a value of 55. What's gone wrong?
If you have my Tarsus to hand you can see that because of obstructions, to get to the entry point from the fountain you have to go around the wheat warehouses. This means going 11 tiles along the Y axis in the opposite direction to that in which you need to go, so you need to go 11 tiles back again. Those 22 tiles of displacement, added to the 33 we calculated, gives the correct figure of 55. So we can modify our statement to say that the value is the sum of the total tiles traversed in either direction along each axis.
It's easy to imagine that a donkey caravan might use that number to identify the neasrest warehouses - just pick the one with the lowest number (assuming it stocks/accepts the appropriate goods). I'm fairly sure that these numbers are used for other distance assessments too - the gane does not necessarily actually compute the distance between say, an iron mine and all the weapons workshops it could deliver to. It probably simply picks the one whose value at offset 26 is closest to its own (all other things being equal).
If that is the case - and I meanif - it might explain some anomalies observed where farms deliver to the 'wrong' granary, pushers 'get' from the 'wrong' warehouse, etc (though I'm sure stock levels account for some of these anomalies too since a getter may prefer a distant warehouse with more stock to a closer one with less stock). It might also explain why apparently irrelevant changes to a map (such as deleting trees or building actor colonies) might interfere with decisions made. If additions/deletions increase or decrease displacement of routes to the entry point along either axis the numbers will change.
It's also clear, if the foregoing does indeed account for how proximity is determined, that it is the access tile that is relevant and not the northern tile. I'd already observed that in earlier experiments with an olive farm surrounded by oil workshops, noting the order in which deliveries were made. Changing the road acces points (while leaving the buildings in the same relative positions) changed the order. So did building a statue nearby
Edited to correct description of how 'access tile' is determined
Didn't someone post some years back about deleting trees or something that 'fixed' a wayward cartpusher who was intent on ignoring the obvious nearest destination? ... I don't think it ever got explained.
That sounds familiar (including the lack of explanation).
Testing by deleting the temporary buildings, I found that the cart pusher went back to "correct" behavior when an actor colony (to the NNE of the troublesome granary) was built.I think I might be close to shedding some light on this. I've been studying the Buildings List (to aid a restful night's sleep) and while some of the data is fairly easy to suss out I had great difficulty in making sense of certain parts of it. As is usually the case with these puzzles, you get a wild thought, test it out and voila - problem resolved.
Almost every building on the map is given a value at offset 26 (decimal) which I could not for the life of me make sense of. Almost every building on the map is also given coordinates at offet 32/33 which represent the building's access tile. The access tile is often, but not always, the tile on which walkers spawn. It appears to be determined as the first road tile encountered when circling the building clockwise starting NE of the northern tile.
If no road tile is encountered the access tile is the nearest unoccupied tile to the map entry point. Note that this applies to all buildings regardless of whether they have workers, require road access, etc. except that native huts access on the first available tile whether or not road tiles are involved and native fields have no access tile if they are not within 2 tiles of a road. Where a valid access tile cannot be identified (either because there are no unoccupied tiles or they are 'boxed in') the coordinates are set to zero. Curiously, no access tile is stored in the Buildings List for housing, which is apparently computed at need.
Where there is no access tile there is no value stored at offset 26. Clue number one. It transpires that the value stored at offset 26 is derived from the access tile coordinates
Another example - a fountain at 25,70 has access at 25,71. Applying the same formula results in a value of 33, but when we look at offset 26 we find a value of 55. What's gone wrong?
If you have my Tarsus to hand you can see that because of obstructions, to get to the entry point from the fountain you have to go around the wheat warehouses. This means going 11 tiles along the Y axis in the opposite direction to that in which you need to go, so you need to go 11 tiles back again. Those 22 tiles of displacement, added to the 33 we calculated, gives the correct figure of 55. So we can modify our statement to say that the value is the sum of the total tiles traversed in either direction along each axis.
It's easy to imagine that a donkey caravan might use that number to identify the neasrest warehouses - just pick the one with the lowest number (assuming it stocks/accepts the appropriate goods). I'm fairly sure that these numbers are used for other distance assessments too - the gane does not necessarily actually compute the distance between say, an iron mine and all the weapons workshops it could deliver to. It probably simply picks the one whose value at offset 26 is closest to its own (all other things being equal).
If that is the case - and I mean
It's also clear, if the foregoing does indeed account for how proximity is determined, that it is the access tile that is relevant and not the northern tile. I'd already observed that in earlier experiments with an olive farm surrounded by oil workshops, noting the order in which deliveries were made. Changing the road acces points (while leaving the buildings in the same relative positions) changed the order. So did building a statue nearby
[This message has been edited by Trium3 (edited 07-22-2012 @ 06:10 PM).]