Game time outs locally


#1

When I run the game on my local machine, it frequently times out. Here is an example error log file:

Turn 24

error: timed out after 2000 ms (when reading string)
Last input received was:

m 4 s m 8 o m 12 o m 16 o m 0 e

A few things to note:

  • It doesn’t time out every game, but maybe every second or third game.
  • When it times out, it frequently does it as early as round 24.
  • I have no special code doing anything different this turn compared to previous or following turns.
  • Not infrequently, two different bots in a 4-bot game time out on the same turn.
  • The logs give nothing helpful. They show that everything that should be done has in fact been done. All bots have been given proper commands, like in the case above.

This causes me to believe that it is the game engine, and not the bots, that times out. What can I do to identify and rectify this situation?

I run on Windows 10, bots in Java and nothing else is consuming CPU.


#2

There is a --no-timeout flag you can use, though your case sounds strange so I don’t know if it will help.


#3

Thanks, I’ll try that. I will also add timestamps to my bot logs every turn to make sure that they do indeed run much, much faster than 2 s.


#4

Some infinite loop/search might be occuring? That happened to me in the beginning when ships were plotting routes wrapping around the board and kept reversing directions infinitely at the boundary. Also adding a 1.5s quick finish in the logic helps prevent crashed in production.