Halite icon indicating copy to clipboard operation
Halite copied to clipboard

Explain rules in a little bit more detail.

Open Kesanov opened this issue 9 years ago • 2 comments

Currently the intro doesn't explain:

  1. Does production change over time?

  2. Do all players move simultaneously? (Thus you can exchange position with other player next to you)

  3. Does strength increase phase take place before / after attack phase?

Kesanov avatar Nov 15 '16 18:11 Kesanov

I too struggled with these questions. This is what I think:

  1. 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).
  2. 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.
  3. 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.

robertmassaioli avatar Nov 16 '16 20:11 robertmassaioli

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.

robertmassaioli avatar Nov 18 '16 02:11 robertmassaioli