Skip to content

Commit 078826f

Browse files
committed
2 parents e76499d + 24093e9 commit 078826f

File tree

1 file changed

+53
-44
lines changed

1 file changed

+53
-44
lines changed

README.md

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
MinimalChess is a UCI chess engine written in C#.
44

5-
It's focus on a *minimal* implementation of only the most important features and optimizations makes MinimalChess a good starting point for programmers with a working knowledge of C# but no prior experience in chess programming. MinimalChess is written in only a few hundred lines of idiomatic C# code where other engines (of comparable strength) often have thousands.
5+
It's focus on a *minimal* implementation of only the most important features and optimizations makes MinimalChess a good starting point for programmers with a working knowledge of C# but no prior experience in chess programming. MinimalChess is written in only a few hundred lines of idiomatic C# code where other engines of comparable strength often have thousands.
66

77
The didactic nature of the project is reinforced by it's open source license (MIT) and a dedicated series of explanatory [Youtube](https://www.youtube.com/playlist?list=PL6vJSkTaZuBtTokp8-gnTsP39GCaRS3du) videos.
88

99
## Features
1010

1111
* A simple 8x8 Board representation: Just an array to represent the 64 squares and keep track of the pieces.
12-
* A triangular PV-Table to keep track of the Principal Variation of best moves.
1312
* A Transposition Table to store the score and best move of previously visited positions.
14-
* Staged move generation: TT first, followed by the PV move, then MVV-LVA sorted captures, followed by known killer moves and finally the remaining quiet moves.
15-
* Iterative Deepening Search with PVS, null-move pruning and Quiescence Search.
13+
* Staged move generation: TT moves first, followed by MVV-LVA sorted captures, followed by killers and finally history-sorted quiet moves.
14+
* Iterative Deepening Search with PVS, null-move pruning, futility pruning and late move reductions.
1615
* Tapered PSTs with values tuned on a set of 725000 quiet, labeled positions.
1716
* A 13th auto-tuned table for a dynamic, mobility-based evaluation component.
1817

