The game skips turn?

I just added new features to my algo, but I have a problem. I don’t really know if it is a bug or it’s my fault.

Look like game is moving to next turn when my algo didn’t end his turn.
using debug write I get something like that:

Starting turn 2
algo: standrad stuff that should be in this place

algo: ‘New function number one is called’ - the one I just added
– Now my algo should write results of new function and use it in game, but nothing happens (*)

The game goes to next turn
Starting turn 3
and now the algo debug.writes the results that should be in (*) and it’s before standard stuff that is happening this turn
algo: standard stuff

Previous version of my algo was ok. I added only two functions that are called before game_state.submit_turn() and obviously i’m not using this statment in any other place.

The new functions are doing some heavy calculations, but the game tells me that my turn took like 1s so i have plenty more time and even if i extend the time limit according to my knowledge this thing shouldn’t happen.

I’ve learned not to trust the order of the output. Instead watch the replay file and see if your algo is making decisions on the turn you expect.

I’m guessing it has to do with debug output not being flushed with the same priority as the stdin/stdout of the actual game.

1 Like

I solved it. Yes you are right only the debug outputs are wrong.

Actually that’s what I thought first, I did check it but I missed another bug in my code so it looked like the game engine skiped my turn.

Anyway thanks for help.

Thanks for reporting this, its the first time i’ve heard of it. I’ll add it to the backlog.

1 Like