Add tournament-manager description to 4.6.0 pages
[xboard.git] / whats_new / 4.6.0 / TM.html
1 <!--#include virtual="/server/html5-header.html" -->
2 <title>XBoard - Tournament manager</title>
3 <!--#include virtual="/server/banner.html" -->
4 <!--#set var="article_name" value="/server/standards/boilerplate" -->
5 <!--#include virtual="/server/gnun/initial-translations-list.html" -->
6
7 <h2>XBoard tourney-manager function</h2>
8 <p>
9 XBoard now has a built-in tournament manager,
10 that can be used to make it play engine tournaments with more than two participants.
11 To run such a tourney, XBoard will have to create a 'tournament file'.
12 This can be done through the Match Options dialog.
13 The tournament file is a special type of settings file,
14 which contains all option settings needed to specify the tournament:
15 the list of partcipating engines, the tournament type
16 (round-robin, (multi-)gauntlet or Swiss),
17 the number of games per pairing, the number of cycles, etc.
18 This information is put in a file, rather than kept in XBoard's memory, for two reasons:
19 so that you can easily resume the tournament should it get somehow interrupted,
20 and to share it between different XBoards playing games in parallel for the same tourney.
21 </p><p>
22 For the rest a tournament behaves just like XBoard -matchMode.
23 In fact it is just a special kind of match,
24 where not all games are between the same two engines that you started with,
25 but where new players can be selected before each game,
26 and the tournament file tells XBoard how to do that.
27 </p><p>
28 All the tourney parameters that are kept in the tourney file
29 can in principle also be specified from the command line, through options, 
30 but that still would not cause XBoard to run a tourney.
31 It is realy essential that XBoard has a tournament file for that,
32 because it uses the latter also for recording the progress of the tourney:
33 which games have already been played (and how they ended),
34 and which games are currently in progress.
35 With the aid of this information, XBoard will be able to resume a tourney that has been interrupted (by quitting XBoard). 
36 It only requires re-starting XBoard with the existing tournament file:
37 <pre>
38 xbooard -mm -tf MyTourney.trn
39 </pre>
40 This will make XBoard pick up where it left off.
41 XBoard is installed in such a way that the above command is automatically issued
42 whenever you double-click a tourney file.
43 </p><p>
44 This design makes it also possible to have multiple instances of XBoard work on playing the tourney games.
45 E.g. when you have a quad-core computer, and you are playing single-CPU engines in ponder-off games,
46 one core is enough to completely handle a single game, so that you can run four games simultaneously.
47 By starting multiple instances of XBoard with the same tourney file,
48 these instances will then cooperate on completing the tourney.
49 Each one will 'grab' a game from the tourney file that has not yet been played and is not in progress,
50 mark it as being in progress, and starts playing it.
51 When that game then finishes, The XBoard instance that had been playing it
52 will replace the "in-progress" mark in the tourney file by the game result,
53 and grab the next game that has not had any attention yet.
54 This continues until the entire tourney is done.
55 (Note there are options to delay starting games from a new round or cycle 
56 until the previous one has been completed.)
57 </p>
58 <p>
59 An XBoard tournament is organized as a number of cycles,
60 where each cycle is a complete repetition of the previous one.
61 The cycle is sub-divided into rounds, where each player plays a single other one.
62 A round consists of a number of pairings, where one player plays one other.
63 A pairing, finally, consists of a number of consecutively played games between the same players.
64 So you can, for instance, do a 5-cycle round-robin with 8 players and two games per pairing.
65 Players will then play two consecutive games against each other (with reversed colors)
66 before the next pairing, with two other players, will start.
67 After 4 such pairings (8 games) every player will have played two games against one opponent, 
68 and a round is completed.
69 After 7 such rounds, everyone has played everyone, which completes one tourney cycle.
70 This will then be repeated 5 times, so that in the end everyone will have played everyone else 10 times.
71 </p>
72 <h3>New command-line options</h3>
73 <p>
74 To specify the tourney, some new command-line options have been defined in XBoard.
75 Normally the user will not be exposed to these at all,
76 as they are purely designed for storing the corresponding settings in the tournament files.
77 They would not even be stored in the normal settings file (i.e. they are volatile options).
78 New options are -participants, (which holds a list of engines, one per line),
79 -tourneyType, -tourneyCycles, and -results.
80 The latter specifies which games have already been played, as a string of +-=* characters,
81 where an asterisk signifies the game is currently in progress.
82 The -tourneyType can be 0 for a round-robin, an integer N > 0 for (multi-)gauntlets,
83 (where the first N participants of the list each play all others),
84 or -1 for Swiss.
85 (The Swiss needs an external pairing engine; more about that later.)
86 </p>
87 <table cellpadding="10"><tr><td>
88 <p>
89 The previously existing option -defaultMatchGames is used to indicate the number of games per pairing,
90 so that the total number of games per pairing will be the product of the value of -defaultMatchGames and -tourneyCycles.
91 The -loadGameFile and -loadPositionFile, and the corresponding index specification
92 -loadGameIndex, -loadPositionIndex and -rewindIndex are used during the games of a pairing
93 in the same way as they would be used in a simple match between two engines,
94 and are also specified in the tourney file.
95 </p>
96 <h3>Setting up a tournament from the menu</h3>
97 <p>
98 To start a tourney you can start XBoard with or without engine,
99 and summon the Match Options dialog from the Options menu.
100 There the most important thing you should do is specify a tournament file.
101 If the file you specify already existed, (e.g. by using the browse button for it), it is all you have to specify,
102 as all other settings will then be taken from that file.
103 (This is what you would do to resume an interrupted tourney, or add a playing agent to an existing one.)
104 If the file did not exist yet, it will be created as soon as you OK the dialog,
105 but you have to complete the other parameters in the dialog first.
106 XBoard is by default configured to propose a non-existing file, by deriving a name from the date and time.
107 Unless you want the name to be more easily recognizable for later reference, you can accept that one.
108 </p><p>
109 So usually you will start picking the participants, 
110 and a combobox in the dialog allows you to pick any installed engine as often as you want.
111 The engines you select this way will be added to the displayed partcipants list.
112 Note this participants list is a normal text edit,
113 so that you can delete engines to correct mistakes,
114 shuffle the order, etc.
115 (Do not type the name of non-installed engines there, or change the names, though:
116 they will then not be recognized!)
117 After 'OK' all the settings will be written on the specified tourney file,
118 with -results last, (automatically set to an empty string,
119 to indicate none of the games has been played yet),
120 and XBoard will then switch to match mode to run the tourney.
121 </p><p>
122 Games played during the tourney will be saved as usual on the -saveGameFile,
123 depending on your option settings for this.
124 You don't have to save the PGN, if you don't want to.
125 </p>
126 </td><td>
127 <img src="Tourney.png">
128 </td></tr></table>
129
130 <table cellpadding="50"><tr><td>
131 <pre>
132 -participants {glaurung
133 Fruit 2.1
134 Fairy-Max 4.8
135 Crafty 20.14
136 }
137 -tourneyType 0
138 -tourneyCycles 1
139 -defaultMatchGames 2
140 -syncAfterRound true
141 -syncAfterCycle true
142 -saveGameFile "tm.pgn"
143 -loadGameFile ""
144 -loadGameIndex 0
145 -loadPositionFile ""
146 -loadPositionIndex 1
147 -rewindIndex 0
148 -results "=-+*"
149 </pre>
150 </td><td valign="top">
151 <p>
152 To the left you see an example of a tournament file of a (small) tourney in progress.
153 Three games have been played, the fourth is in progress,
154 as you can see in the -results string.
155 When another XBoard instance starts a match with this tournament file specified,
156 it will start playing the fifth game,
157 and the -results string in the tourney file would change to "=-+**".
158 </p>
159 <p>
160 When you would then quit the XBoard instance that is (apparently) playing game #4,
161 it would change the result string to <pre>-results "=+- *"</pre> before it exits,
162 indicating that game #4 is no longer in progress, but not yet played either.
163 The XBoard instance that is still running
164 (or a new one you start on this tournament file)
165 will then grab it the next time.
166 </p>
167 </td></tr></table>
168 <p>
169 Note that XBoard has no windows (yet?) to show you the standings or the cross table of the tournament.
170 The idea is that there exist already plenty programs to generate those from the PGN file.
171 When you let all XBoard instances save the games they play to the same file,
172 (this XBoard version uses file locking to make sure this can't cause problems!),
173 you can use your favorite PGN-to-cross-table utility on it any time you want.
174 </p>
175
176 <h3>Synchronization in concurrent play</h3>
177 <p>
178 When you use multiple instances of XBoard to concurrently work on playing a tourney,
179 the option -syncAfterRound can be used to prevent XBoard from starting games from a new round,
180 when there are still unfnished games of a previous round.
181 XBoard will then wait until all these games are finished,
182 and automatically resume after that with the game of the next round it already picked.
183 This way you can guarantee that the rounds appear well-ordered in the PGN file.
184 There is a similar option -syncAfterCycle.
185 But as a cycle end coincides with the end of a round, this option is only meaningful when -syncAfterRound is false.
186 There are checkboxes near the top of the Match Options dialog where you can select if you want such synchronization,
187 but when you do not plan to use concurrency in playing the tourney, you can of course completely ignore them.
188 </p>
189
190 <h3>Substituting participants during a tourney</h3>
191 <p>
192 You can substitute one participant for another in a tourney that is already in progress.
193 (What you cannot do, however, is change the number of participants,
194 as this would mess up the entire tournament schedule.)
195 The Match Options dialog provides two buttons for that: Upgrade and Replace.
196 The way it works is this:
197 when you open the dialog while the tournament is playing,
198 (in an XBoard that is actually playing it),
199 you will see the list of participants and other tourney parameters of the current tourney already in their respective fields of the dialog.
200 All you have to do is to replace one (and not more!) of the participant names by another,
201 by editing the participants field.
202 After that, you press one of the two buttons, and that is it!
203 Upgrade will cause XBoard to use the new participant in stead of the old one in all future games,
204 while Replace would also erase all game results of the participant you replaced,
205 so that these games will be replayed.
206 This can be done while the tourney is running, there is no need to pause it in any way.
207 The only restriction currently is that you cannot use Replace on an engine that is currently playing
208 because XBoard would not know how to erase the result of the game in progress,
209 as it is not in yet, and another XBoard instance might be playing it.
210 </p><p>
211 Replacing one participant name by that of a new engine could be a bit tricky,
212 as you would have to use the exact nickname under which the engine is installed.
213 (XBoard performs lots of checks to see if there is a mistake there,
214 but it is better not to run into error popups all the time,
215 and having to do it again.)
216 The recommended way for doing this is just select the substitute from the combobox,
217 so that it will be added to the bottom of the list.
218 You can then simply use drag and drop editing to move that bottom line
219 to below the name of the engine you want to replace
220 (because the order of the engines in the list must be preserved!),
221 and then delete the line with the nickname of the participant to be replaced.
222 </p>
223
224 <h3>Running the same tourney as before</h3>
225 <p>
226 Sometimes you want to run a tourney with the same or nearly the same participants over and over again.
227 This occurs, for instance, when you are testing an engine under development, by playing it against a fixed set of opponents.
228 It would be a pain to have to pick all these oponents from the list
229 every time you want to repeat this gauntlet with a new version of the engine you want to test.
230 (The participants list could be very long!)
231 </p>
232 <p>
233 To solve this, a 'Clone Tourney' button is provided in the Match Options dialog.
234 All you have to do is select an existing tournament file (usually through the browse button),
235 which can be of a completed tourney.
236 But in stead of pressing OK after you have done that (which would attempt to resume that tourney),
237 you now press 'Clone Tourney'.
238 This copies all the parameters of the indicated tourneyfile (except the -results),
239 so they appear in their dialog fields.
240 At the same time it switches the name in the tourney-file field back to the one that was
241 originally proposed when you opened the dialog.
242 So that when you would press OK now, you would start a new tourney,
243 with exactly the same parameters as the cloned one.
244 </p>
245 <p>
246 Usually you would want to change some of the paramters first, however.
247 Like replacing the name of the gauntlet engine in the 'participants' field by that of the newer version.
248 Basicaly you can change anything you like, without restriction,
249 as you are really setting up a completely new and independent tourney.
250 The cloning was just a convenient way to quickly get some default settings for all of the parameters loaded into the dialog.
251 </p>
252
253 <h3>Editing tourney files</h3>
254
255 <p>
256 Although this is not recommended for a novice user, (and should also not be needed in normal applications),
257 an experienced user that understands very well how things work might see some benefits in editing the tourney file.
258 Remember that the tourney file is read by every XBoard instance playing on that tourney, before every game.
259 So the tourney file is an ideal place to 'broadcast' a setting to all XBoards playing for that tourney, and none other.
260 If you thus want to have some special setting of XBoard just for that tournament,
261 which is not stored in the tourney file by default,
262 you could simply add it there.
263 </p><p>
264 You would then automatically force this setting on all XBoards playing for the tourney,
265 even those you will start up only tomorrow,
266 even if in the mean time you have changed the settings XBoard uses at startup by doing something else with it in the mean time.
267 For instance, you could write a '-variant fischerandom' option in the tourney file, 
268 if not all engines are installed to automatically play Chess960.
269 Or specify that the engine-output window should be closed, or Shogi pixmaps should be used for the pieces, or whatever.
270 The only thing you have to keep in mind is that the -results option should always remain the last one in the file.
271 So NEVER, NEVER append anything to the end of a tourney file!
272 It would also be good practice to always keep the -participants option the first one in the file.
273 (As this is used by the OS to determine mime-type of the file.)
274 </p>
275
276 </div><!-- for id="content", starts in the include above -->
277 <!--#include virtual="/server/footer.html" -->
278 <div id="footer">
279
280 <p>Please send general FSF &amp; GNU inquiries to
281 <a href="mailto:gnu@gnu.org">&lt;gnu@gnu.org&gt;</a>.
282 There are also <a href="/contact/">other ways to contact</a>
283 the FSF.<br />
284 Please send broken links and other corrections or suggestions to
285 <a href="mailto:bug-xboard@gnu.org">&lt;bug-xboard@gnu.org&gt;</a>.</p>
286
287 <p>Please see the <a
288 href="/server/standards/README.translations.html">Translations
289 README</a> for information on coordinating and submitting translations
290 of this article.</p>
291
292 <p>Copyright &copy; 2009, 2010, 2011, 2012 Free Software Foundation, Inc.</p>
293
294 <p>This page is licensed under a <a rel="license"
295 href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative
296 Commons Attribution-NoDerivs 3.0 United States License</a>.</p>
297
298 <p>Updated:
299 <!-- timestamp start -->
300 $Date: 2012/02/10 07:45:12 $
301 <!-- timestamp end -->
302 </p>
303 </div>
304 </div>
305 </body>
306 </html>