Clarify license
[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 shuffle chess without castling 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 limited-range sliders (upto range 5),
92 and any combination thereof,
93 in every possible direction.
94 The board width is configurable upto a width of 14 squares,
95 and cylindrical boards (where left and right edge connect) are supported as well.
96
97 =head1 OPTIONS
98
99 =over 8
100
101 =item B<hashSize>
102
103 If the first argument to fairymax is numeric,
104 it is taken as an indicator for the amount of memory Fairy-Max is allowed to use
105 for its internal hash table.
106 The default value for this argument, 22, would result in a memory usage of 48MB.
107 Each next-higher number doubles the memory usage, each next-lower halves it.
108 Running with less than 6MB (i.e. argument 19) is not recommended.
109 When fairymax is running under xboard 4.3.15 the hash-table size can be set 
110 through the xboard menus,
111 making this argument superfluous.
112
113 =item B<iniFile>
114
115 A second or non-numeric first argument is taken as a filename.
116 Fairy-Max will use the mentioned file in stead of its default fmax.ini file
117 to define the movement of pieces and initial setup of the variants.
118 This makes it easier to define your own variants.
119
120 =item B<INTERACTIVE OPTIONS>
121
122 Fairy-Max also supports some options that can only be set interactively,
123 though XBoard's engine settings menu dialog.
124 These include a setting to further define -variant fairy,
125 (e.g. which armies to pit against each other in chess with different armies),
126 and whether makruk is to be played with Thai or Cambodian rules
127 (the latter requiring XBoard's legality testing to be switched off!).
128 You can also enable resigning, and set a score threshold for 
129 when Fairy-Max should do it,
130 and define the already mentioned multi-PV margin there.
131
132
133 =back
134
135 =head1 AVAILABILITY
136
137 At http://hgm.nubati.net/cgi-bin/gitweb.cgi the source code can be obtained.
138
139 =head1 SEE ALSO
140
141 xboard(6)
142
143 explanations: http://www.chessvariants.org/index/msdisplay.php?itemid=MSfairy-max
144
145 micro-Max: http://home.hccnet.nl/h.g.muller/max-src2.html
146
147 XBoard: http://hgm.nubati.net
148
149 =head1 STANDARDS
150
151 WinBoard, B<xboard>(6) interface ("Chess Engine Communication Protocol")
152
153 =head1 AUTHOR
154
155 H.G.Muller <h.g.muller@hccnet.nl>.
156
157 This manual page was generated with pod2man(1).