r/ComputerChess • • Jan 24 '20

Why do computers move fast when in check?

When analysing games it seems to me that when a player is in check the computer very quickly decides the best move to make. Am I imagining this?

If not why does this happen? Is it that there are only a few ways to get out of check. and this reduces the size of the first ply on average. But even then the next ply is still probably the same size so does that explain all the speedup? Or is there more going on

I have checked to see if this has been asked before. Apologies if I missed it.

11 Upvotes

4 comments sorted by

7

u/epanek Jan 24 '20

In check the number of moves is limited as pianowow states. From there the search tree is limited and the engine probably has a single response that prevents material loss or checkmate from there. In short, the search tree is pruned a great deal and most alternate responses lead to mate in X.

3

u/cavedave Jan 24 '20

Ah that is a good point. Even if there are 5 ways out of check 3 of them could lead to mate in a few moves and can be quickly removed

16

u/pianowow Jan 24 '20

Count the number of moves available in a typical middlegame position. Now count them when you're in check. When there are fewer options it's easier to decide which is best.

For example, If the engine your are using it's stopping its analysis at a particular depth, it plays there best move as soon as that depth had been reached. Reaching that depth is far easier when the tree of variations is trimmed by checks.

The size of the tree is dependent on every level. The first level is the most important.

2

u/tsojtsojtsoj Jan 24 '20

It depends on the specific program. My primitive chess program, for example, uses generally more time if in check except if you only have one legal move.