I’m trying to use alpha zero general to apply on Abalone. And here is the original code of alpha zero general: https://github.com/suragnair/alpha-zero-general
There are implements of some rectangle board games such as connect4, gobang, othello, tictactoe, and tictactoe_3d. However, Abalone, which has a hexagon board, makes me confused about how to describe it board in a 2d array which should be the input of the network.
I've implemented another code before I found alpha zero general. This is the original board list I used:
[ 2, 2, 0, 1, 1 ],
[ 2, 2, 2, 1, 1, 1 ],
[ 0, 2, 2, 0, 1, 1, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 1, 1, 0, 2, 2, 0 ],
[ 1, 1, 1, 2, 2, 2 ],
[ 1, 1, 0, 2, 2 ]
Where 1 stands for blacks, 2 stands for white. However, I found it cannot be inputted to CNN.
I have an idea to map it on an 2d numpy array but don't know whether it's ok to be used.
[ 2, 2, -1, -1, 0, 1, 1, 2, 2 ],
[ 2, 2, -1, -1, -1, 1, 1, 1, 2 ],
[ 2, 0, -1, -1, 0, 1, 1, 0, 2 ],
[ 2, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 2 ],
[ 2, 0, 1, 1, 0, -1, -1, 0, 2 ],
[ 2, 1, 1, 1, -1, -1, -1, 2, 2 ],
[ 2, 2, 1, 1, 0, -1, -1, 2, 2 ]
where 1 stands for black, -1 stands for white, and 2 stands for invalid squares.
Is this idea ok?
Is there a recommended way to apply it to a hexagon board game or is there any exists example that I can refer to?