The Shamat II map file is a JSON object with the following properties in the tables below. The Constant column is the constant (const) from the shamat.js script file. The Key column is the value of this constant, which is used on the key side of a JSON key-value pair. The Value is what kind of data you can expect the key-value pair to contain in the map.
Map Metadata
Constant | Key | Value |
---|---|---|
FILEKEYVERS | shamat2ver | Shamat II application version number the map was created in; text (but typically represents a decimal) |
FILEKEYROWS | rows | Rows in the map; integer |
FILEKEYCOLS | cols | Columns in the map; integer |
FILEKEYNAME | name | The map’s name; text |
FILEKEYAUTH | author | The map’s author; text |
FILEKEYITER | iteration | Iteration of the map (how many times it’s been edited); integer |
FILEKEYGRAN | grain | Horizontal/Vertical constant; integer |
FILEKEYLWGT | lineweight | Weight of hex grid lines; integer |
FILEKEYSHAD | shade | Greyscale value of hex grid; integer |
FILEKEYZOOM | zoom | Zoom level of map; integer |
FILEKEYTRNO | translucenton | Is translucency enabled; boolean |
FILEKEYTRNA | translucentamt | Degree of translucency; float |
FILEKEYMHEX | mhex | Megahex overlay settings; five values separated by pipe (|) character |
FILEKEYMHWT | mhwt | Megahex line weight; integer |
FILEKEYMHDT | mhdt | Megahex dot weight; integer |
DATAHEX | hexes | Collection of hex definitions; see Hex Data table for details |
CUSTOMCOLORS | custclrs | Collection of custom color definitions; see Custom Colors section below |
BDROPOBJ | backdrop | Backdrop image data; see Backdrop Image section below |
Hex Data
Each entry in this collection contains the full definition of a single map hex.
Constant | Key | Value |
---|---|---|
HKEY_X | x | X position of hex |
HKEY_Y | y | Y position of hex |
HKEY_BASE | b | Base layer data pair collection; see Data Pairs section below |
HKEY_TERRAIN | t | Terrain layer data pair collection |
HKEY_OVERLAY | o | Overlay layer data pair collection |
HKEY_FEATURE | f | Feature layer data pair collection |
HKEY_DECOR | d | Decor layer data pair collection |
HKEY_SYMBOL | s | Symbol layer data pair collection |
HKEY_ANNOT | a | Annotation layer data pair collection |
Data Pair
Many values in a hex definition are a collection of data pairs. These usually represent a graphic symbol’s number and its corresponded color number. Data pairs are defined with the following format:
Constant | Key | Value |
---|---|---|
DATAPAIR_CTYPE | c | The number code of the graphic element (for example, 30 for the Apex graphic) |
DATAPAIR_ROTAT | r | The rotation of the current element, typically a value from 0 to 5 based on 60 degree hex facing increments (for example, 3 is a 180 degree rotation for most components) |
DATAPAIR_MATER | m | The number code of the element’s color (for example, 5 for Wood) |
Custom Colors
Custom colors are an array of key-value pairs. The array index is the color number, and the key-value pair is the color’s name as the key and the color’s hex representation as the value. Please note that the leading # in the hex representation is left out of the map file, as this can cause problems with some JSON parsers, which treat the character as the start of a comment. So you will need to add this back in when casting the hex value as a color representation. Here is an example from the Shadekeep house color file:
"100":{"Benthic":"6aa9ac"}
100 is the color's index value, in this case the first number of the custom colors. Benthic is the name of the color. 6aa9ac is the hex value of the color, which will need to be modified to #6aa9ac for use in most cases, unless you wish to parse it manually in your own code.
Backdrop Image
Any backdrop image included with map is saved as an object withint the save file. The backdrop key identifies the object, and the key-value pairs below reside inside that object.
Note that Shamat II does not use the [-BACKDROPIMAGE-] header that Shamat did to detect the presence of a backdrop. The easiest test is to look instead for the presence of image data in the BDROPDATA key-value pair. If this key is absent then there is no backdrop image.
Constant | Key | Value |
---|---|---|
BDROPDIMNW | naturalWidth | The actual width of the backdrop image in pixels |
BDROPDIMNH | naturalHeight | The actual height of the backdrop image in pixels |
BDROPDIMRW | renderWidth | The width of the image in pixels as displayed on the map |
BDROPDIMRH | renderHeight | The height of the image in pixels as displayed on the map |
BDROPOFFX | offsetX | Backdrop horizontal offset in pixels |
BDROPOFFY | offsetY | Backdrop vertical offset in pixels |
BDROPDATA | imgdata | Image data in encoded format |