Skip to main content
13 votes

Is it normal for a chess engine to blunder material if its evaluation is only based on naive material evaluation?

This exact bot has already been created. On lichess, it is simpleEval. You could potentially use it to debug a lot of your issues by seeing what this engine does against you in a given position. ...
NoseKnowsAll's user avatar
  • 5,838
7 votes
Accepted

Is it normal for a chess engine to blunder material if its evaluation is only based on naive material evaluation?

It's always a question at what depth you stop. Eg.g, with 5 plys, your engine might be happy with ... Nxf2 one pawn ahead Bxf2 Bxf2 still one pawn ahead Kxf2 Qxf3+ still one pawn ahead and even ...
Hagen von Eitzen's user avatar
6 votes

How can minimax chess engines do alpha-beta pruning without reaching the final positions?

You are confusing several concepts. Alpha-beta pruning Alpha-beta pruning is not "where they don't calculate positions that are obviously winning or obviously losing." It's pruning branches where ...
RemcoGerlich's user avatar
  • 28.4k
6 votes
Accepted

My Transposition Tables implementation slows down Alpha Beta Pruning

Your current implementation just stores on which positions quiesce search was ran. If it was run before, then it skips the position. But you don't want to skip searching all positions you searched ...
random_and_unknown's user avatar
5 votes

Why is my chess engine that uses minimax with alpha-beta pruning so slow, even at depth 3?

I don't have time to read your code in detail, but the main thing that sticks out to me is the following line: Piece[,] newBoard = (Piece[,])board.Clone(); newBoard = move(newBoard, .... blablabla So ...
Noah Caplinger's user avatar
4 votes

Chess Position Trainer on Linux or Minimax on Linux

I have not tried it, but you might be able to install Chess Position Trainer under Linux using WINE. I haven't looked at WINE in a long time, but it's apparently a lot better than it was ~10 years ...
patbarron's user avatar
  • 3,694
4 votes

Chess Position Trainer on Linux or Minimax on Linux

Sorry, no. Chess Position Trainer only runs on Windows 7, 8, and 10. See the system requirements here. You could consider a virtual machine running Windows on a Linux host, but it will not run ...
PhishMaster's user avatar
  • 32.7k
3 votes
Accepted

How can I increase the search ply depth of my minimax function for my chess engine?

Build a cache. You're exposing yourself to endless transposition. Please don't shuffle your moves. I don't have the numbers but I doubt randomly shuffle all your lists can be quick. It's O(n). I fail ...
SmallChess's user avatar
  • 22.6k
3 votes
Accepted

How can minimax chess engines do alpha-beta pruning without reaching the final positions?

If a chess engine isn't aware of the mate, then it will be happy to play the moves as Black. By the time it sees the checkmate, it'd be too late. Game over. 1-0. Fortunately, your scenario is quite ...
SmallChess's user avatar
  • 22.6k
3 votes
Accepted

Minimax algorithm - Play with Black pieces?

There are two simple adjustments that need to be made for this to work properly with the computer playing the white pieces. I'm not totally familiar with the interfaces you're using so bear with me. ...
Rhys's user avatar
  • 146
3 votes
Accepted

Minimax check(mate) detection

Your approach is correct. Stockfish does it as well. https://github.com/official-stockfish/Stockfish/blob/master/src/search.cpp if (rootMoves.empty()) { rootMoves.emplace_back(MOVE_NONE); ...
SmallChess's user avatar
  • 22.6k
3 votes

Minimax with alpha-beta pruning for chess

In alpha/beta pruning, you only prune when further search cannot affect the outcome. In particular this means there will be no loss of information when you transition from MinMax to alpha/beta. There ...
Noah Caplinger's user avatar
2 votes
Accepted

Minimax with alpha-beta pruning for chess

No. You have to go to the end of that branch to decide if it is bad. pruning is done to help make the problem computationally feasible. But there are risks that you might have eliminated a better ...
yobamamama's user avatar
  • 2,285
2 votes

Speed of minimax with alpha beta pruning in chess engines

There're some problems with your question: Alpha-beta pruning doesn't make you search faster, it makes you search further. For illustration (these numbers are not accurate) if your computer is ...
Allure's user avatar
  • 28.3k
2 votes

How can I increase the search ply depth of my minimax function for my chess engine?

I need to get two things out of the way: If your are concerned about performance, Python is not for you. The language just isn't built for this kind of thing. That said, I do think it can be useful ...
Noah Caplinger's user avatar
2 votes

How to avoid the same opening move in an engine built using Python chess

This lack of opening diversity problem affects even the strongest engines, so don't worry about it. Still, there are things you can do: Add some small random factor to your eval, such that most ...
Allure's user avatar
  • 28.3k
1 vote
Accepted

How to implement Zobrist tables?

I will try to answer some of the questions. Is the question how large your hash table should be? I think the simple answer is, make it as big as you can on your system. If you have 16 GB of RAM you ...
koedem's user avatar
  • 3,646
1 vote
Accepted

Can someone spot the issue with my search + evaluation?

The primary issue you have is with the evaluation function. For a standard minimax implementation, it is supposed to be implemented such that the result is an absolute evaluation. I.e. a positive ...
Nelson O's user avatar
  • 780
1 vote

How do I implement UCI in my Python chess engine?

I once posted a simple code example on Stack Overflow. This may help. There they also mention the python-chess package, but that does not support the full set of UCI commands.
Nils Lindemann's user avatar
1 vote

Why is futility pruning causing an Elo drop in my engine?

As I see if you don't do any depth checking. Also if I am reading your code correctly, you do not check to see if the move is a capture. I could be wrong as you might already be checking this. But, ...
Valsmikor's user avatar
1 vote

How can minimax chess engines do alpha-beta pruning without reaching the final positions?

Not an answer but an example of the question: [FEN ""] [Event "?"] [Site "Bled"] [Date "1961"] [Round "?"] [White "T. Petrosian"] [black "L. Pachman"] [startply "40"] 1. Nf3 c5 2. g3 Nc6 3. Bg2 g6 4....
Fred Knight's user avatar
  • 3,142
1 vote

Minimax and alpha beta

Yes, you'll have to search all moves in minimax as it's a framework for determining the evaluation score. In alpha-beta, you might skip some moves by pruning.
SmallChess's user avatar
  • 22.6k
1 vote
Accepted

Minimax and alpha beta

Let's say you wanted your engine to calculate 10 moves ahead. To do this, you must look at each different combination of 10 moves from the current position, and evaluate each of the final positions ...
Inertial Ignorance's user avatar
1 vote

Minimax and alpha beta

Short answer: Yes with minimax you have to search every move. Minimax is not used due to the exponentially growing search which quickly becomes too big to be useful. Think O(n2) sort functions. ...
Fred Knight's user avatar
  • 3,142

Only top scored, non community-wiki answers of a minimum length are eligible