The communication agent allows a game of King's Court to be played across the network. Two humans could play this way but, for our purposes, the important play will be between two intelligent agents.
You can do this project individually or as a team of two. Near the end of the course, we'll hold a tournament among the intelligent agents to see which team's agent rules the board.
King's Court is an abstract strategy boardgame invented by Christopher Wroth and first marketed in 1989.
The game board and starting configuration: King's Court is played on a 8x8 board of 64 squares, often displayed as diamonds. The central area of sixteen squares is called the Court. Each player has twenty four pieces placed on the board in the alternating configuration of Figure 1 to start a game. Every square outside the Court contains a piece. The Court is empty.
Figure 1Movement of pieces: There are two kinds of moves - slides and jumps.
A piece can move by sliding in any direction (vertical or horizontal) to an adjacent square. A piece cannot slide to a square already occupied.
A piece can also move by jumping (also in any direction, horizontal or vertical) over another piece of either colour on an adjacent square into the next adjacent square in the same direction. That destination square must be unoccupied. If the piece that has been jumped over is the same colour as the jumping piece, it is uneffected; if the piece jumped over is the opposite colour, it is removed from the board. If, from this new position, the piece can make another similar jump in any direction except returning to its previous position, the move can continue for two or more jumps. The move ends when no further jumps can be made or when the player chooses not to make an available jump.
Clarification of rule concerning legal jump sequences: to prevent players making 'null' moves (moves that do not change the configuration of the gameboard at all), a jump cannot contain a sequence that passes through a square more than once if all the intervening jumps go over the player's own tokens. For example, the jump 'A1A3A1' is illegal because the token on A2 belongs to the same player. Another example: the jump 'A1A3C3C1A1' is illegal if the tokens on A2, B3, C2, B1 all belong to the jumping player. If any of these four tokens belongs to the opponent, the jump is legal.
Moves cannot contain any subsequence that does not alter the state of the gameboard. The intent of this rule is to prevent players generating arbitrarily long strings to attempt to crash an opponent's communication agent. Hence 'A1A3' is a legal move even when A2 belongs to the jumping player, but 'A1A3A1A3' and 'A1A3A1A3A1A3A1A3A1A3' are not legal.
Beginning play: One player begins by sliding a piece into the Court. This move cannot be a jump. The second player then makes a first move by sliding a piece into the opposite side of the Court. This also cannot be a jump. The players each make one more slide. Thereafter, the players take turns making any legal move, slide or jump.
Clarification: At the first move, a first player has eight possible slides, two 'up' from the bottom of the board, two 'left', two 'down' and two 'right'. The second player must respond with a move in the opposite direction: 'up' <->'down', 'left'<->'right'. For example, if the first player slides 'B4C4', the second player must respond with 'G4F4' or 'G6F6'.
Goal of the game: After the first moves by each player, both must keep a least one piece in the Court at all times. The first player to have no pieces in the Court loses the game.
Clarification: a player also loses if unable to make a legal move. If a player has one piece in the Court, the player cannot move the piece out of the court. If a player has one piece in the Court,and makes a series of jumps with that piece that take it temporarily outside the Court, the player does not lose, as long as the piece is back in the Court at the end of the jump sequence and the move has not been a null move as defined above.
I am assuming you will be writing your code in Java. If you want to use another language, that is fine but you will be unsupported and it is your responsibility to make the communication work between your program and other players' programs.
Your program should be organized with an environment class called KingsCourt and three player agent classes called: AgentHCI to handle keyboard entry of moves, AgentComm to handle communication with another program and AgentIntelligent to be the artificially intelligent player. It's probably best to make the three classes extend an abstract Agent class.
In the tournament (Stage 4), each team will play every other team twice, playing first (piece on A1) once and playing second once. A win is worth 1 point; a loss gets 0. If a team defaults a game, it receives a score of 0 and the opponent gets 1. A team defaults if (i) it is not at the agreed location at the agreed time ready with a working program, (ii) the team's program crashes during the game, (iii) the team's program makes an illegal move, (iv) the program exceeds the time allowed to complete its moves (to be arranged), or (v) the tournament judge (me) declares a default for some other reason. One possibility is that I may have to call a default on two teams (both getting 0) if they get into a stalemate condition where they continue making moves indefinitely without trying to force each other from the Court.
I have decided to implement this condition. Please set the count of 'maximum moves since last jump that removes an opponent's piece' to 50 and count moves by either player. If a 51st move is made without a capturing jump, the match is forfeited by both teams. For example, if player A makes a jump taking a token from player B then each player makes 25 moves without taking a token, player B's 26th move (51 total moves) must capture a piece from player A or the game is forfeited.
The project proceeds in stages. I strongly suggest you keep a journal of your ideas and testing as you proceed. Read carefully what is required in the write-up on Dec. 1 so you can start now by keeping the information you need to prepare the document. The submission at the end is worth 50% of the project mark so don't leave it all to the last crazy week of classes!
|
Stage 1: Monday, Sept. 25 (5% of project mark) |
Submit on one sheet of paper:
|
|
Stage 2: Friday, Oct. 20 (10% of project mark) |
At this point the program should be working with 'interface'
and 'communication' players complete and a stub of an AI player. For this
stage, collaboration is the way to go. Work with other class members
to get Environments working, and working cooperatively. This file,
TCPComm.java, contains a sample class for communication by TCP in Java.
Submit
|
|
Stage 3: Wednesday, Nov. 3 (10% of project mark) |
At this point, your AI agnet should have, at least,
a basic search algorithm implemented. Submit
|
|
Stage 4: November 20-24 (25% of project mark) |
Your program should be ready to compete in the course game
tournament. During the week of November 20-24, games will be scheduled
and played to determine the agents who make the playoffs. The tournament
format will be decided well in advance, once I have an idea of how many
teams will be competing, how long games take to play and so on. Marks out
of 25 will be based on tournament standings. A
team that completes all matches without defaulting gets a minimum of 16.
Tournament results. On November 29, a tournament playoff will determine the grand champion; the champion gets 25. |
|
Stage 5: Friday, Dec. 1 (50% of project mark) |
Submit your final report consisting of the following.
|