Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Let the king capture or generate legal moves

Author: Pallav Nawani

Date: 10:24:26 11/20/04

Go up one level in this thread


On November 20, 2004 at 08:51:46, Michel Langeveld wrote:

>I decided to investigate something:
>
>TSCPGothic NORMAL
>=================
>This program generates moves, and after a move is played, it checks if the own
>king is brought into check. If this was the case, then it undoes the move
>without searching futher, and continues with another move.
>
>TSCPGothic KINGCAP
>==================
>This program generates moves, plays them all despite legalness, and let the king
>get captured (Crafty makes this too).
>
>I hoped for a faster program with KINGCAP.
>I found out that this was not true (Note *2)
>

The way it is supposed to be done:

1. Do it only in qsearch. No point in doing it in main search, it is already
doing some heavy lifting, checking move legality there is not such a big strain.
Also, if you have a crafty like incremental move generator, you may try many
moves before finding the king capture.
Net result: you loose time.

2. After you recurse to the next ply (in qsearch), check the moves you have
generated. If one of them is a king capture, return beta or Mate score
immediately. Again, this won't work if you have an incremental move generator.
Crafty generates all the moves in one shot while in qsearch.

So, No eval is needed, and you don't check the move is illegal or not & thus you
save time. The assumption, of course, being that most of the moves are legal and
by not checking move legality immediately we may save some time.

Also, if your qsearch is heavy, that is, it has SEE + Checks in qsearch + etc
etc, then the benefit of KingCap approach will be low.

Best regards,
Pallav




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.