I’m trying to figure out the location system in the source code. I’ve realized that an objects x, y position is only relevant for about 11 tiles worth in a square. Then I think each 11*11 square is stored in a grid. When an object (player, monster) reaches the edge of the square they move to the next one. My question is whether what I know so far is correct and is there some location other than the source codes comments which more wholly describes the location system in cataclysm.
You have the broad outline, DEVELOPER_FAQ.txt has a little bit of detail about the structures involved (at the end of the doc)
The main thing to understand is that the curently-active part of the map shifts around to keep the player centered, when an entity moves on the map, their coordinates are updated, but as a special case, when the player steps from one map tile to another, the active part of the map and all loaded entities shift under the player to keep them centered. We have consensus among the developers that we’d like to get rid of this shifting thing in favor of having everything keep track of absolute coordinates, but there’s no telling when it’s actually going to happen.