Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Help a beginner

Author: Roberto Waldteufel

Date: 11:18:06 07/14/98

Go up one level in this thread



On July 14, 1998 at 08:53:21, frank phillips wrote:

>I have managed to write my first chess program with help from articles found on
>the Web and individuals in CCC (how to do the pv).  Its a bit clunky (a lot
>clunky) but works, which was original aim.  However it is disappointingly slow,
>managing only 4 to 5 ply (plus up to a 12 ply quiescent extension) in about
>10-30 seconds or so in the opening on my K6-233, compared to Crafty, Exachess
>and GNU that manage 8-10ply or more easily in the same position with much more
>evaluation of leaf nodes.
>
>Any hints on how to make it go deeper, faster (on the same machine) would be
>most welcome ie the big areas to tackle.  Reference to appropriate articles
>would also be welcome since I am new to programming, not just chess programming.
> The disparity in speeds is so great that it makes me think I could implement a
>technique or two to speed things up greatly (I hope) or have completely
>messed-up, which I doubt becuase it plays legal chess games (weakly) and solves
>a few WAC positions.
>
>The program does Negamax with capture extensions in the quiescent search,
>generates moves using the mailbox[] approach in Tom Kerrigan’s simple chess
>program, is based on integer arrays (not bitboard), stores moves for each node
>in a local array (of structures) in each incarnation of Negamax/Quiescent(),
>searches the pv move and captures first, does not have hash tables, does not do
>null-move, dose not do killer moves nor all the other things I have heard about
>but have no idea what they are.
>
>Frank
>
>BTW   My thanks to Tom Kerrigan for his ‘simple chess program’ without which I
>would not have even got this far.
>Bob, if you ever write that chess computer programming book...............

Hi Frank,

  My own experience in chess programming has led me to the conclusion that
bitboards really are a better way to store information, and even on 32-bit
architecture I noticed a speed-up when I first swithed to using them. I suggest
you try to generate only one move at a time, and see if it causes a cut-off
before generating any more. It is very important to genertae the moves in the
right order: captures first, with the lowest valued capturing man and the
highest valued victim first. This is quite feasible without generating all the
moves first if you use bitboards, but I don't know of any way to do this
efficiently with mailbox notation.

Hash tables are tricky to get right, but they are an absolutely essential
feature if you ever want to get the speed you are after. I think that the
addition of hasj tables and an efficient move generating mechanism are probably
the most important things for you to tackle. Don't get depressed when you put in
lots of effort and see little improvement. I found that as I tackled the big
jobs one by one, I saw little improvement for a long time, and then suddenly
things improved in a big jump. I think this is just a case of the program only
being as strong as its weakest link, and when you start out there are a lot of
weak links to fix before you get that speed.

One thing you might consider trying, but you might find rather tricky if you are
new to programming, is to write your evaluation function in assembler. It's the
most intensively used part of the program, and even small improvements in its
efficiency will pay you rich dividends.

Hope some of this is useful to you. Good luck,

Roberto



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.