Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
axyjo edited this page Jul 25, 2011 · 32 revisions

The map is continuous. The map of an entire world/server is a single image cut into coordinates of size 64x64 pixels. Therefore, a 8192x8192 base map image will correspond to a 128x128 coordinate map - meaning the an entity can only exist on 128 locations horizontally, and 128 locations vertically.

Zoom

By default, zoom level will be set to 0. each 64x64 square on base map represents 1 game coordinate.

  • zoom level X = Map image size (Size of coordinate) -> Size of images loaded.
  • zoom level 0 = 8192x8192 (64x64) -> 256x256px
  • zoom level 1 = 4096x4096 (32x32) -> 256x256px
  • zoom level 2 = 2048x2048 (16x16) -> 256x256px
  • zoom level 3 = 1024x1024 (8x8) -> 256x256px
  • zoom level 4 = 512x512 (4x4) -> 256x256px
  • zoom level 5 = 256x256 (2x2) -> 256x256px
  • zoom level 6 = 128x128 (1x1) -> 256x256px

The map image size will change depending on the size of the world. Therefore, the zoom levels are primarily defined by the visual size of 1 coordinate on each zoom level. Every map will always have these 7 zoom levels going from full coordinate size (64x64) to the lowest zoom level where each coordinate is represented by only one pixel.

At each zoom level away from the maximum, overlay detail is reduced marginally.

Colour Coding of Map Images

There are 6 images from which all initial information about the map is derived.

Base map image

This is the full size map image on which each coordinate is represented by 64x64 blocks. This is the image that will be displayed in the game to the players.

Landmass and Water Bodies Image

This will be another map image which will specify the distinct landmasses and water bodies. R channel will specify whether the coordinate is part of a water body or a landmass. R = 0 when land, R = 1 when water. G channel will be the ID of the land/water masses. RGB = {0,3,0} is used for the 4th landmass on the map. This data is necessary to keep track of which coordinate belongs to which mass. It helps when checking to see if the destination point of an army is on the same continent - if not, the army cannot be ordered to move there, because they would have to swim an ocean.

Political Map Image

This is also a mini-size map image. The provinces will be specified using the G and B channels in the image. This means that the maximum number of land provinces in a map will be 255x255 = 65025. Only values from 0 to 254 can be used. The RGB values of {255,255,255} are reserved for oceans/seas. The provinces will be recognized by their unique ID in the database. ID = 255*G + B + 1. Thus, the province IDs can span from 1 to 65025. Therefore, a province with GB value of {1,2} is the 258th province by ID on the map. The G and B values of this image will never change since provinces will never change in size or in coordinates. The R channel denotes the empire that owns the provinces. Therefore, RGB = {1,0,49} implies that the 50th province is ruled by the 1st empire. The R channel changes throughout the game depending on the changes in ownerships of different provinces. There can be a maximum of 254 empires in a world. R value of 0 is reserved for provinces not owned by any empire. Empire ID = R-1.

Terrain Map Image

This will be another mini-sized map image. The B channel will signify different terrains. That provides 255 possible terrains (because as always {255,255,255} is reserved for water).

  • {R, G, B} = Terrain
  • {0, 0, 0} = Plains
  • {0, 0, 1} = Forest
  • {0, 0, 2} = Hills
  • {0, 0, 3} = Mountains
  • {0, 0, 4} = Impassable Mountains
  • {0, 0, 5} = Desert
  • {0, 0, 6} = Tundra
  • {0, 0, 7} = Swamp
  • {0, 0, 8} = River
  • {255, 255, 255} = Ocean/Sea

Special Resources Map Image

Will update soon...

Cities Map Image

This will be a mini-sized map image which will specify the locations of potential or existing cities. These will be single points on each province which will be the location of cities or towns if they happen to sprout up. The G and B channels will be used to specify which province the cities belong to. These G,B values will correspond with the G,B values of the provinces in the Political Map Image (Number 2 above). Therefore, the IDs of cities in the database should match the IDs of provinces that contain the cities. The R channel of this image will be used to specify the type of city (Town, Village, City, Massive City, Megalopolis, etc. etc.) The R channel will/can change during the game. The G,B channels will be permanently fixed.


NOTE: '{255,255,255} is reserved for water' implies that the value of 255 cannot be used for any other purpose. Therefore, {23,56,255} is not an available choice. The number 255 is any and all instances is reserved for water/oceans/seas.

That's how the map will be built and constructed by the game to be used by players.

Terminology

  • Container: the div that contains all of the elements of a map.
    • Map pane: things that move along with a drag event (markers, tiles, etc.).
      • Tile pane: all map tiles go in a sub-div under here
      • Object pane: other things, like markers, go here.
    • Control layer: things that stay in place even when the map is dragged (zoom controls and things like that).

Z-indices

On the page, various elements will have different z-indices to be adequately positioned.

In order, from top to bottom:

  • Modal (100)
  • Modal-overlay (99)
  • Navigation bar, top (25)
  • Map side bar (20) (everything else)

A* test cases

(09:40:44 PM) - Nikhil: i have two tests

(09:41:36 PM) - Nikhil: 12,66 to 53,111

(09:41:38 PM) - Nikhil: and

(09:42:28 PM) - Nikhil: 83,74 to 50,6