                    B A R O N
                    =========

                  Version 2.23

Baron is a spare-time project which was intended to have
superb end-game playing capabilities. 

My present focus is on Baron's  playing skills, the end-user 
interface  and the engine configuration possibilities.

Current mechanisms used include:
- Support for endgame tablebases (Nalimov, also 6-stone)
- Positions learning
- Transposition Hashtables
- Static Evaluation Hashtable
- Double Nullmove pruning
- History pruning
- Fractional extensions, including check, threat, single reply,
  recapture, samethreat and pawn push extensions
- Internal Iterative Deepening
- Killer and history heuristics
- Negascout with aspiration search
- Bitboards
- Opening book usage

This is the last version of the Baron 2.x. Baron 3.x will be based on a completely new redesign.

                     F I L E S
                     ---------

Files included in the distribution:

readme.txt	- This file
baron-tm.bmp	- Logo (by Thomas Mayer)
baron.bmp	- Logo (by Wilhelm Hudetz)
baron.exe	- Winboard executable, intended for yesterday's CPUs (SSE)
baronx64.exe    - Winboard executable, intended for AMD Opteron and Intel Core2
                  with a 64 bits operating system
baronSSE2.exe   - Winboard executable, intended for SSE2 hardware (Intel since P4, AMD since Opteron, Athlon64)
baronold.exe    - Winboard executable, intended for older hardware (non SSE)
baron.ini	- Sample configuration file
baron.init	- Configuration file for Chessbase
changes.txt	- A log of changes in this and previous versions
cv_baron.ini	- Configuration file for ChessVision (courtesy of Carlos Pesce)
wac.txt		- Test file with 300 positions (Win at chess)
wb2uci.eng      - WB2UCI configuration file (courtesy of Manfred Meiler)
pthreadVC2.dll	- Pthread library. This library is distributed under the
		  GNU Lesser General Public License
pthreadVC2x64.dll - 64 bits version of the above
Copying		- The GNU Lesser General Public License
english.lng     - String file. Needs to be there, but isn't actually used. An empty file would be sufficient in its place

Only baron.exe (or the executable that fits best on your computer) and pthreadVC2.dll
are required to run the Baron. Having baron.ini around is recommended and even
required for using endgame tablebases and specifying larger hash tables etc.


             C O N F I G U R A T I O N
             -------------------------
On startup, the Baron will read its configuration file from the current
directory. By default this file is called 'baron.ini' but by specifying a
parameter to the Baron on the command-line another configuration file can be
selected, e.g. 'baron no-egtb' will use the configuration file 'no-egtb.ini'.

This file may contain a number of commands:

hash <level>
        Sets the maximum size of the transposition hash tables in kilobytes.
        The actual size of the hashtable may be smaller as it can only be set
	in steps.

shash <level>
        Sets the maximum size of the static evaluation hash tables in kilobytes.
        The actual size of the hashtable may be smaller as it can only be set
	in steps.

tbpath <path>
        Sets the path for the Nalimov endgame tablebases to <path>.

cache <size>
	Sets the size of the Nalimov endgame tablebases to <size> kilobytes

resign <resignscore>
        Sets the score threshold for resigning. The score should be below the
        resignscore for 4 times in a row. Then the Baron resigns.
        Only negative scores are accepted. 0 or positive scores will turn off
        resigning. Default is -900.

log <on/off>
        Turns logging on or off. Default is on.

logmode <append/overwrite>
        Add information to the existing log file or overwrite it. Default
        is overwrite

bookfile <path\filename>
	Specifies the bookfiles to use. Note, the last part (W.obp and B.obp)
        should be left off. The default name is 'baron'. The opening book that
        is used by the Baron is divided over two files: One book contains the 
        moves for white, and one that contains the moves for black.

learning <level>
        Sets the learning behaviour:
        0: no learning
        1: only uses previously learned positions
        2: learns, but does not use learned positions
        3: learns, and uses learned positions
	7: learns, but adjusts the score with the result of the game (only recommended for match play)