@@ -25,21 +24,67 @@ MinimalChess, just like most other chess programs, does not provide its own user
2524
* [Nibbler](https://github.com/fohristiwhirl/nibbler/releases) (free)
2625
* [Chessbase](https://chessbase.com/) (paid).
2726

28-
Once you have a chess GUI installed you can download the prebuild [binaries for Mac, Linux and Windows](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.4) and extract the contents of the zip file into a location of your choice.
27+
Once you have a chess GUI installed you can download the prebuild [binaries for Mac, Linux and Windows](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.6) and extract the contents of the zip file into a location of your choice.
2928

3029
As a final step you have to register the engine with the GUI. The details depend on the GUI you chose but there should be something like "Add Engine..." somewhere in the settings.
3130

3231
After this you should be ready to select MinimalChess as a player!
3332

33+
## Compiling the engine
34+
35+
This repository contains 3 projects:
36+
1. **MinimalChessBoard** is a command-line based GUI
37+
1. **MinimalChessEngine** is a [UCI](https://en.wikipedia.org/wiki/Universal_Chess_Interface) compatible chess engine
38+
1. ***MinimalChess*** is a library with shared chess logic and algorithms used by the other two applications
39+
40+
### Windows
41+
42+
To compile MinimalChess on Windows I suggest you install Visual Studio and open **MinimalChessEngine.sln** in it.
43+
You will need to have the [.NET Core 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) installed.
44+
Hit the play button and it should compile and start!
45+
46+
### Linux
47+
48+
Read the official instructions on how to [Install .NET on Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux).
49+
There are also [Ubuntu Linux specific installations instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu).
50+
51+
You can clone the repository and compile it like this:
52+
53+
```
54+
$ wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
55+
$ sudo dpkg -i packages-microsoft-prod.deb
56+
57+
$ sudo apt-get update; \
58+
sudo apt-get install -y apt-transport-https && \
59+
sudo apt-get update && \
60+
sudo apt-get install -y dotnet-sdk-5.0
61+
62+
$ git clone https://github.com/lithander/MinimalChessEngine.git
63+
$ cd MinimalChessEngine/
64+
65+
$ dotnet build -c Release
66+
```
67+
3468
## Version History
69+
70+
### Version 0.6
71+
```
72+
Version: 0.6
73+
Size: 708 LOC
74+
Strength: 2400 ELO
75+
```
76+
[__Version 0.6__](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.6) uses an improved transposition table with two buckets and aging. It also adds late move reductions and deep futility pruning. Quiet moves are now sorted based on a simple history heuristic which has a nice synergy with LMR. In total these changes allow MinimalChess to search much deeper (at the cost of accuracy) so that it gains about 200 ELO in playing strength over the previous version.
77+
78+
### Version 0.5
3579
```
3680
Version: 0.5
3781
Size: 707 LOC
3882
Strength: 2200 ELO
3983
```
4084
[__Version 0.5__](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.5) adds a 13th tuned table for a mobility-based evaluation term, null-move pruning and a simple transposition table. I also changed the target framework to .NET 5.
41-
With these changes MinimalChess gains about 350 ELO in playing strength over the previous version.
85+
With these changes MinimalChess gains about 350 ELO in playing strength over the previous version and is listed at [2264 ELO](https://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?eng=MinimalChess%200.5%2064-bit#MinimalChess_0_5_64-bit) on the CCRL.
4286

87+
### Version 0.4
4388
```
4489
Version: 0.4
4590
Size: 610 LOC
@@ -50,7 +95,7 @@ I also added a [killer heuristic](https://www.chessprogramming.org/Killer_Heuris
5095
A new time control logic now allocates the given time budget smarter, especially in modes where there's an increment each move, and the 'nodes' and 'depth' constraints are now supported in all modes.
5196
MinimalChess 0.4.1 is listed at [1883 ELO](http://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?print=Details&each_game=1&eng=MinimalChess%200.4.1%2064-bit#MinimalChess_0_4_1_64-bit) on the CCRL.
5297

53-
98+
### Version 0.3
5499
```
55100
Version: 0.3
56101
Size: 641 LOC
@@ -60,49 +105,14 @@ Strength: 1575 ELO
60105
With these changes MinimalChess gains about 500 ELO in playing strength over the previous version and achieved [1571 ELO](http://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?match_length=30&each_game=1&print=Details&each_game=1&eng=MinimalChess%200.3%2064-bit#MinimalChess_0_3_64-bit) on the CCRL.
61106
This version also introduces a rather unique feature: Sets of PSTs are defined in separate files and can be selected via an UCI option. This allows the user to tweak the values or write their own tables from scratch and by this alter the playstyle of the engine considerably. No programming experience required!
62107

108+
### Version 0.2
63109
```
64110
Version: 0.2
65111
Size: 502 LOC
66112
Strength: 1059 ELO
67113
```
68114
[__Version 0.2__](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.2) uses Iterative Deepening search with Alpha-Beta pruning. It collects the Principal Variation (PV) and when available plays PV moves first. Other than that there's no move ordering. Positions are evaluated by counting material only. This lack of sophistication causes it to play rather weak at [1059 ELO](http://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?print=Details&each_game=1&eng=MinimalChess%200.2%2064-bit#MinimalChess_0_2_64-bit) on the CCRL. I tried to the write code to be as simple as possible to both understand and explain. It could be smaller or faster but I doubt it could be much simpler than this version.
69115

70-
## Compiling the engine
71-
72-
This repository contains 3 projects:
73-
1. **MinimalChessBoard** is a command-line based GUI
74-
1. **MinimalChessEngine** is a [UCI](https://en.wikipedia.org/wiki/Universal_Chess_Interface) compatible chess engine
75-
1. ***MinimalChess*** is a library with shared chess logic and algorithms used by the other two applications
76-
77-
### Windows
78-
79-
To compile MinimalChess on Windows I suggest you install Visual Studio and open **MinimalChessEngine.sln** in it.
80-
You will need to have the [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet/3.1) installed.
81-
Hit the play button and it should compile and start!
82-
83-
### Linux
84-
85-
Read the official instructions on how to [Install .NET on Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux).
86-
There are also [Ubuntu Linux specific installations instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu).
87-
88-
You can clone the repository and compile it like this:
89-
90-
```
91-
$ wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
92-
$ sudo dpkg -i packages-microsoft-prod.deb
93-
94-
# Here I go for 3.1 core version explicitly, not 5.0 to verify compatibility with 3.1
95-
$ sudo apt-get update; \
96-
sudo apt-get install -y apt-transport-https && \
97-
sudo apt-get update && \
98-
sudo apt-get install -y dotnet-sdk-3.1
99-
100-
$ git clone https://github.com/lithander/MinimalChessEngine.git
101-
$ cd MinimalChessEngine/
102-
103-
$ dotnet build -c Release
104-
```
105-
106116
## Chess Programming Tutorial
107117

108118
I have documented important milestones of the development in a series of [Youtube](https://www.youtube.com/playlist?list=PL6vJSkTaZuBtTokp8-gnTsP39GCaRS3du) videos.
@@ -124,7 +134,6 @@ Command | Description
124134
[fenstring] | Setup the board to represent the given position.
125135
! [depth] | The computer plays the next move, searched with the given depth.
126136
? [depth] | List all available moves
127-
?? | Print the resulting board for each available move
128137
reset | Reset the board to the start position.
129138
perft [depth] | Compute perft values of the given depth
130139
divide [depth] | Compute perft values of all available moves

0 commit comments

Comments
 (0)