From f37d392713a0b6fec7a2c543edcd8402156f3744 Mon Sep 17 00:00:00 2001 From: Sam Moore Date: Mon, 9 Apr 2012 10:23:46 +0800 Subject: [PATCH] Minor rule changes simulate.py scores SURRENDER as 0 points for the surrendering AI, 3 points for its opponent. SURRENDER can be sent instead of a normal move. AIs must now place all 40 pieces during setup --- agents/vixen/info | 2 +- judge/manager/controller.cpp | 13 ++++++++++++- judge/simulator/scores.plt | 4 ++-- judge/simulator/simulate.py | 2 +- judge/simulator/template.plt | 4 ++-- web/doc/manager_manual.txt | 28 ++++++++++++++++++++++++---- web/oldindex.html | 13 +++++++++---- 7 files changed, 51 insertions(+), 15 deletions(-) diff --git a/agents/vixen/info b/agents/vixen/info index 56945f6..59ec77b 100644 --- a/agents/vixen/info +++ b/agents/vixen/info @@ -1,4 +1,4 @@ -vixen.py +vixen.patched.py Sam Moore python Sample AI - An improvement on asmodeus' score optimisation. Considers probabilities for unknown enemy units, and sums scores for paths with common first move. diff --git a/judge/manager/controller.cpp b/judge/manager/controller.cpp index d268792..20b79aa 100644 --- a/judge/manager/controller.cpp +++ b/judge/manager/controller.cpp @@ -62,6 +62,14 @@ MovementResult Controller::Setup(const char * opponentName) { return MovementResult::BAD_RESPONSE; //You need to include a flag! } + + //Added 9/04/12 - Check all pieces that can be placed are placed + for (int ii = 0; ii <= (int)(Piece::BOMB); ++ii) + { + if (usedUnits[ii] != Piece::maxUnits[ii]) + return MovementResult::BAD_RESPONSE; //You must place ALL possible pieces + } + return MovementResult::OK; @@ -87,12 +95,15 @@ MovementResult Controller::MakeMove(string & buffer) buffer += " OK"; return MovementResult::OK; } + */ + //Restored SURRENDER 9/04/12, because... it kind of seems necessary? if (buffer == "SURRENDER") { buffer += " OK"; return MovementResult::SURRENDER; } - */ + + int x; int y; string direction=""; stringstream s(buffer); diff --git a/judge/simulator/scores.plt b/judge/simulator/scores.plt index 67facbf..477ee90 100644 --- a/judge/simulator/scores.plt +++ b/judge/simulator/scores.plt @@ -1,7 +1,7 @@ set term png size 640,480 set output "scores.png" -set xtics 1 -set ytics 1 +#set xtics 1 +#set ytics 1 set xrange [1:] set xlabel "Games Played" set ylabel "Score" diff --git a/judge/simulator/simulate.py b/judge/simulator/simulate.py index 217a80e..b055945 100755 --- a/judge/simulator/simulate.py +++ b/judge/simulator/simulate.py @@ -51,7 +51,7 @@ if len(sys.argv) >= 5: #Score dictionary - Tuple is of the form: (end score, other score, other result) where end is the player on whose turn the result occurs, other is the other player, other result indicates what to record the outcome as for the other player. -scores = {"VICTORY":(3,1, "DEFEAT"), "DEFEAT":(1,3, "VICTORY"), "SURRENDER":(1,3, "VICTORY"), "DRAW":(2,2, "DRAW"), "DRAW_DEFAULT":(1,1, "DRAW_DEFAULT"), "ILLEGAL":(-1,2, "DEFAULT"), "DEFAULT":(2,-1, "ILLEGAL"), "BOTH_ILLEGAL":(-1,-1, "BOTH_ILLEGAL"), "INTERNAL_ERROR":(0,0, "INTERNAL_ERROR"), "BAD_SETUP":(0,0,"BAD_SETUP")} +scores = {"VICTORY":(3,1, "DEFEAT"), "DEFEAT":(1,3, "VICTORY"), "SURRENDER":(0,3, "VICTORY"), "DRAW":(2,2, "DRAW"), "DRAW_DEFAULT":(1,1, "DRAW_DEFAULT"), "ILLEGAL":(-1,2, "DEFAULT"), "DEFAULT":(2,-1, "ILLEGAL"), "BOTH_ILLEGAL":(-1,-1, "BOTH_ILLEGAL"), "INTERNAL_ERROR":(0,0, "INTERNAL_ERROR"), "BAD_SETUP":(0,0,"BAD_SETUP")} #Verbose - print lots of useless stuff about what you are doing (kind of like matches talking on irc...) diff --git a/judge/simulator/template.plt b/judge/simulator/template.plt index 7efe965..04fee17 100644 --- a/judge/simulator/template.plt +++ b/judge/simulator/template.plt @@ -1,7 +1,7 @@ set term png size 640,480 set output "[NAME].png" -set xtics 1 -set ytics 1 +#set xtics 1 +#set ytics 1 set xrange [1:] set xlabel "Games Played" set ylabel "Score" diff --git a/web/doc/manager_manual.txt b/web/doc/manager_manual.txt index fc338ac..98a728b 100644 --- a/web/doc/manager_manual.txt +++ b/web/doc/manager_manual.txt @@ -125,7 +125,7 @@ OPTIONS GAME RULES - Each player controls up to 40 pieces on the Board. The pieces are represented by the following characters: + Each player controls 40 pieces on the Board. The pieces are represented by the following characters: Piece Name Rank Number Abilities 1 Marshal 1 1 Dies if attacked by Spy @@ -152,13 +152,16 @@ GAME RULES Pieces may only move one square horizontally or vertically unless otherwise stated. Pieces may not move through squares occupied by allied pieces, or Obstacle (+) pieces. Pieces may move into squares occupied by Enemy Pieces (#), in which case the piece with the lower rank (higher number) is destroyed. + If the moved piece (attacker) has the lower rank, the stationary piece (defender) does _not_ move into the attacker's square. Each player's pieces are hidden from the other player. When two pieces encounter each other, the ranks will be revealed. The objective is to either destroy all enemy pieces except the Bombs and Flag, or to capture the Flag. - Since 20/12 Bombs reflect the traditional rules; they are only destroyed by Miners. + Since 20/12/2011 Bombs reflect the traditional rules; they are only destroyed by Miners. In previous versions contact of an attacker other than a Miner with a Bomb destroyed the Bomb as well as the attacking piece. + + Since 9/04/2012 An AI must place ALL 40 pieces listed above, or its setup will be declared illegal @@ -299,6 +302,8 @@ PROTOCOL - ATTACKER_RANK and DEFENDER_RANK are the ranks of the attacking and defending piece respectively - The moved piece attacked an opponent piece, and both pieces were destroyed: "BOTHDIE $ATTACKER_RANK $DEFENDER_RANK" - ATTACKER_RANK and DEFENDER_RANK are the ranks of the attacking and defending piece respectively + - Game ended due to the attacker capturing a flag: "VICTORY_FLAG" + - Game ended due to the destruction of a player's last mobile piece (either attacker or defender): " ROW1 -> ROW10 - The state of the board will be printed - Each line represents a row on the board, from the top downwards @@ -392,7 +397,7 @@ PROTOCOL --------------------------------------------------- Synopsis: --------------------------------------------------- - >> QUIT [RESULT] + >> QUIT [$RESULT] --------------------------------------------------- Explanation: --------------------------------------------------- @@ -407,7 +412,22 @@ PROTOCOL Human players are not subject to the timeout restriction. --------------------------------------------------- Please see the information on the -T switch, and the "End Game" section above. + + 5. Resignation + --------------------------------------------------- + Description: + --------------------------------------------------- + Instead of making a move, an AI program may resign. + --------------------------------------------------- + Synopsis: + --------------------------------------------------- + << SURRENDER + >> QUIT SURRENDER + --------------------------------------------------- + Explanation: + --------------------------------------------------- + --------------------------------------------------- EXIT/OUTPUT @@ -494,5 +514,5 @@ NOTES irc://irc.ucc.asn.au #progcomp THIS PAGE LAST UPDATED - 3/03/12 by Sam Moore + 09/04/12 by Sam Moore diff --git a/web/oldindex.html b/web/oldindex.html index 2a50bca..5d3fec7 100644 --- a/web/oldindex.html +++ b/web/oldindex.html @@ -59,11 +59,14 @@

Rounds and Events

+

The scores for the preliminary rounds will contribute to 10% (each) of the final score. Scores less than zero in the preliminary rounds will not be counted.

+

The finals will be worth the remaining 80% of the scores.

+

Check out The UCC Events Page where this and other interesting things are listed!

Sample AI Programs

Several sample AI programs are currently available. The sample programs can be downloaded from the git repository @@ -80,6 +83,7 @@

Clarifications

Questions?

Frequently Asked Questions

Please email matches@ or post to #progcomp with any questions not on that page.

-

Last webpage update: 03/02/12

+

Last webpage update: 09/04/12

-- 2.20.1