Author: Sven Reichard
Date: 01:03:46 06/25/02
Go up one level in this thread
On June 24, 2002 at 20:45:45, Filip Tvrzsky wrote: >Hallo Sven, >I agree with you, the first "xboard session" (WinBoard in my case ...) of one's >own chess program is very exciting expirience. Let me do one little hint, maybe >useful for you, maybe absolutely not. You wrote your program is "fully object >oriented", but how much does it mean, "fully"? I had started to write my program >also with all possibilities of object oriented programming like member functions >etc (I learned C++ just at this time). But I have noticed early that the program >runs faster when all directly connected with searching process is written only >in simple "C" manner. The gain was something about 10%, I do not remember >exactly. The reason was probably in the use of "this" pointer by objects. >Good luck in next development of your Alice! >Filip Tvrzsky Ahoi Filip, thanks for your input. I am well aware of the performance considerations, but speed is not a primary issue for me at the moment. There are three basic reasons: a) I'm not going to write the next WCC Champion anyways (I don't have the knowledge and time that, say, Meyer-Kahlen, Schroeder, or Hyatt can devote to this); b) If my effective branching factor is, say, 6-8, then 10% more speed won't buy me another ply. (Actually, now it's down to 2-3). c) If the evaluation function isn't any good, then a deeper search doesn't lead to better play. So, I prefer a design that is easy to test and to extend. Thus, "fully OO" means taking things to the extreme. For example, my board is a vector consisting of 64 pointers to pieces. Piece is an abstract class, with subclasses like Pawn, Rook, etc. (Actually, there are a couple of intermediate classes like "long range piece"). Empty squares even contain "null pieces". Every once in a while, I still look how to make the program faster. However, at this point it is more effective to improve the algorithms themselves than to avoid virtual methods. Greetings, Sven.
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.