How can I get iterative JSON game data, of game_statistics?


I used Fluorine to save JSON data from the replay.HLT file and it’s great, but I have to do it manually.
Is there a better way to get a dictionary of game data out of the HLT FILE?

Decompress HLT file?


You can use ‘–no-compression’ to get the .hlt in JSON format.

with open(file_name, 'rb') as f:
            data = json.loads(zstd.loads(

That’s taken straight from the Machine Learning Starter Kit parse file. You could modify their code, or at least use it to understand the format of the JSON that you get from a .hlt replay file.


Haha I don’t know how i missed that. Thanks!
Disables compression for output files. (They will just be plain JSON.)


Another way is to run it from Python with the following kind of script:

result =["./halite.exe", "--replay-directory", "replays/", "--results-as-json", "--width 32", "--height 32", \
            "python","python"], stdout=subprocess.PIPE)
resultsJson = result.stdout.decode('utf8')
data = json.loads(resultsJson)
error_log = data['error_logs']
stats = data['stats']

This way you will get the results in ‘stats’ and any error message in ‘error_log’.

This allow you to run several times and find which bot is better, for example.


python -m hlt_client replay user -l 100 -d . --decompress

The right command is --decompress in the latest Halite CLI