Bug: entire bot is winning and then suddenly dies


this is my first bug so im not sure if this is well understood

look at how the winner drops to 0 at the last turn

all the ships just get wiped off the map

whats going on?


slightly different bot but look at this: https://halite.io/play/?game_id=8262476&replay_class=0&replay_name=replay-20180117-231304%2B0000--4163674498-312-208-1516230698


It's likely a timeout - your bot has 2 seconds to make a move; if it doesn't it's eliminated.


thank you. im new to this game. sorry for nooby question.


But why does a bot timeout, even with a timer inside?

import time
start_of_round = time.time()
for ship in game_map.get_me().all_ships():
   current_time = time.time()
   have_time = current_time - start_of_round < 1.8
   if not have_time:

Yes, OK, something can take longer than expected. But without profiling the functions the timer is mostly useless. That profiling must be not only based on the number of ships, but apparently also on the distance they are commanded to travel.