For a school project, I worked with a friend of mine on a ML bot for Terminal.
One of the biggest issue was about how to represent the board game so that a model could interpret it and output some moves.
The first tricky task was to represent the output. Indeed the length is variable (from 0 to theoretically hundreds of units) and several units can be placed on the same tile.
We got around this by creating the notion sub-turn. A sub-turn is either the placement of one unit on one tile or the the action to end the turn. For example a turn with 4 placed units is equivalent to 5 sub-turns.
The first thing we did was to apply a rotation to the board to get rid of the diamond shape and the unused tiles. The tiles would then be in a 15*14 rectangle.
Then we added a third dimension for unit types.
The first 3 rows of the third dimensions would be dedicated to firewalls types and the value of a tile would be the remaining health ratio of the firewall.
The 3 next rows would be for the informations units. We decided there to encode a ratio of how many informations were placed on the tile against an arbitrary number (40 for pings and scramblers, 10 for EMP)
The last row was used to put a removal flag so that the model could know that it had flagged a unit in a previous sub-turn.
We also made a second input with useful indicators (health, cores, bits …)
Our model was a mixed CNN - NN, CNN for the board and NN for for the indicators.
- the input has a huge majority of zeros, which is not very good for learning
- the sub-turn notion induce that there is a priority order for unit placements when sometimes there is not.
- Season 5 pretty much made the input worse as 3 rows have to be added to the third dimension to take into account upgraded units.
I would love to hear your thought on this! Would you have an idea to construct a better representation of the game?