Made by: Bernardo Rocha 23214074 requires: Python 3.8 TensorFlow 2.13 Numpy 1.24.3 chess 1.10
A code framework to program chess engines in Python. This framework was then used to created Neural Network based evaluation functions It has searching, evaluation and feature functions, that I explain better later
- Instalation
- Usage
- Structure of the code file
To use this project, download the Project_code.py file Then call it from a python interface as you would a normal package
To create a chess engine (here called BotPlayer) you need 2 things.
SearcherDirector has the written searching functions as functions for the class. Currently there are 5 functions: minimax, Minimax_NN, AB_pruning, AB_prunning_NN and ID_AB_pruning All of them have a parameter that represents depth.
Before starting this step you need to know if you want a NN evaluation function or a Manual evaluatin function. The FeatureDirector has all the functions already prepared, you just need to set a a parameter.
This will take the list of features as argument if you are creating a hand-crafted function If creating a NN evaluation function the arguments are the model and the minply
There are 9 models: "Single256","Single128","Single64","Single32","Pair256","Double128","Single256_Double256_128","Single128_Double128" and 5 possible values for minply "0","15","30","45","60"
Create an object class BotPlayer that takes 3 arguments, a name (string, not relevant), a Searcher and an Evaluator
Use the function simulateChessGame or simulateMultipleGames, using 2 Players of your choice (They can be the same, a HumanPlayer works aswell and needs no arguments when being created)
- Imports
- Global Variable
- Main functions
- Playing functions
- Player
- Search
- Evaluation
- Manual Evaluation
- Manual calc_funct
- NNEvaluation
- NeuralNetworks
- Manual Evaluation
- Trait
- ManualTrait
- NNTrait
- Builders
- Misc functions
- Preset instances
- Lists of options
- Traits
- Evaluations
- Bots