I’ve been going through Deep Learning and the Game of Go and wanted to apply some principles I picked up. So I built an alternative ML starter pack for halite3.
My encoder just extracts useful information from the json game file (e.g. halite, ships location, structures, moves).
The generator takes an encoder and generates training samples based on normalized values relative to a given ship, with your ship being in the center. So for instance, if your map is:
0, 1, 2
3, 4, 5
6, 7, 8
and your ship is on tile 0,2 (value of 2), the relative map will be
7, 8, 6
1, 2, 0
4, 5, 3
It then stacks 4 useful maps on top of each other and normalizes. The maps are halite, ships, structures and how many times the current ship being evaluated can move on each square. The ships and structures have values of 1 for friendly, -1 for enemy, otherwise 0. The halite and move layer are normalized by dividing by the max halite on the initial board.
These maps should be enough to build a model to predict moves.
I have a few examples in the file below on how to use it. I’ll add more detail in the next few days if anyone is interested.