Checkers Engine

0 views
Skip to first unread message

Carlito Roby

unread,
Aug 4, 2024, 3:49:56 PM8/4/24
to riremenlay
Im a relatively inexperienced programmer, and recently I've been getting interested in making a Checkers game app for a school project. I'm not sure where I can start (or if I should even attempt) at creating this. The project I have in mind probably wouldn't involve much more than a simple AI & a multiplayer player mode.

To some extent I agree with some of the comments on the question that suggest 'try something simpler first', but checkers is simple enough that you may be able to get a working program - and you will certainly learn useful things as you go.


1) Board representation - perhaps use an 8x8 array to represent the board. You need to be able to fill a square with empty, white piece, black piece, white king, black king. A more efficient solution might be to have a look at 'bit-boards' in which the occupancy of the board is described by a set of 64-bit integers. You probably want to end up with functions that can load or save a board state, print or display the board, and determine what (if anything ) is at some position.


2) Move representation - find a way to calculate legal moves. Which pieces can move and where they can move to. You will need to take into account - moving off the edges of the board, blocked moves, jumps, multiple jumps, kings moving 'backwards' etc. You probably want to end up with functions that can calculate all legal moves for a piece, determine if a suggested move is legal, record a game as a series of moves, maybe interface with the end user so by mousing or entering text commands you can 'play' a game on your board. So even if you only get that far then you have a 'product' you can demonstrate and people can interact with.


3) Computer play - this is the harder part - You will need to learn about minimax, alpha-beta pruning, iterative deepening and all the associated guff that goes into computer game AI - some of it sounds harder than it actually is. You also need to develop a position evaluation algorithm that measures the value of a position so the computer can decide which is the 'best' move to make. This can be as simple as the naive assumption that taking an opponents piece is always better than not taking one, that making a king is better than not making one, or that a move that leaves you with more future moves is better than one that leaves you with less choices for your next move. In practice, even a very simple 'greedy' board evaluation can work quite well if you can look 2-3 moves ahead.


All in all though, it may be simpler to look at something a little less ambitious than checkers - Othello is possibly a good choice and it is not hard to write an Othello player that can thrash a human who hasn't played a lot of the game. 3D tic-tac-toe, or a small dots-and-boxes game might be suitable too. Games like these are simpler as there are no kings or boundaries to complicate things, all (well most) moves are legal and they are sufficiently 'fun' to play to be a worthwhile software demonstration.


I have coded an AI checkers game but would like to see how good it is. Some people have informed me to use the Chinook AI opensource code. But I am having trouble trying to integrate that software into my AI code. How do I integrate another game engine in checkers with the AI I have coded?


12/19/2020:Jonathan Kreuzer has built a neural network evaluation for his Checkers program,now called GuiNN Checkers. It is much stronger than before, now similar instrength to Cake. To make it more useful for engine match testing, I have addedthe kingsrow egdb driver to it, so that it can use the kingsrow 10-piece WLD db.Install programs andsource code.


8/23/2020: New versions for English and Italian kingsrow are available fordownload. There are some bug fixes and a modest improvement in search strength.The Italian version also has a new opening book built with a recent strongerkingsrow engine, and more book positions.


9/13/2019: I have completed an analysisof 11-man ballots. It includes an opening book file for kingsrow,classification of each ballot as drawn or won/lost, and difficulty ratings. BobNewell's Checker Maven webzine has an article about it: CheckerMaven.


5/14/2019: Depth-to-win databases for English and Italian checkers have beenbuilt and are available for download, along with updated versions of Kingsrowand CheckerBoard that support the new databases, and 400K positions were addedto the English opening book.


11/20/2018: Kingsrow for English and Italian checkers have been redesignedusing Machine Learning techniques, and are quite a bit stronger as a result. BobNewell's Checker Maven webzine has an article about it: MachineLearning Comes To Kingsrow.


5/30/2013: A new version of Kingsrow (1.16h) for English and Italian checkers is available. The Italian opening book has 25%more positions. Both versions have improvements in playing positions that aredatabase draws.


9/30/2012: A new version of Kingsrow (1.16g) for English and Italian checkers is available. It plays more aggressively inpositions that are a database draw. The Italian version also has a bug fixed inthe move generator.


