I can tell you what's working for me though. Here's what I use:
- (it #includes Utils.h, but the only thing used from that file is IS_SUBMISSION macro)
I invoke SetTimOut(value) as soon as I receive "go", where value = 2.8 for the first turn and 0.8 for any other turn (determined by experiments on the contest server). During the calculation, I regularly (on average on my computer ~every 1-2ms) check whether I'm out of time, using HasTimedOut(); once the time's up, only simple tasks are performed, like outputting the moves to stdout and possibly picking the reinforcement fleets to send to front.
Ever since I've put this timer in place, none of my bots have timed out on the contest server, though they did time out a few times while testing on TCP server.
One thing that's kinda important, I find, is to check the time as often as reasonably possible. I think I don't do it frequently enough myself, but it hasn't timed out on the contest server, so I don't bother editing anything. Ideally, I'd guess that it should be done a few thousand times per second at least, to make sure that there's no timeout.
Also, are you 100% sure that those are timeouts and not crashes?
Statistics: Posted by iouri_ — Sat Nov 27, 2010 6:56 am