Update and improve manual page
[fairymax.git] / fairymax.pod
1 =head1 NAME
2
3 fairymax - xboard-compatible chess and chess-variant engine 'Fairy-Max'
4
5
6 =head1 SYNOPSIS
7
8 B<fairymax> [hashSize] [iniFile]
9
10 B<shamax> [hashSize] [iniFile]
11
12 B<maxqi> [hashSize] [iniFile]
13
14
15 =head1 DESCRIPTION
16
17 B<fairymax> is a program that plays chess and chess variants. 
18 It uses the xboard/winboard chess-engine protocol to communicate.
19 Apart from 'regular' chess (also known as the Mad-Queen variant),
20 it can play Capablanca chess, gothic chess, knightmate, cylinder chess, 
21 berolina chess, superchess, makruk (Thai chess, also with Cambodian rules), 
22 courier chess, Seirawan Chess, Spartan chess, falcon chess, great shatranj
23 and chess with different armies.
24 Fairy-Max can be easily configured by the user to play other variants as well,
25 by modifying the ini file.
26 This ini file describes the rules of movement
27 of the participating pieces and the initial board setup.
28
29 Fairy-Max can also play shatranj, 
30 but in this case is not aware of the shatranj rule that a bare king loses.
31 So it might play sub-optimally in the late end-game.
32 A version of Fairy-Max adapted to implement the baring rule is
33 available under the name B<shamax>.
34
35 Similarly, a version of Fairy-Max adapted to play Xiang Qi (Chinese Chess)
36 is included in the fairymax package as well, under the name B<maxqi>.
37
38 B<fairymax> is a derivative of the world's (once) smallest chess program 
39 (source-code wise), micro-Max.
40 The latter measures less that 2000 characters, (about 100 code lines),
41 and has a computer rating of around 2050 on the CCRL rating list.
42 Although this is about 1000 rating points behind the world champion,
43 micro-Max still makes a quite tough opponent even for club players,
44 although it is not unbeatable.
45
46 The main difference between micro-Max and Fairy-Max is that the latter loads
47 its move-generator tables, which specify how the various pieces move,
48 from an external file, so it can be easily adapted to incorporate un-orthodox pieces.
49 For ease of use of the artificial-intelligence, Fairy-Max is equipped with
50 I/O routines that allow it to run with the xboard graphical user interface.
51
52 See xboard(6) for instructions about how to use B<fairymax> through xboard. To
53 start up quickly, you just need the command: B<xboard -fcp fairymax>.
54 However, XBoard might not support symbols for every unorthodox piece in board sizes
55 different from B<bulky>, B<middling> and B<petite>.
56 It might thus be advisable to specify a board size as well, e.g.
57 B<xboard -fcp shamax -boardSize middling -variant shatranj> 
58 to get correct display of the elephant and general pieces in shatranj.
59 Note that to be able to play the chess variants,
60 you will need xboard 4.3.14 or later.
61
62 Some of the variants Fairy-Max plays are only partially supported by XBoard,
63 and can only be played whith the legality-testing function of the latter switched off.
64 (This applies to cylinder chess, berolina chess, great shatranj,
65 and chess with different armies.)
66 For some variants even the name is unknown to XBoard,
67 and they are all grouped under the catchall name 'fairy'.
68 Which variant is played by Fairy-Max when XBoard is set to 'fairy',
69 can be determined by a combobox control in the XBoard 'Engine Settings' menu dialog.
70
71 Fairymax supports multi-PV mode: by specifying a non-zero multi-PV margin in the
72 Engine-Settings dialog of XBoard, Fairy-Max will not only print the
73 principal variation for the best move, but also for every move that approaches
74 the score of this best move to within the set margin.
75 (If it does not find the best move on the first try, this might lead to printing
76 of a few extra lines below the threshold.)
77
78 The fmax.ini file from which Fairy-Max by default takes the piece and game definitions
79 is a self-documenting text file,
80 which contains instructions for how to define new pieces and chess variants.
81 In addition it contains an extensive list of pre-defined pieces,
82 incuding many not occurring in any of the pre-defined variants,
83 which the user can draw on to define his own variants.
84
85 Amongst the move types supported by Fairy-Max are normal leaper and slider moves,
86 (e.g. knight and rook),
87 divergent moves (i.e. capture and non-capture moves can be different),
88 hoppers (which jump over other pieces, such as the Chinese cannon or the grasshopper),
89 lame leapers (the move of which can be blocked on squares they cannot move to,
90 such as the Chinese horse and elephant),
91 and any combination thereof,
92 in every possible direction.
93 The board width is configurable upto a width of 14 squares,
94 and cylindrical boards (where left and right edge connect) are supported as well.
95
96 =head1 OPTIONS
97
98 =over 8
99
100 =item B<hashSize>
101
102 If the first argument to fairymax is numeric,
103 it is taken as an indicator for the amount of memory Fairy-Max is allowed to use
104 for its internal hash table.
105 The default value for this argument, 22, would result in a memory usage of 48MB.
106 Each next-higher number doubles the memory usage, each next-lower halves it.
107 Running with less than 6MB (i.e. argument 19) is not recommended.
108 When fairymax is running under xboard 4.3.15 the hash-table size can be set 
109 through the xboard menus,
110 making this argument superfluous.
111
112 =item B<iniFile>
113
114 A second or non-numeric first argument is taken as a filename.
115 Fairy-Max will use the mentioned file in stead of its default fmax.ini file
116 to define the movement of pieces and initial setup of the variants.
117 This makes it easier to define your own variants.
118
119 =item B<INTERACTIVE OPTIONS>
120
121 Fairy-Max also supports some options that can only be set interactively,
122 though XBoard's engine settings menu dialog.
123 These include a setting to further define -variant fairy,
124 (e.g. which armies to pit against each other in chess with different armies),
125 and whether makruk is to be played with Thai or Cambodian rules
126 (the latter requiring XBoard's legality testing to be switched off!).
127 You can also enable resigning, and set a score threshold for 
128 when Fairy-Max should do it,
129 and define the already mentioned multi-PV margin there.
130
131
132 =back
133
134 =head1 AVAILABILITY
135
136 At http://hgm.nubati.net/cgi-bin/gitweb.cgi the source code can be obtained.
137
138 =head1 SEE ALSO
139
140 xboard(6)
141
142 explanations: http://www.chessvariants.org/index/msdisplay.php?itemid=MSfairy-max
143
144 micro-Max: http://home.hccnet.nl/h.g.muller/max-src2.html
145
146 XBoard: http://hgm.nubati.net
147
148 =head1 STANDARDS
149
150 WinBoard, B<xboard>(6) interface ("Chess Engine Communication Protocol")
151
152 =head1 AUTHOR
153
154 H.G.Muller <h.g.muller@hccnet.nl>.
155
156 This manual page was generated with pod2man(1).