Halite Home

Time/turn variable(python)


Shall we use different strategies in different time? How can I use a variable to indicate the number of the round?


Some bots choose to do that. There's no right or wrong answer to that, though.

My bot switches behavior as soon as it makes contact with an enemy, but that's certainly not necessary -- you could do it based on time, or you could just use the same behavior for the entire game.

If you want to indicate the turn number of the round, just set an integer variable to equal 0 when you initialize your bot, and increment it by one whenever you get another frame from the environment.


Some more food for thought regarding a turn indicator: is it ever reasonable to change your strategy if you know the game is close to hitting the max turn number?


I'd say so, as then targeting taking new territory rather than necessarily trying to destroy your opponents (especially in many-player games) becomes feasible. You might lose some territory to your opponent, but that's usually a slower process than taking neutral territory as long as you channel some strength to your borders with opponents.


This happened to me tonight - I was soundly defeating a guy, when the time ran out:


Can you link game file (just for my curiosity)?


Sorry, didn't see your reply. Game lots to the mists of time.