Halite Home

My BOT timing out due to game_map.get_frame()


#1

Why is my bot sometimes (about 5% of the time only) time out but only due to game_map.get_frame(). See the attached image. Initialize params is only getting all the frames. The total execution of my turn is over 1 sec but due to get_frame taking over a sec alone.

starttime = time.time()
start = time.time()
game_map.get_frame()
moves = []
end = time.time()
time_4 = float(end - start)


#2

What language is your bot written in?


#3

Its in python. I tried getting the alternative hlt from alternative starter pack, but the get_frame function is the same i think.


#4

If you start the timer before get_frame(), you include the time spent waiting for the halite environment to send you the next frame. All players must finish sending their moves before your bot is sent the next frame (and that's when you 1 second per move starts).

If your bot finishes a turn quickly, but another bot takes a while, you'll end up including their extra time in your turn measurement.


#5

Oh that makes sense. So I really need the timer to start after get_frame. Thanks for the clarification.