hquxmu / ai-contest

Automatically exported from code.google.com/p/ai-contest
0 stars 0 forks source link

Report turns left in game state sent to bots #74

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the max turn count on the server is 200. However, just a few days 
ago, it was 100. A bot's strategy might depend on knowing how many turns are 
left if the end of the game is approaching. Currently, the max turn count would 
need to be hardcoded, which could be bad if the max turn count is changed 
again. I suggest that the game engine report the number of turns remaining in 
the game when it prints out the game state.

Original issue reported on code.google.com by guy.ki...@gmail.com on 9 Sep 2010 at 12:54

GoogleCodeExporter commented 9 years ago
It's a little late to do this now. The best we can do now is try to fix the 
turn count to some static number for the last n weeks of the contest.

Original comment by Jake.McA...@gmail.com on 10 Sep 2010 at 5:44

GoogleCodeExporter commented 9 years ago
Fair enough.

Original comment by guy.ki...@gmail.com on 11 Sep 2010 at 11:12

GoogleCodeExporter commented 9 years ago
If you do, please fix it to something larger than 200, as discussed in 
http://ai-contest.com/forum/viewtopic.php?f=17&t=445

Original comment by rstar...@gmail.com on 12 Sep 2010 at 8:53

GoogleCodeExporter commented 9 years ago
As I was about to reply on the forums to yet another post requesting this that 
it couldn't be done because of the backward incompatibility, I realized that in 
fact it could be done in a backward compatible fashion by using special 
comments.

After mentioning it on the IRC channel and jmcarthur adding that the comment 
should be specially formatted so additional values could be added later without 
complicating parsing. The format we agreed on was "# : key value".

Anyway here is the patch to output the turns remaining to the players. It 
should change both the python and java engines to output the value each turn. 
The python changes are completely untested and java changes only minimally.

Original comment by janzert on 13 Sep 2010 at 8:00

Attachments:

GoogleCodeExporter commented 9 years ago
Just as a note, looking at the code for the starter packages currently 
available from the site (C++, Java, Python and C#). They all appear to 
correctly ignore comments. I also took a look at a few of the other language 
starter packages that have been posted in the forums. It appears that the Ruby, 
PHP, Perl (from http://ai-contest.com/forum/viewtopic.php?f=18&t=621), Scala, 
Javascript, Clojure and D packages all handle comments. I'm not sure about the 
Common Lisp, Lua, OCaml or Racket packages. The F# package appears that will 
throw an error. So overall it seems like most of the current starter packages 
should work fine with this change.

Original comment by janzert on 17 Sep 2010 at 10:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It was pointed out to me that the F# package does actually handle comments 
correctly.

Original comment by janzert on 21 Sep 2010 at 4:03

GoogleCodeExporter commented 9 years ago
What about passing the total number of turns as a command-line argument. In 
this way new bots can parse the arguments and old bots will simply ignore 
arguments in the command line.

Original comment by alexuga...@gmail.com on 22 Sep 2010 at 3:52

GoogleCodeExporter commented 9 years ago
There's a lot of value in knowing you didn't miss a turn and what the current 
"time" is in turn numbers...

However, IMO if the bot *needs* to know precisely how many turns remain before 
the end, then there's something exploitable going on with the win-criteria. The 
bot is being given an artificial incentive to make tactical choices which would 
normally be bad in order win on a technicality.

Original comment by hage...@gmail.com on 24 Sep 2010 at 1:52

GoogleCodeExporter commented 9 years ago
The problem with using a command line argument is there are bots that are known 
to exit with an error when given an unrecognized command argument. Comments 
have been part of the specification from the beginning of the contest and do 
actually seem to be handled correctly by the starter packages.

Original comment by janzert on 29 Sep 2010 at 5:01