CS 391 Selected Topics: Game AIHomework #8

First draft players due the beginning of class on Thursday 3/24
Final draft players due the beginning of class on Thursday 3/31

Note: This work is to be done in groups of 2.  Each group will submit one assignment.  Although you may divide the work, both team members should be able to present/describe their partner's work upon request.

# Two-Player Upper Section Yahtzee Competition

Create a uniquely named Upper Section Yahtzee player implementing the YahtzeePlayer2P interface with an ability to be constructed with no parameters.  You will be provided with an implementation of a perfect scoring player and tournament software (making use of code from HW5-HW7).

Recall from class that playing to score is not the same as playing to win.  There will be situations in multiplayer play where one would rationally sacrifice scoring expectation in order to maximize the expected probability of winning.

As an extreme example, consider the case where one has 1s and 6s left to score.  One has rolled n 6s, and optimal scoring play would be to score in 6s.  However, if the other player has a scoring lead such that one would need at least n+1 6s to have any probability of winning, then one would rationally trash the n 6s and score in 1s in favor of even a slim probability of winning with a final turn with n+1 or more 6s.

This assignment is open-ended as long as your player can play an entire game against itself in less than 1 second.  This will allow us to easily have a round-robin tournament with 1000 or more games per match.

Your player should also not use more than one-third of the default Java heap for dynamic memory allocation.

There are many possible approaches to this problem.  Possibilities:

• Precompute and load optimal play for achieving different target scores.  Adjust play according to the opponent's expected scoring potential.
• Perform Monte Carlo simulation of playouts with various actions.   Choose the action yielding the highest win ratio.
• Do the previous approach offline and learn a mapping from states to actions (e.g. Weka ML tools).
• Hand-code rules for deviation from optimal scoring play.

You are not expected to compute optimal two player play.  This would require resources and time that are beyond that available for this assignment.  Thus, this is a open-ended challenge to engineer your best player given the time constraints of the assignment.

I recommend beginning with a simple player.  Remember the KISS Principle.

Evaluation: Each tournament will include an optimal scoring player for benchmarking.  Your player should be able to beat an optimal scoring player in tournament play.  The high variance of outcomes for small sample sizes will likely require many games before distinctions can be made between players, so fast, efficient players will be easier to demonstrate as superior to our benchmark.  (For example, in one test tournament against itself, the optimal scoring player had a 1.3% performance difference from itself across 20,000 games.)