Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old May 2nd 04, 10:15 AM
pd42
 
Posts: n/a
Default Chess program testing

Hi,

I have written a very small chess program in Visual Basic (using Excel
as interface). It's only a couple of hundred lines of VB code. Don't
start laughing now, this was only to get aquainted with the most
important principles of chess programming (data structures,
evaluation, tree search and move generation). This Excel program
actually plays decent chess, using alpha-beta pruning and iterative
deepening, that's it (no quiscence search, no hash tables, no opening
books, a very simple evaluation function and vector representation of
the chess board). It's rating is probably somewhere around 1000 or so
(due to the computation speed and other VB limitations I can't go
deeper than 5 plies without crashing :-(

Now I want to start using Visual C++ (I'm new to C, C++, but not to
programming), and my quesiotn is: as soon as this program starts
playing chess I would like to test it against other human players, is
there a possibility to do that, how?

Another related question: any idea of the relation between rating and
depth of search? In other words: if a program has strength X, how much
will this improve by searching one ply deeper?

Thanks (please post, I don't read my e-mail).
  #2   Report Post  
Old May 2nd 04, 05:37 PM
Juha Kettunen
 
Posts: n/a
Default Chess program testing


"pd42" wrote in message
m...
Hi,

I have written a very small chess program in Visual Basic (using Excel
as interface). It's only a couple of hundred lines of VB code. Don't
start laughing now, this was only to get aquainted with the most
important principles of chess programming (data structures,
evaluation, tree search and move generation). This Excel program
actually plays decent chess, using alpha-beta pruning and iterative
deepening, that's it (no quiscence search, no hash tables, no opening
books, a very simple evaluation function and vector representation of
the chess board). It's rating is probably somewhere around 1000 or so
(due to the computation speed and other VB limitations I can't go
deeper than 5 plies without crashing :-(

Now I want to start using Visual C++ (I'm new to C, C++, but not to


Visual C++ is very good, but takes time to get used to it. When you know how
it works, it is very good.

programming), and my quesiotn is: as soon as this program starts
playing chess I would like to test it against other human players, is
there a possibility to do that, how?

Another related question: any idea of the relation between rating and
depth of search? In other words: if a program has strength X, how much
will this improve by searching one ply deeper?

Thanks (please post, I don't read my e-mail).



  #3   Report Post  
Old May 2nd 04, 06:18 PM
Noah Roberts
 
Posts: n/a
Default Chess program testing

pd42 wrote:
Hi,

I have written a very small chess program in Visual Basic (using Excel
as interface). It's only a couple of hundred lines of VB code. Don't
start laughing now, this was only to get aquainted with the most
important principles of chess programming (data structures,
evaluation, tree search and move generation). This Excel program
actually plays decent chess, using alpha-beta pruning and iterative
deepening, that's it (no quiscence search, no hash tables, no opening
books, a very simple evaluation function and vector representation of
the chess board).


I could be wrong, but I don't believe iterative deepening actually works
unless there is a transposition table to record results of previous
iterations. Iterative deepening is meant to increase the likelihood of
perfect move ordering for the search by filling the TTable with good
moves. Unless you are recording results somehow, and the ttable is the
most direct method, you are simply wasting time.

It's rating is probably somewhere around 1000 or so
(due to the computation speed and other VB limitations I can't go
deeper than 5 plies without crashing :-(


Yes, VB is not a very good language.

Now I want to start using Visual C++ (I'm new to C, C++, but not to
programming), and my quesiotn is: as soon as this program starts
playing chess I would like to test it against other human players, is
there a possibility to do that, how?


First, make sure to follow the xboard protocol. Second use the Zippy(?)
program to connect to FICS with a computer account. Then wait for the
results. You might also have options with the UCI protocol, but I am
not familiar with them.

Another related question: any idea of the relation between rating and
depth of search? In other words: if a program has strength X, how much
will this improve by searching one ply deeper?


So far, one ply of depth has surpassed any strength gained in knowledge.
At least this was the result of one engine - Hitech(?).

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush

  #4   Report Post  
Old May 3rd 04, 02:17 AM
SnowDog
 
Posts: n/a
Default Chess program testing

"Noah Roberts" wrote in message
...

Yes, VB is not a very good language.



VB is a great language, just not good for programming chess engines.

--
"Let thy speech be better than silence, or be silent."
- Dionysius the Elder


  #5   Report Post  
Old May 3rd 04, 03:18 AM
Noah Roberts
 
Posts: n/a
Default Chess program testing

SnowDog wrote:
"Noah Roberts" wrote in message
...


Yes, VB is not a very good language.




Let me fix this...

VB is a great language, just not good for programming.


There, your statement has been edited for factual content :P

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush



  #6   Report Post  
Old May 3rd 04, 07:30 AM
pd42
 
Posts: n/a
Default Chess program testing

Noah Roberts wrote in message ...
pd42 wrote:
Hi,

I have written a very small chess program in Visual Basic (using Excel
as interface). It's only a couple of hundred lines of VB code. Don't
start laughing now, this was only to get aquainted with the most
important principles of chess programming (data structures,
evaluation, tree search and move generation). This Excel program
actually plays decent chess, using alpha-beta pruning and iterative
deepening, that's it (no quiscence search, no hash tables, no opening
books, a very simple evaluation function and vector representation of
the chess board).


I could be wrong, but I don't believe iterative deepening actually works
unless there is a transposition table to record results of previous
iterations. Iterative deepening is meant to increase the likelihood of
perfect move ordering for the search by filling the TTable with good
moves. Unless you are recording results somehow, and the ttable is the
most direct method, you are simply wasting time.


I am recording the best line (PV) from the previous iteration, that's
it. No transposition table involved. There is some speed up, but I
fully agree this can be improved with transposition tables....

It's rating is probably somewhere around 1000 or so
(due to the computation speed and other VB limitations I can't go
deeper than 5 plies without crashing :-(


Yes, VB is not a very good language.

Now I want to start using Visual C++ (I'm new to C, C++, but not to
programming), and my quesiotn is: as soon as this program starts
playing chess I would like to test it against other human players, is
there a possibility to do that, how?


First, make sure to follow the xboard protocol. Second use the Zippy(?)
program to connect to FICS with a computer account. Then wait for the
results. You might also have options with the UCI protocol, but I am
not familiar with them.

Another related question: any idea of the relation between rating and
depth of search? In other words: if a program has strength X, how much
will this improve by searching one ply deeper?


So far, one ply of depth has surpassed any strength gained in knowledge.
At least this was the result of one engine - Hitech(?).

  #7   Report Post  
Old May 3rd 04, 08:00 AM
pd42
 
Posts: n/a
Default Chess program testing

Noah Roberts wrote in message ...
pd42 wrote:
Hi,

I have written a very small chess program in Visual Basic (using Excel
as interface). It's only a couple of hundred lines of VB code. Don't
start laughing now, this was only to get aquainted with the most
important principles of chess programming (data structures,
evaluation, tree search and move generation). This Excel program
actually plays decent chess, using alpha-beta pruning and iterative
deepening, that's it (no quiscence search, no hash tables, no opening
books, a very simple evaluation function and vector representation of
the chess board).


I could be wrong, but I don't believe iterative deepening actually works
unless there is a transposition table to record results of previous
iterations. Iterative deepening is meant to increase the likelihood of
perfect move ordering for the search by filling the TTable with good
moves. Unless you are recording results somehow, and the ttable is the
most direct method, you are simply wasting time.

It's rating is probably somewhere around 1000 or so
(due to the computation speed and other VB limitations I can't go
deeper than 5 plies without crashing :-(


Yes, VB is not a very good language.

Now I want to start using Visual C++ (I'm new to C, C++, but not to
programming), and my quesiotn is: as soon as this program starts
playing chess I would like to test it against other human players, is
there a possibility to do that, how?


First, make sure to follow the xboard protocol. Second use the Zippy(?)
program to connect to FICS with a computer account. Then wait for the
results. You might also have options with the UCI protocol, but I am
not familiar with them.

Another related question: any idea of the relation between rating and
depth of search? In other words: if a program has strength X, how much
will this improve by searching one ply deeper?


So far, one ply of depth has surpassed any strength gained in knowledge.
At least this was the result of one engine - Hitech(?).


That is what I would have guessed! My program philosophy is as
follows:
1) The evaluation function should be kept as simple as possible
(=fast), strictly evaluating the STATIC properties of a position (=
mainly material balance).
2) The DYNAMIC properties of a position are being taken care of by the
tree search.
3) To compensate for a limited search depth, two or three positional
properties could be included in the evaluation function (like pawn
structure and king safety, optionally: location of rooks, knights,
....).
4) If 'king safety' is 'properly defined', this strategy can also work
in endgames.
  #8   Report Post  
Old May 3rd 04, 11:50 AM
David Richerby
 
Posts: n/a
Default Chess program testing

pd42 wrote:
My program philosophy is as follows:
1) The evaluation function should be kept as simple as possible
(=fast), strictly evaluating the STATIC properties of a position (=
mainly material balance).
2) The DYNAMIC properties of a position are being taken care of by the
tree search.


The problem is that tree search is horribly slow. Making your program
twice as fast will get you an extra ply if you're lucky so even the
simplest possible evaluation function won't get you a significantly
deeper search and the dynamic aspects *won't* be taken care of. This
is why the top engines have very compicated evaluation functions.


Dave.

--
David Richerby Confusing Miniature Radio (TM): it's
www.chiark.greenend.org.uk/~davidr/ like a radio but you can hold in it
your hand and you can't understand it!
  #9   Report Post  
Old May 3rd 04, 03:00 PM
Simon Krahnke
 
Posts: n/a
Default Chess program testing

* Noah Roberts (19:18) schrieb:

I could be wrong, but I don't believe iterative deepening actually works
unless there is a transposition table to record results of previous
iterations. Iterative deepening is meant to increase the likelihood of
perfect move ordering for the search by filling the TTable with good
moves. Unless you are recording results somehow, and the ttable is the
most direct method, you are simply wasting time.


Actually the asymptotic complexity of iterative deepeing is the same as
of fixed depth, it's b^d, b being the branching factor and d being the
final/fixed depth.

That's because the non-final depth calculations are far less expensive.

I did it the same way, when i started my own lame engine: I started with
fixed depth and then went to iterative deepening. There was no slowdown
at all.

At least iterative deeping gives you informationon how deep to search,
with fixed depth you have to guess in advance.

mfg, simon .... l
  #10   Report Post  
Old May 3rd 04, 03:08 PM
Dr. David Kirkby
 
Posts: n/a
Default Chess program testing

(pd42) wrote in message om...
Hi,

I have written a very small chess program in Visual Basic (using Excel
as interface). It's only a couple of hundred lines of VB code.


snip

Now I want to start using Visual C++ (I'm new to C, C++, but not to
programming)


Assuming you don't want to put a GUI on it (why waste time when they
exist), would it not be better to write it in standard C++ (if such a
thing exists), rather than a Microsoft version of it ?? Personally I
think standard C is better , as its much more portable than C++, but I
guess I'm showing my age in prefering C.

By getting away from Microsoft specific code, and writing portable
code, you will greately increase the user base. Linux users will be
able to try it. Some of them have some very high spec machines. I
could on my quad processor Sun.

I've written an application that runs under Windoze, in addition to
Solaris, HP's HP-UX, SGI's IRIX, IBM's AIX, HP's tru64, Linux, a Cray
SuperComputer and someone even built it on a Sony Playstation 2.

http://atlc.sourceforge.net/


I also find bugs are often discovered on one platform, but not on
another. This is especially so if you want to start exploting multiple
CPUs. By writing portable code, you are more likely to iron the bugs
out more quickly. Put it on sourceforge site, and you will have access
to a wide range of hardware to test it on.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017