This game was implemented using Python and was inspired by Eddie Sharick's tutorial series. The repository involves added user interface features and the chess game has been created with the STAR WARS theme in mind. In this implementation, NegaMax with Alpha-Beta Pruning optimisation algorithm is utilized.
Link to Eddie's Chess Series
Main Menu | Credit Menu |
---|---|
Start State | Game State |
---|---|
Font used is 8-BIT WONDER and has been uploaded.
A brief description of the pieces in this STAR WARS themed game is as follows:
Pawn
: R2D2Rook
: Millennium FalconKnight
: C3P0Bishop
: ChewbaccaQueen
: Padme Amidala (Naboo)King
: Anakin Skywalker
Pawn
: StormtrooperRook
: TIE FighterKnight
: Captain PhasmaBishop
: Boba FettQueen
: Kylo RenKing
: Darth Vader
- When
Credits
button is pressed, CREDIT_DISPLAY will be loaded.MOUSECLICK
will return user back to MAIN_MENU. - Press Z to undo the move
- Press R to reset the game
The NegaMax algorithm is similar to the MiniMax algorithm just that it is slightly less complex. Instead of using two functions a minimizing and maximizing function, it ONLY utilizes a maximizing function. (i.e to say that it always selects the maximum value out of possible values) Furthermore, it negates the selected value / multiply value by -1. In addition to using NegaMax, Alpha-Beta Pruning is also incoportated to further optimize the alogrithm. Alpha-Beta Pruning allows us to remove unnecessary game states which improves the speed of the algorithm. In Alpha-Beta Pruning, a depth-first transversal is being used. We will have 2 variables, namely α and β which are initialized to -∞ and +∞ respectively. It is crucial to note that the pruning condition is that α ≥ β. When that condition is fufilled, we prune and do not bother exploring that node. GIF below illustrates the concept.
- Definitely,
ChessAI
can be improved for greater speed and accuracy. Was thinking ofStockfish's Search Algorithm
which is popular for chess. - Board flip when
Dark Side
is selected, although AI plays using theLight Side
pieces.