Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: TSCP and piece square tables. (kinda long, multiple questions)

Author: Ross Boyd

Date: 01:35:11 01/23/06

Go up one level in this thread


On January 23, 2006 at 00:42:19, Joshua Shriver wrote:

>Part 1.
>
>I've decided to start my engine from scratch after a couple years leading
>nowhere with little to no advancement, chess burnout, and trying to bite off
>more than I could chew.
>
>In reviewing the code for tscp, I was wondering what are the piece/square tables
>in the eval.c file?
>
>The way I interpret the comments, it adjusts the value of a piece given it's
>location on the board. If this is so, then I dont see how it can be useful since
>the value of a piece (or strength perhaps) would be determined by all other
>pieces on the board and location. Example if the pawn is about to take the
>queen, it would have more strength even if it is in a square that this table
>claims is weak.
>
>I might be totally off.

You're right. The piece/square tables assign a set value to a piece on a given
square.

And you're right about its weakness. It can be totally inappropriate to the
positions occurring on the board. But, its strength is its fast and easy to
implement. Fruit uses psq tables and yet its one of the strongest engines in the
world.

The thing to keep in mind is that there are many other evaluation features that
are taken into account when assigning the board some arbitrary positional value.
So you can think of psq values as being just one of the layers.

As far as your example goes, most engines rely on their search to detect such
things as hanging queens etc.


>
>Part 2.
>
>I've had some fun ideas that I've been wanting to implement over the years but
>could never translate that to code. My major roadblock has been in basic
>components such as a move generator. I've read probably every link that's been
>posted concerning the various board types (0x88, bitboard, etc), algorithms
>(alpha-beta cuttoffs, qsearch, etc) ... however in short of reviewing the code
>for tscp, crafty, fruit there seems to be little to no info of how to implement
>key features given x,y,z. Each piece seems to be effected by prior parts (move
>generator for a bitboard is diff than one for 0x88).
>
>
>On a humble note, guess I'm just not a good programmer. I've tried looking at
>the source for various engines but have no  idea what's going on. TSCP seems
>somewhat digestable but finding the flow of it still seems a little rough, let
>alone trying to digest fruit or crafty (no disrespect to their authors it's my
>inabilities to understand).

Its easy to be discouraged by the complexity of chess programming... but don't
be. Be patient with yourself - and believe that you _will_ eventually comprehend
and understand the stuff you don't already know.

I learned programming so I could write an engine. Then programming became my
career and yet still after many years as a programmer some concepts still
baffled me.

After writing a few move generators and playing around with tic tac toe (so I
could learn how minimax and alpha beta pruning worked) I took tscp and rewrote
it with a faster move generator, added hash tables, null move and more eval
terms and my first serious engine was born... TRACE.

Tscp is a good place to start. For example, The Baron is another engine that
began life as tscp, and The Baron is quite strong now.

Try not to get caught up in minor code optimisations - instead concentrate on
improving the algorithms.


>
>Any advice or commentary is appreciated. This is a wonderful hobby and
>community. I look forward to having something that really plays even if weak.

That's the way... be happy with just having something that works under Fritz or
Winboard... then see how many Win At Chess positions it solves in 15 seconds. As
you improve notice how it solves more and more till it solves perhaps 290+.

Eventually you will have to rely on games to gauge progress because test suites
just aren't a good way to tune an engine. They're good mainly for debugging the
search and finding positions the engine doesn't evaluate correctly.

Cheers and good luck,

Ross




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.