Halite Home

Time/turn variable(python)


#1

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


#2

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.


#3

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?


#4

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.


#5

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


#6

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


#7

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