I added bishop pair evaluation to MadChess 2.0 Beta. The code awards a bonus for possessing two or more bishops, calibrated by game phase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const int _mgBishopPair = 25; | |
private const int _egBishopPair = 50; | |
// Evaluate bishop pair. | |
int mgBishopPair = 0; | |
int egBishopPair = 0; | |
if (_board.CurrentPosition.WhiteBishops >= 2) | |
{ | |
mgBishopPair += _mgBishopPair; | |
egBishopPair += _egBishopPair; | |
} | |
if (_board.CurrentPosition.BlackBishops >= 2) | |
{ | |
mgBishopPair -= _mgBishopPair; | |
egBishopPair -= _egBishopPair; | |
} | |
// Total static scores. | |
int middlegameScore = materialScore + mgLocationScore + mgBishopPair + mgPawns + | |
mgPieceMobility + mgKingSafety; | |
int endgameScore = materialScore + egLocationScore + egBishopPair + egPawns + | |
egPieceMobility + egMaterialTrades; | |
// Determine game phase. | |
int phaseMaterial = _pawnPhaseMaterial * | |
(_board.CurrentPosition.WhitePawns + _board.CurrentPosition.BlackPawns); | |
phaseMaterial += _minorPhaseMaterial * | |
(_board.CurrentPosition.WhiteMinorPieces + _board.CurrentPosition.BlackMinorPieces); | |
phaseMaterial += _rookPhaseMaterial * | |
(_board.CurrentPosition.WhiteRooks + _board.CurrentPosition.BlackRooks); | |
phaseMaterial += _queenPhaseMaterial * | |
(_board.CurrentPosition.WhiteQueens + _board.CurrentPosition.BlackQueens); | |
int middlegamePercent = Math.Min((100 * phaseMaterial) / _openingPhaseMaterial, 100); | |
int endgamePercent = 100 - middlegamePercent; | |
// Taper static score between middlegame and endgame. | |
int staticScore = ((middlegameScore * middlegamePercent) + (endgameScore * endgamePercent)) / 100; | |
// Negate static score if black is to move. | |
return _board.CurrentPosition.WhiteMove ? staticScore : -staticScore; |
This added 18 Elo to the playing strength of MadChess 2.0 Beta.
MadChess 2.0 2242 : 1280 (+561,=259,-460), 53.9 % vs. : games ( +, =, -), (%) : Diff, SD, CFS (%) Glass 1.6 : 80 ( 12, 12, 56), 22.5 : -219, 16, 0.0 RomiChess P3L : 80 ( 8, 12, 60), 17.5 : -215, 18, 0.0 OliThink 5.3.2 : 80 ( 7, 10, 63), 15.0 : -202, 18, 0.0 Myrddin 0.87 : 80 ( 16, 19, 45), 31.9 : -148, 17, 0.0 Sungorus 1.4 : 80 ( 28, 21, 31), 48.1 : -68, 10, 0.0 Beowulf 2.4 : 80 ( 38, 17, 25), 58.1 : +30, 14, 98.5 FireFly v2.6.0 : 80 ( 42, 14, 24), 61.3 : +31, 10, 99.9 ZCT 0.3.2450 : 80 ( 35, 13, 32), 51.9 : +36, 11, 100.0 Jazz v444 : 80 ( 30, 19, 31), 49.4 : +38, 11, 100.0 Wing 2.0 : 80 ( 49, 16, 15), 71.3 : +120, 11, 100.0 Brainless 1.0 : 80 ( 48, 21, 11), 73.1 : +136, 19, 100.0 BikJump v2.01 : 80 ( 45, 23, 12), 70.6 : +141, 12, 100.0 Matheus-2.3 : 80 ( 48, 14, 18), 68.8 : +159, 14, 100.0 Monarch 1.7 : 80 ( 40, 22, 18), 63.8 : +178, 11, 100.0 BigLion 2.23w : 80 ( 58, 12, 10), 80.0 : +215, 10, 100.0 Sharper 0.17 : 80 ( 57, 14, 9), 80.0 : +227, 12, 100.0
Feature | Category | Date | Rev1 | WAC2 | Elo Rating3 | Improvement |
---|---|---|---|---|---|---|
Bishop Pair | Evaluation | 2015 Apr 15 | 69 | 275 | 2242 | +18 |
Free Passed Pawns | Evaluation | 2015 Mar 10 | 59 | 270 | 2224 | +31 |
Unstoppable Pawns Draws, Material Trades |
Evaluation | 2015 Jan 31 | 52 | 270 | 2193 | +39 |
Late Move Pruning | Search | 2015 Jan 10 | 44 | 273 | 2154 | +39 |
History Heuristic Late Move Reductions |
Search | 2015 Jan 04 | 40 | 275 | 2115 | +50 |
Killer Moves | Search | 2015 Jan 03 | 38 | 275 | 2065 | +61 |
Futility Pruning | Search | 2014 Dec 29 | 37 | 256 | 2004 | +54 |
Null Move Quiescence Recaptures |
Search | 2014 Dec 28 | 34 | 242 | 1950 | +46 |
King Safety | Evaluation | 2014 Dec 24 | 32 | 225 | 1904 | +27 |
Piece Mobility | Evaluation | 2014 Dec 16 | 29 | 225 | 1877 | +64 |
Draw By Repetition Bug | Evaluation | 2014 Dec 10 | 27 | 225 | 1813 | +47 |
Passed Pawns | Evaluation | 2014 Dec 09 | 26 | 225 | 1766 | +72 |
Time Management | Search | 2014 Dec 08 | 25 | 231 | 1694 | +24 |
Delay Move Generation Aspiration Window Bug |
Search | 2014 Dec 02 | 23 | 231 | 1670 | +44 |
MVV / LVA Move Order Draw By Insufficient Material Move List Overflow Bug |
Search | 2014 Dec 01 | 22 | 235 | 1626 | +30 |
Tapered Evaluation MG and EG Piece Location |
Evaluation | 2014 Nov 29 | 21 | 234 | 1596 | +107 |
Alpha / Beta Negamax Aspiration Windows Quiescence, Hash Material, Piece Squares |
Baseline | 2014 Nov 25 | 20 | 236 | 1489 | – |
- Subversion source code revision
- Win At Chess position test, 3 seconds per position
- Bullet chess, 2 min / game + 1 sec / move