|
|
|
|
PC PROGRAM DEVELOPMENT: CREATION OF AN INDEPENDENT CAMELOT-PLAYING COMPUTER PROGRAM
A successful independent Camelot computer program contains three primary elements: 1. An effective interactive graphical user interface including the playing surface, the pieces, a timer, the means to electronically save games, etc. 2. Strict adherence to the playing rules. 3. An algorithm to perform an accurate evaluation of positions.
Following is a first attempt at a representation of element #1, a listing of the necessary components of element #2, and a first attempt at an examination of element #3.
GRAPHICAL USER INTERFACE
RULES TESTING
These are the thirty-nine components of Camelot rules that require testing:
RULES TESTS FOR KNIGHT AND MAN 1. A piece is allowed to Plain Move in any direction. 2. A piece is allowed to Canter in any direction. 3. Pieces cantered over are not removed. 4. A Canter is allowed to terminate even if further Canters are possible. 5. A Canter is allowed to change direction. 6. A Canter is allowed to continue if further Canters are possible. 7. A Circular Canter (a Canter that begins and ends on the same square) is not allowed. 8. A piece is allowed to jump in any direction. 9. Pieces jumped over are removed. 10. A Jump must continue if further jumps are possible. 11. A Jump is allowed to change direction. 12. A Circular Jump is allowed. 13. If a Jump is available, a capture somewhere during that move is forced (except if required to vacate Castle). 14. The game is won if two pieces enter the opponent’s Castle. 15. The game is won if a player with two or more pieces captures all of his opponent’s pieces. 15a. The game is not won if a player with two or more pieces captures all but one of his opponent’s pieces. 16. The game is lost if a player has no legal move and his opponent has two or more pieces. 16a. The game is not lost if a player has no legal move and his opponent has one piece. 17. The game is drawn if both players have no more than one piece. 17a. The game is drawn if both players have one piece. 17b. The game is drawn if one player has one piece, and the other player has no pieces. 18. A piece is not allowed to plain move into its own Castle. 19. A piece is not allowed to canter into its own Castle. 20. A piece is allowed to jump over an opponent’s piece into its own castle. 21. If a piece jumps over an opponent's piece into its own castle, and the piece is then next to an exposed enemy piece, the jumping must continue (out of its own castle) as part of that same move. 22. If a piece has jumped over an opponent's piece into its own Castle, and was unable to continue the jumping out of its own Castle as part of that same move, that piece must, on the next turn to move, immediately move out from its own Castle, with no exception. 23. A piece moving out from its own Castle must jump out, if possible, instead of plain-moving or cantering out. 24. A piece that has entered the opponent’s castle cannot move out. 25. A piece that has entered the opponent’s castle is allowed to move from one castle square to the other (designated a Castle Move) twice during a game.
RULES TESTS FOR KNIGHT, ONLY 26. If a Jump is available, the forced capture may be satisfied by a Knight’s Charge. 27. A Knight’s Charge is limited to first canter(s), then jump(s). 28. A Knight’s Charge is never forced. 29. If the canter of a Knight brings it next to an exposed enemy piece, it must jump either then or later in that move. 30. A Knight may charge in any direction. 31. Pieces jumped over during the jumping portion of a Knight’s Charge are removed. 32. The jumping portion of a Knight’s Charge is forced to continue if further jumps are possible. 33. The jumping portion of a Knight’s Charge is allowed to change direction. 34. The jumping portion of a Knight’s Charge is allowed to be circular. 35. A Knight is allowed to jump over an opposing piece into its own castle during the jumping portion of a Knight’s Charge. 36. A Knight is not allowed to canter into its own castle during the cantering portion of a Knight’s Charge. 37. If a Knight jumps over an opponent's piece into its own castle during the jumping portion of a Knight’s Charge, and the Knight is then next to an exposed enemy piece, the jumping must continue (out of its own castle) as part of that same move. 38. If a Knight has jumped over an opponent's piece into its own Castle during the jumping portion of a Knight’s Charge, and was unable to continue the jumping out of its own Castle as part of that same move, that Knight must, on the next turn to move, immediately move out from its own Castle, with no exception. 39. If a Knight has the opportunity to jump out from its own castle, it may, if it can, satisfy the obligation to capture by moving out with the cantering portion of a Knight's Charge instead.
POSITION EVALUATION
All suggestions regarding this element are welcome. Send them to
Michael Nolan at:
BASIC EVALUATION FACTORS 1. Relative values of a Knight and a Man. 2. Value of entering two pieces into opposing castle (winning the game)—the third highest priority behind removing a piece from its own castle (the highest priority) and making a capture by means of a Jump or a Knight's Charge when an enemy piece is exposed to capture by means of a jump (the second highest priority). 3. Value of capturing all of opponent's pieces while retaining two of your own (winning the game) 4. Proximity to Opposing Castle 5. Number of squares controlled by each piece. 6. Values of trading like-valued pieces when ahead and trading like-valued pieces when behind 7. Proximity to center of board 8. Proximity of Pieces (Men or Knights) to Knights 9. Proximity of Men to Men 10. Exposure to a position where a piece is next to an exposed enemy piece but not exposed, itself, to the enemy piece (in other words, moving into a position where a jump on the next move will be mandatory. 11. Value of removing your piece from your own Castle. 12. Value of making a capture by means of a Jump or a Knight's Charge when an enemy piece is exposed to capture by means of a jump.
Here are some very arbitrary values assigned to each, with the following assumption: Depending upon how many ply the look ahead is, whatever move-tree results in the most points is the chosen move.
Assume:
Let: P = total number of friendly uncastled Pieces after move N = value of Knight after move
Then: (2.1100384 - P) N = 2.30688036 – 1.27266278
This formula calculates N (the variable value of one Knight in terms of the constant value of one Man) as a function of P (the number of friendly pieces). Here is a table of different N values as determined by different P values:
P N 1 1.00000000 2 1.27999376 3 1.50000000 4 1.67287081 5 1.80870475 6 1.91543683 7 1.99930200 8 2.06519940 9 2.11697856 10 2.15766424 11 2.18963318 12 2.21475291 13 2.23449084 14 2.25000000
The Knight value depends upon how many of its fellow pieces are still in play. A more involved discussion of this issue can be found here.
2. Castles: 2 pieces into opponent's Castle = 3,100 points (game win)
3. Elimination of all of opponent's pieces while retaining two or more friendly pieces = 3,000 points (game win)
4. Proximity to Opposing Castle: Each piece gets the following points for the rank it occupies:
RANK OCCUPIED POINTS 1(own castle) 0 2 2 3 4 4 6 5 8 6 11 7 14 8 17 9 21 10 25 11 29 12 33 13 37 14 41 15 45 16(opp’s castle) 0
(16th rank = 0 points because moving ONE piece into opposing castle is generally a weak move unless you can move two pieces in)
5. Each square controlled by each piece = 1 point. (e.g., five pieces controlling 8 squares each = 40 points.) "Controlled By" means each square able to be moved to by a legal move, whether by Plain Move or Canter or canter portion of a Knight's Charge, AND each square housing an enemy piece that could be jumped over, whether by Jump or jumping portion of a Knight's Charge.
6. Add to each position a factor of 400 points x total value of your pieces / total value of your opponent's pieces. So, for example, if you had 2 Knights and 3 Men, and your opponent had 2 Knights and 2 Men, you would add: 400 x (2 x 125 + 3 x 100) / (2 x 125 + 2 x 100) = 489 points but if you exchanged 1 Man for 1 Man you would have 2 Knights and 2 Men and your opponent would have 2 Knights and 1 Man, and you would add: 400 x (2 x 125 + 2 x 100) / (2 x 125 + 100) = 514 points, so you would gain 25 points for exchanging a Man for a Man. The concept is that a position where you are ahead 4 Men to 3 Men is better than a position where you are ahead 5 Men to 4 Men, but worse than a position where you are ahead 3 Men to 2 Men. Conversely, a position where you are behind 3 Men to 4 Men is worse than a position where you are behind 4 Men to 5 Men, but better than a position where you are behind 2 Men to 3 Men. In other words, when ahead, trade pieces; when behind, avoid trading pieces.
7. Proximity to center of board: Each piece gets the following points for the file it occupies:
a file: 0 points b file: 1 points c file: 2 points d file: 3 points e file: 4 points f & g files: 5 points h file: 4 points i file: 3 points j file: 2 points k file: 1 point l file: 0 points
8. Proximity of Pieces to Knights: 5 points for each Piece (Man or Knight) adjacent (Vertically, Horizontally, or Diagonally) to a friendly Knight.
9. Proximity of Men to Men: 2 points for each Man adjacent (Vertically, Horizontally, or Diagonally) to a friendly Man.
10. Moving into a position where your piece is next to an exposed enemy piece but not exposed, itself, to the enemy piece (in other words, moving into a position where you're going to have to jump on the next move: -15 points. (This means a position where you can't be taken because you have another piece directly behind you but he can be taken because he doesn't.) Basically, if you move to where he doesn't have to jump you, but you're going to have to jump him next move, you're dead because he can position his other pieces dangerously and you're still going to have to jump next move.
11. Removal of piece from own castle: 6,000 points (mandatory)
12. Making a capture by means of a Jump or a Knight's Charge when an enemy piece is exposed to capture by means of a jump: 4,500 points (mandatory, except if #11 is possible).
|