No-frills chess search

I created a simple chess engine in C # over the past month and have made good progress on it. It uses a simple Alpha-Beta algorithm.

To fix Horizon-Effect, I tried implementing Quiescence Search (and failed several times before it worked). Engine power seems to have improved a bit from this, but it's awfully slow!

Previously, I could search for a depth of 6 layers in about 160 seconds (somewhere in the middle of the game), with a quiet search, the computer takes about 80 seconds to go to the search depth of 3!

The brute force counter of a node is about 20,000 nodes at a depth of 3, and the node's rest counter is up to 20 million!

Since this is my first chess engine, I really don't know if these numbers are normal, or if I made a mistake in my Quiescence-Algorithm. I would appreciate it if someone more experienced could tell me what the typical BF Nodes / Quiescent node relationship is.

Btw, just to see: (this method is called by the BF tree whenever the searchdepth value is 0)

public static int QuiescentValue(chessBoard Board, int Alpha, int Beta) { QuiescentNodes++; int MinMax = Board.WhoseMove; // 1 = maximierend, -1 = minimierend int Counter = 0; int maxCount; int tempValue = 0; int currentAlpha = Alpha; int currentBeta = Beta; int QuietWorth = chEvaluation.Evaluate(Board); if(MinMax == 1) //Max { if (QuietWorth >= currentBeta) return currentBeta; if (QuietWorth > currentAlpha) currentAlpha = QuietWorth; } else //Min { if (QuietWorth <= currentAlpha) return currentAlpha; if (QuietWorth < currentBeta) currentBeta = QuietWorth; } List<chMove> HitMoves = GetAllHitMoves(Board); maxCount = HitMoves.Count; if(maxCount == 0) return chEvaluation.Evaluate(Board); chessBoard tempBoard; while (Counter < maxCount) { tempBoard = new chessBoard(Board); tempBoard.Move(HitMoves[Counter]); tempValue = QuiescentValue(tempBoard, currentAlpha, currentBeta); if (MinMax == 1) //maximierend { if (tempValue >= currentBeta) { return currentBeta; } if (tempValue > currentAlpha) { currentAlpha = tempValue; } } else //minimierend { if (tempValue <= currentAlpha) { return currentAlpha; } if (tempValue < currentBeta) { currentBeta = tempValue; } } Counter++; } if (MinMax == 1) return currentAlpha; else return currentBeta; } 
+8
c # algorithm chess alpha-beta-pruning
source share
1 answer

I'm not a familiar with English terminology - is this a HitMove step when you delete a piece from the board?

In this case, it seems to me that you use GetAllHitMoves to get a list of β€œnoisy” moves for finding peace, which are then evaluated further than the usual 3 or 6 layers. This is called recursively, so you evaluate it again and again, as long as there are possible HitMoves leftovers. Limiting your search for peace should fix your performance problems.

Regarding the choice of the limit for finding peace - the wiki states:

Modern chess engines can search for certain movements 2 or 3 times deeper than the minimum.

+2
source share

All Articles