learnfile <path\filename>
	Specifies the learnfiles to use. Note, the last part (.wlp and .blp)
        should be left off. The default name is the same as the name of the
        program (without .exe).

addlrnfile <path\filename>
        Specifies an additional learnfile to import. Note, the last part
        (.wlp and .blp) should be left off.

useotime <percentage>
	Use opponent time. If the opponent used more time, use more time as well
	to prevent getting into lost positions early in the game. Percentage of the default.
        Set to 0 when operating the Baron manually as the clocks in the GUI will not represent
	the real amount of time left.

end     Marks the end of the configuration file.

The following parameters should only be set by experienced users:

knightvalue <percentage>
bishopvalue <percentage>
rookvalue <percentage>
queenvalue <percentage>
	Changes the piece value used. 100% means that the default values are used. 
	110 means that the value is increase by 10%.

kingsafety <percentage>
	Percentage of the kingsafety scores in evaluation.
	Can be > 100% but not lower than 0%

pawnshield <percentage>
	Percentage of the pawnshield scores in evaluation.
	Can be > 100% but not lower than 0%

weakpawns <percentage>
	Percentage of the weak pawn scoring in evaluation
	Can be > 100& but not lower than 0%

extensions <percentage>
	Percentage of the extensions to be done

extensionlimit <ply>
	Number of plies the search will extend unrestricted

recaptureext <percentage>
	Percentage of the default number of plies to extend on a recapture

recapturedepth <ply>
	Number of plies (from the root node) where recapture extensions are done

scoutthreshold 5
	Minimum window size for a PVS scout to be performed

iidmindepth <ply>
        The minimal remaining depth where Internal Iterative Deepening is used

etcmindepth <ply>
        The minimal remaining depth where Enhanced Transposition Cutoffs based
        moveordering is tried

lmrmoves <nr>
	The number of moves considered without reducing using LMR.
	LMR is turned off by specifying 0. Typical value could be 2 or 3

lmrmargin <nr>
	A positional margin to reduce positional penalties of LMR. The higher, the less will be reduced

lmrpv <on/off>
	Whether reductions in PV nodes should be attempted. Recommended off.

tbdepth <ply>
	The minimal remining depth where EGTB probes will be tried

scoutthreshold <number>
        The minimumsize of the window for which a scout will be performed before
        a search with the full window is done

easymove <Score>
	Minimal Easymove score. Move faster when one move is clearly better than others
	Specified in amount of centipawns that it has to be better. 0=off

acceptoldlrn <on/off>
        Specifies whether the version of learning files should be checked.
        When off (default) old learning files are not imported. This option
        only works for learnfiles that are specified after this option in the .ini
        file.
        NOTE: This should be used with care are playing strength may degrade
        ----  when used.
              
blitzbase <nrmoves>
        Set whether the engine saves time for a long game when using blitz
        time controls. Sets the minimum amount of moves that are expected.
        Used for deciding how much time is spent on the next move

blitzmin <nrmoves>
        Set the average game length for blitz games
        Used for deciding how much time is spent on the next move.

                   C O M M A N D S
                   ---------------
The following commands can be given to Baron on the console:

bench <level>
	runs the built-in benchmark. 
        8 positions are searched on a standard searchdepth and
        the total searchtime and nodes per second are reported.
        level=0 is the shortest bench and takes about 30 seconds 
        on an AMD K6-2 500Mhz. A higher level adds a number of
        plies to the standard depth search.

black
	sets black to move in the current position

bye
	exits the program

d
	displays the board

easy
	disables pondering

force
	computer stops playing

fritz
	switches to Xboard mode with Fritz/Chessbase extensions

go
	computer plays for the side to move

hard
	enables pondering

hash <size>
	sets the maximum transposition hashtable size 
        in kilobytes
        Not all sizes are possible as the number of
        hashtable entries has to be a power of 2. The
        actual size will be the largest possible that
        is smaller than the size mentioned
	The minimum hashtable size is 256 kilobytes.

