The following observation came up while playing Tron Battle, but it might be relevant for any AI battle.
The game description advertises that the AI must answer in less than 100ms for each game turn.
I made some time measurements between the moment the AI reads game inputs and the moment it prints the answer. Results were very consistent:
- for the first turn, the answer was accepted after up to roughly 500ms
- for all other turns, the answer was accepted after up to precisely 100ms (as advertised)
Those measurements were performed through local simulations, ie hitting the “play” button, not in the arena.
Then I designed some AI that would make those most of this timespan, through an iterative-deepening-tree-search algorithm, and it was working like a charm… until I sent it to the arena, where it timed out within the first 2nd turns in most battles. I’ve even tried to restrain the admissible delay for my AI to answer down to 10ms, and it keeps timing out.
Either the way I’m measuring time isn’t reliable, or the way timing constraints are managed differs between local simulations and the arena. Or both.
To other gamers: has anyone experienced the same issue ?
To codingame developers: care to share any insight about this inconsistency ?
Note: I’m writing the AI in Haskell, and the way I’m managing time relies on