Skip to content

This game is inspired by Eddie Sharwick's chess series. Added in UI features and made it Star Wars themed :)

Notifications You must be signed in to change notification settings

Jabezng2/Star-Wars-Chess-AI-Game

Repository files navigation

♟️Star-Wars-Chess-AI-Game♟️

Content Page

About

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

Interfaces

Main Menu Credit Menu
Start State Game State

Font used is 8-BIT WONDER and has been uploaded.

Pieces

A brief description of the pieces in this STAR WARS themed game is as follows:

Light Side

  1. Pawn : R2D2
  2. Rook : Millennium Falcon
  3. Knight : C3P0
  4. Bishop : Chewbacca
  5. Queen : Padme Amidala (Naboo)
  6. King : Anakin Skywalker

Dark Side

  1. Pawn : Stormtrooper
  2. Rook : TIE Fighter
  3. Knight : Captain Phasma
  4. Bishop : Boba Fett
  5. Queen : Kylo Ren
  6. King : Darth Vader

Controls

  • 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

NegaMax w Alpha-Beta Pruning

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.

Improvements

  1. Definitely, ChessAI can be improved for greater speed and accuracy. Was thinking of Stockfish's Search Algorithm which is popular for chess.
  2. Board flip when Dark Side is selected, although AI plays using the Light Side pieces.

Image Sources

  1. MainMenu
  2. CreditMenu
  3. ChessPieces

About

This game is inspired by Eddie Sharwick's chess series. Added in UI features and made it Star Wars themed :)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages