CPSC 415 - Artificial Intelligence - Fall 2023
Possible experience: up to +100XP
Due: Sunday, Dec. 10th, midnight
In this final competitive throwdown, you'll be competing against 'bots, fellow players, and even your professor in the classic board game Clue®.
If you don't know how to play Clue®, it's easy to learn. We're going to play a slightly-simplified version of the game anyway: no tokens, dice, or game board (those elements inflict needless random noise on what should be a pure intellectual contest).
Here are the basics:
Our Clue® matches will always have exactly three players in them, even if some of them are dumb stand-ins like the random player provided in the assignment. The order of the players will be automatically shuffled by my simulator before playing.
Before the game begins, exactly one suspect card, one weapon card, and one room card are secretly removed from the deck and placed in an iron-clad solution vault. These three cards represent the "solution" to the game: the actual truth about who the murderer was, what weapon he/she used, and where the killing took place.
All the other cards are dealt out randomly to the players. Happily, if there are exactly three players, this comes out evenly (6 cards each).
The object of the game is to be the first player to figure out which three cards are in the hidden iron-clad vault. You do this by a process of logic, the very first baby step of which is: if you're holding a particular card, you know it's not part of the solution. That's because there's only one of each card in the deck. So you can immediately rule out six cards (the 6 you were dealt) without even being very smart.
Now this part is tricky so pay attention. Players alternate turns in round-robin fashion, and when it's your turn, you have two choices about what to do:
In the rare but comical circumstance that all three players DQ, the game is declared a tie. Otherwise, whoever makes a winning accusation is the winner.
The files clue.py and starting_CluePlayer.py, and from the class's github repo should be all you need to get started. I've also included a really dumb, random player called random_CluePlayer.py that you can practice beating up on.
(When you get to the point of running large multi-game contests, you'll also want clue_suite.py and clue_chunk.py.)
You can run clue.py with three player names to run a single game. Try it right now by running three random players against each other:
$ python3 clue.py random random random
This will print the winner, or the word "Tie". If you'd like to see narrative output of the game as its progressing, change the word CRITICAL in clue.py to "INFO" or even "DEBUG".
To run many games with the same three opponents, and see the results, run clue_suite.py as follows:
$ python3 clue_suite.py random random random 10000
This will run a suite of 10,000 games (using all your system cores) and print tabulated results.
If you wanna be a playa, you'll need to create a subclass of the CluePlayer class. You should start by copying "starting_CluePlayer.py" to "yourUmwId_CluePlayer.py, and changing the word starting to your UMW ID wherever it appears in the file.
Then, read the documentation for each of the methods of this class. It's a total of 16 sentences. I worked really hard on those 16 sentences to make sure they're concise and explain everything you need to know. So be sure to read them, and to ask questions whenever you have them.
You will want to replace the "pass" with your own actual code for all of these methods.
Send email early and often with questions you have on absolutely anything!
Using the KB class that I wrote specifically for this assignment is likely to achieve much better results than you could otherwise. I do recommend that you get your feet wet first by experimenting with the random player, and making some smaller changes to it.
The PropKB.py and cnf.py files are already in the class code base (you're welcome), and the KB itself is described semi-exhaustively on the github page.
If your agent can consistently beat my random player (provided with the simulation code), it will earn at least +50XP.
If your agent can consistently beat my pretty sucky attempt at an actual thinking player (not provided), it will earn at least +75XP.
If your agent can consistently beat my not-as-sucky attempt (but not my real best, either), it will earn at least +100XP.
In December, we will have a three-at-a-time-bracket-style competition with everyone's best Clue player, plus mine. The runner-up in this "Clue® Challenge" will earn +110XP. The grand prize winner will earn a whopping +120XP, plus a weapon of their choice.
You will turn this assignment in by attaching your properly-named ClueAgent Python file to an email with subject line "CPSC 415 Program #5 turnin".
Come to office hours, or send me email with subject line "CPSC 415 Program #5 help!!"