A Halite replay file is a JSON object which describes what occurred during the game. Halite replay files are easy to parse and reasonably compact (and extremely compact when compressed), making them ideal for both using machine learning on Halite as well as sharing interesting games. The extension .hlt is used to distinguish Halite replay files.
A Halite replay file contains only a single JSON object. This object has the following attributes:
version- Describes the version of the replay file. The present version is 11, which is expected to be stable for a while.
width- A positive integer representing the width of the map.
height- A positive integer representing the height of the map.
num_players- A positive integer of at least 2 representing the number of players taking part in the game.
num_frames- The number of frames encoded in this replay.
player_names- An array of strings which correspond to the names of the players, starting with the player with tag 1 and ending with the player with tag
productions- A 2D array of integers which represent the productions of the tiles on the map. These integers fill in the map from row 1 (i.e. the top) to row
heightand within a row from column 1 to column
widthand are all guaranteed to be positive and less than 255.
frames- A 4D arrays of integers. This is the most complex piece of the file specification, so here it is step by step:
num_frames, and it contains individual frames.
height, and it contains individual rows of the frame. The first element is the first (top) row and the last is the bottom row.
width, and it contains individual sites of the frame. The first element is the first (leftmost) column and the last is the rightmost row.
moves- A 3D arrays of integers. The outermost array has length
num_frames - 1and contains the moves for an individual frame. Each element is a 2D array of integers which represent the directions chosen to move for every site on the map. As always, the outer layer of the 2D array fills in the rows from top to bottom and the inside layer fills in individual rows from left to right. The integer values for each site are:
SOUTH= 3, and
WEST= 4. Sites not owned by any player are assigned the value of 0.