Explain rules in a little bit more detail.
Currently the intro doesn't explain:
-
Does production change over time?
-
Do all players move simultaneously? (Thus you can exchange position with other player next to you)
-
Does strength increase phase take place before / after attack phase?
I too struggled with these questions. This is what I think:
- Production is a constant and never changes once set; only strength changes. Either when attacked (decrease), when you stay still (increase) or when you merge (globally unchanged).
- The game operates in turns, all of the moves in a turn are one simultaneous action. However, exchanging positions is possible but the attack still occurs.
- They happen simultaneously AFAICT. All that matters is that a piece's final strength is greater than zero after all strength increases and damages have been tallied.
I hope that answers your questions. I think it would be great to add a documented page on the pseudocode that one would need to implement to evaluate a game frame. Most people are going to want to re-implement the game logic in their code so that their AI can make predictions about the value of future actions.
Edit: I am actually less sure about point number 3 now. Based on the 'Turns' section of this page (https://halite.io/rules_game.php) I would actually say that the strength update and cap happens BEFORE the attack calculations are computed.
Another situation that I ran into today when writing my bot:
If you have a board with the following two pieces (surrounded by unowned pieces):
(1, 1) (P: _, S: 5)
(2, 1) (P: 10, S: 10)
And you make the move:
(1, 1) EAST
Then is the final state:
(1, 1) (P: _, S: 0)
(2, 1) (P: 10, S: 25)
Or:
(1, 1) (P: _, S: 0)
(2, 1) (P: 10, S: 15)
As in, does the piece at (2, 1) gain strength as well as the merge or does a merge negate the production strength gain? Not totally clear from the documentation. I think that the first case is what happens and I'll be reading the source to confirm.