I’m trying to debug some unexpected behaviour in my bot, and I’m just trying to work out if its an error in my code or expected behaviour with how the turns are processed by the Halite engine.
Are player turns processed sequentially?
- Player 1 - Submits commands for turn 1,
- Engine Processes commands for player 1 and sends new game state to player 2.
- Player 2 - Gets updated state (including Player 0’s move).
- Submits commands for turn 1.
- Engine Processes commands for Player 2. Sends new game state to Player 1.
- Player 1 - Gets updated state.
- Submits commands for turn 2.
Or are the players all executed simultaneously?
- Engine Gets commands from all players for turn 1.
- Engine Executes:
- First Command (Player 1)
- First Command (Player 2)
- Second Command (player 1)
- Second Command (player 2)
- Final commands executed.
- Engine sends new game state to all players.
Logging the server output seems to indicate the latter (simultaneous execution) as they both receive the same game state. If so, are collisions calculated at the end of the turn, or after each command?
Player 1 ship at Cell (1,1)
Player 2 ship at Cell (1, 2)
Player 1 ship moves to Cell (1, 2)
Player 2 ship moves to Cell (1, 1)
Are both ships destroyed or do they both just swap places?
I’m assuming it must be at the end of the turn, or it would give an unfair advantage to the player who moved first, but just wanted to double-check my assumptions.