Everyone knows that a coordinate system is in place to navigate through the Runescape world. That coordinate system is based off upon three variables, the Absolute X, Y Z coordinates. Before we continue to talk about how these three variables are used in calculations lets set down some vocabulary:
== Definitions ==
===Tile===
A tile is a representation of an absolute coordinate.
''Example: Varrock Coordinates [3211, 3424] represents one tile.''
===Tile Chunk===
A chunk of tiles, 8 x 8 in size. Also known as a region before the scope of a region was understood. The chunk is considered a point so it has X and Y coordinates. There are two forms of a Chunk, formatted and non; a formatted chunks equation is:
A region is 64 x 64 in size, or 8 x 8 in chunks. The region is considered a point so it has X and Y coordinates. The equation for finding the region the coordinates is within is:
int regionx = (getUnformattedRegionX() >> 3); //getUnformatedRegionX()/8;
int regiony = (getUnformattedRegionY() >> 3); //getUnformatedRegionY()/8;
Note: The Region X and Region Y coordinates are traditionally not used in server location calculations; but practical region systems should use this calculation for many purposes.
There is no calculation for a map and there is no Map X or Map Y. A Map is however a 104 x 104 area made up of 13 x 13 chunks. Why is the number not even you may ask? Because it has a center. The [7, 7] map chunk of the map is the center and is also the formatted chunk. When a region update is called by the server, a new map is called but you must understand that the formatted chunk never changes; the tiles in the map however are updated and trimmed. When the player moves out of the formatted chunk the map is re-positioned to make that chunk the center yet again. As I said, a new update is not needed every time the player enters a new region but when the range of +- 32 from the point in the center of the chunk is reached a update is required to update the map to the new objects so that the 'black space' or fog is not reached. Confused?
The active chunk is the chunk in which the player resides. The definite rendering chunks are the chunks in which will be rendered on the players screen no matter where they are in the active chunk. The indefinite rendering chunks are the chunks in which depending on where the player is within the active chunk they may be rendered or not. Remember this depends on the +- distance of 32 from the players absolute position. The queue chunks are pre-loaded chunks in which after the active chunk is moved may be disposed of or activated depending upon the direction in which the active chunk changes.
If you can imagine a puzzle, a 64 x 64 piece does not fit equally within the 104 x 104 area. So bits of each region are taken that are within the 104 x 104 map area.
The amount of regions that are to be loaded can be calculated this way:
Please note that Region X and Region Y are not formatted.