hint
	shows a hint

learn <ply>
        Does a repeating shootout of the current position (max 10 moves)
        to build learning data. Learning stops when no new positions were
        added in the last iteration

level <moves> <time> <inc>
	sets time controls

new
	starts a new game

nopost
	disables printing the principal variations

off
	computer stops playing

on
	computer plays for the side to move

otim
	human players time control (not supported)

post
	shows the principal variation

quit
	exits the program

remove
	takes back a complete move

reset
	resets/empties hashtables

sd <depth>
	searches <depth> ply per move

setboard <fen>
	sets the position

shash <level>
	sets the maximum evaluation hashtable size in kilobytes.
        Not all sizes are possible as the number of
        hashtable entries has to be a power of 2. The
        actual size will be the largest possible that
        is smaller than the size mentioned
        The size of the hashtable doubles with each higer level

st <time>
	searches for <time> seconds per move

test <time> <filename>
	executes a testsuite. As an example the Win At Chess suite is included
        in the distribution

time <centiseconds>
	sets the clock

undo
	takes back a move

white
	sets white to move in the current position

xboard
	switches to XBoard mode

Moves can be entered in coordinate notation only, e.g., e2e4, e7e8Q

         W I N B O A R D   P R O T O C O L   S U P P O R T
         -------------------------------------------------
The Baron supports all commands of the winboard protocol version 1 and 2.

                  C H E S S B A S E   S U P P O R T
                  ---------------------------------
The Chessbase Winboard implementation is based on winboard protocol version 1. 
All Chessbase extensions have been implemented.

The use of the native Baron book is not possible when using a Chessbase GUI with the
winboard adapter. Choose a book from the Chessbase interface instead. The Baron book
is not available in the Chessbase format.

Recent versions of Chessbase GUI's can use UCI engines. The WB2UCI adapter of
Odd Gunnar Malin can be used to connect the Baron. A sample configuration file is
included in this distribution. The Baron can use it's own book in this case. 

                 A C K N O W L E D G E M E N T S
                 -------------------------------
I used  ideas already implemented in other chess programs when writing my own chess 
engine. The starting point was one of the smallest chess programs around: Tom's Simple 
Chess Program version 1.73.
I would like to thank Tom Kerrigan for making the source of the program available.
Although all of Tom's original code has gone now, it gave me the opportunity
to quickly build a working program.

Colin Frayn and Dann Corbit have the ideal strong chess-playing program with 
easily undestood source code in their Beowulf project. I must say I got some very useful 
ideas from their program, especially concerning bitboards. I very much appreciate their 
effort.

I've been using Robert Hyatt's program Crafty for a long time for chess analysis 
and I've been impressed with the richness of the features and playing strength. The 
format of the testsuites is the same as the one in Crafty. I expect to look at his 
solution for some other problems I'm encountering.

Eugene Nalimov and Andrew Kadatch set a new standard for endgame tablebases. I'm very
happy that they allow the chess community to use their work. Many thanks.

Carlos Pesce has been helping with the decisions on how to implement the opening book. 
He also provided the opening book that can be obtained from the website of the Baron.

Thomas Mayer and Wilhelm Hudetz designed the baron logo's included in this distribution.

Manfred Meiler supplied the WB2UCI configuration file in this distribution.

Harry Schnapp, Roger Brown, Slobodan Stojanovic, Heinz van Kempen, Lars Hällerström
Günther Simon and Leo Dijksman were very helpful in testing the beta versions and
helping me to determine which ideas were useful and which weren't.

Authors of other engines often provide helpful tips:
Vincent Diepeveen, Tony van Roon-Werten, Dieter Buerssner, Thomas Mayer, Tord Romstad

Finally I would thank everybody that gave the Baron a warm welcome, and contributed by
giving their remarks and bug reports either by email or in the (computer) chess fora.

Richard Pijl
Hoogstraten-Minderhout (Belgium), July 2008
