AI time limit problem could be solved by making it increment as the game goes. It could take longer in worse positions.searchTimeMillis = min(1 + (turns_in_game * position_favorable% * some _C), time_left / 2)