5/30/2011: A new version of Kingsrow (1.16f) for English and Italian checkers is available, and also a new version ofCheckerBoard (1.72) at Martin's web site. Kingsrow has some errors fixed in the English opening book,allows up to 8 search threads and 1024mb for the hashtable, has improveddetection of draws by repetition, and a faster "allscores" search. TheItalian version of Kingsrow now has a 64-bit version, and download links for an8-piece endgame database. The new version of CheckerBoard fixes several bugs andallows access to the 8 search threads and larger hashtable settings.


7/1/2009: A new version of Kingsrow forEnglish and Italian checkers is now available, and also a new version ofCheckerBoard. Kingsrow now has a parallel search engine, which can give up to a3x speedup with multi-core CPUs. Details ofthe changes are given here, and setup files can be downloaded at the Englishand Italian checkers links above.


12/5/2005: 9-piece and partial 10-piece Italian databasesare coming. In October I finished building the 5x4 subset of the 9-pieceItalian database. I also built some of the most useful parts of the 10-pieceItalian db -- 5x5 positions with one king or less on a side. Normally thisrequires computing all the positions with more kings also, a process that tookme nearly a full year using 4 computers for English checkers. But I computedthese 10-piece positions in about 3 weeks by skipping the more king-heavypositions. There is a disadvantage to doing it this way -- some of thesepositions rely on the missing positions with more kings, and therefore cannot beresolved. However it turns out that only a small percentage of the positionscannot be resolved, so this was a nice way to make the Italian KingsRow morepowerful with only a small additional computing effort. Hereis a table which shows the percentage of positions that are resolved in each10-piece slice.


I have been building a new opening book using these databases. When I firstbuilt an opening book for Italian checkers using an 8-piece db, I discoveredthat 9 of the opening ballots are probably forced losses for the weak side.Using the new larger databases I have found 2 more ballots that are probablylost. These are 21-18 12-15 22-19 and 23-20 12-15 22-19. The new opening bookand endgame databases will be available in early 2006.


1/12/2005: 10-piece database progress. InAugust I started computing the 10-piece endgame database. It is being built by acluster of 4 PCs. At the current rate of progress it will be completed this summer, and it will occupy150GB of disk space. About 42% of the databasehas been built, and most of this data has been verified against Jonathan Schaeffer's database. I am also saving the 'moves-to-conversion' data, which isgenerated with almost no additional effort as a byproduct of computing thewin-loss-draw data. The MTC data is useful for solving very difficult positionsthat require a large number of moves before a conversion move occurs. Moreinformation about the MTC data along with some of these most difficult 10-pieceendings and the moves to play them correctly is here.


2/12/2004: Attention checkers programmers: Iam making available the endgame database drivers that are used in Kingsrow.These drivers, which are provided in the form of a .dll file, provide access to the Cake, Chinook, and Kingsrow English and Italiandatabases. Downloadhere. (Note: these drivers are only useful to people that are writingcheckers programs. If you are only using a checkers program you don't need thispackage.)


Given the low volume of Checker production during this time, the number of OHV sixes built is probably just a couple of thousand, if that many. Seems a bit odd for the time and effort invested for such a limited number of engines built.


I did run across one or two references to a 1952 Kaiser-Frazer experimental OHV head for their 226 engine, but with no details or images. Might there be a connection between the two? Possibly, but then an experimental head is not the same as a production one.


An open question would be whether extinct includes examples used as industrial, agricultural or aviation engines. There might be some of these Continentals lurking about in such applications with owners oblivious to the rarity of what they have.


Wow, I never had any idea that there was an OHV 226. And I can imagine that the take-rate was really low. The overall numbers were low for Checkers in general, so could there have only been maybe 3k or these made a year for about 3 years?


Between 1959 and 1964 Checker would produce 30616 cars a year. I have tracked used Checker sales since 2015, at a minimum there are a least 100 Checkers running around with 226 OVD today. Here is one currently for sale being sold on Facebook Marketplace. The Connie engines are great, very reliable, are very quiet and smooth. by 1964 Continental Engine was selling engines to CMC at a loss, and essentially fired CMC as a customer. For its part Checker started looking for other engine sources as far back as 1957. A8A used AMC engines and in the early sixties Aerobuses were using Chrysler 318 engines. Litigation with Chrysler in the early sixties stopped a deal to source 318, so CMC went with GM.

3a8082e126
Reply all
Reply to author
Forward
0 new messages