applied patch by allefant to add --turns= parameter

streamlined and (hopefully) completed the --help output

streamlined and (hopefully) completed the wesnoth man page
This commit is contained in:
Gunter Labes 2006-05-07 05:16:53 +00:00
parent b1bce9495b
commit a304087894
4 changed files with 107 additions and 96 deletions

View File

@ -87,6 +87,7 @@ SVN trunk (1.1.2+svn):
* new /help command in mp lobby to get info on available commands * new /help command in mp lobby to get info on available commands
* :mute command to silent observers * :mute command to silent observers
* host changes automatically if game creator leaves => no disconnections * host changes automatically if game creator leaves => no disconnections
* new --turns= commandline parameter
Version 1.1.2: Version 1.1.2:
* campaigns * campaigns

View File

@ -12,70 +12,64 @@
.\" along with this program; if not, write to the Free Software .\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
.\" .\"
.
.TH WESNOTH 6 "June 2005" "wesnoth" "Battle for Wesnoth" .TH WESNOTH 6 "2006" "wesnoth" "Battle for Wesnoth"
.
.SH NAME .SH NAME
Battle for Wesnoth \- fantasy turn-based strategy game wesnoth \- Battle for Wesnoth, a turn-based fantasy strategy game
.
.SH SYNOPSIS .SH SYNOPSIS
.
.B wesnoth .B wesnoth
[\fIOPTION\fR] [\fIOPTIONS\fR]
[\fIPATH_TO_DATA\fR] [\fIPATH_TO_DATA\fR]
.
.SH DESCRIPTION .SH DESCRIPTION
.
Battle for Battle for
.B Wesnoth .B Wesnoth
is a turn-based fantasy strategy game. is a turn-based fantasy strategy game.
Defeat all enemy leaders using a well-chosen cadre of troops, taking Defeat all enemy leaders using a well-chosen cadre of troops, taking
care to husband your resources of gold and villages. All units have care to manage your resources of gold and villages. All units have
their own strengths and weaknesses; to win, you must deploy your forces their own strengths and weaknesses; to win, deploy your forces to
to their best advantage while denying your foes the chance to do the their best advantage while denying your foes the chance to do the
same. As units gain experience, they acquire new abilities and become same. As units gain experience, they acquire new abilities and
more powerful. You can play in your own language, and even create your become more powerful. Play in your own language and test your skill
own custom units, scenarios or campaigns. Test your skill against a against a smart computer opponent, or join Wesnoth's large community
smart computer opponent, or join Wesnoth's large community of on-line of on-line players. Create your own custom units, scenarios or
players. campaigns, and share them with others.
.
.SH OPTIONS .SH OPTIONS
.
.TP .TP
.B --bpp .BI --bpp \ number
sets BitsPerPixel value. Example: --bpp 32 sets BitsPerPixel value. Example: --bpp 32
.TP .TP
.B --compress \ <infile> \ <outfile> .BI --compress \ <infile> \ <outfile>
compresses a savefile (infile) that is in text WML format into binary WML format (outfile). compresses a savefile (infile) that is in text WML format into binary WML format (outfile).
.TP .TP
.BR -d , \ --debug .B -d, \ --debug
shows extra debugging information and enables additional command mode shows extra debugging information and enables additional command mode
options in-game (see the Wiki at http://www.wesnoth.org/ for more options in-game (see the Wiki at http://www.wesnoth.org/ for more
information about command mode). information about command mode).
.TP .TP
.B --decompress \ <infile> \ <outfile> .BI --decompress \ <infile> \ <outfile>
decompresses a savefile (infile) that is in binary WML format into text decompresses a savefile (infile) that is in binary WML format into text
WML format (outfile). WML format (outfile).
.TP .TP
.BR -f , \ --fullscreen .B -f, \ --fullscreen
runs the game in full screen mode. runs the game in full screen mode.
.TP .TP
.B --fps .B --fps
displays the number of frames per second the game is currently running displays the number of frames per second the game is currently running
at, in a corner of the screen. at, in a corner of the screen.
.TP .TP
.BR -h , \ --help .B -h, \ --help
displays a summary of command line options to standard output, and exits. displays a summary of command line options to standard output, and exits.
.TP .TP
.BR --load FILE .BI --load \ savegame
runs the game saved in FILE in the standard save game directory. loads the file savegame from the standard save game directory.
.TP .TP
.BR --log-error="domain1,domain2,..." , \ --log-warning=... , \ --log-info=... .BR --log-error="domain1,domain2,..." , \ --log-warning=... , \ --log-info=...
sets the severity level of the debug domains. "all" can be used to match sets the severity level of the debug domains. "all" can be used to match
@ -86,75 +80,58 @@ shows all messages,
only warnings and errors, and only warnings and errors, and
.B --log-error .B --log-error
just errors. just errors.
.TP .TP
.B --multiplayer .B --multiplayer
runs a multiplayer game. There are additional options that can be used runs a multiplayer game. There are additional options that can be used
together with together with
.B --multiplayer .B --multiplayer
as explained below. as explained below.
.TP .TP
.BR --nocache .B --nocache
disables caching of game data. disables caching of game data.
.TP .TP
.BR --nosound .B --nosound
runs game without sounds and music. runs the game without sounds and music.
.TP .TP
.BR --path .BR --path
prints the name of the game data directory and exits. prints the name of the game data directory and exits.
.TP .TP
.BR -r , \ --resolution .BI -r, \ --resolution \ XxY
sets screen resolution. Example: -r 800x600 sets the screen resolution. Example: -r 800x600
.TP .TP
.BR -t , \ --test .B -t, \ --test
runs the game in a small test scenario. runs the game in a small test scenario.
.TP .TP
.BR -v , \ --version .B -v, \ --version
shows version number and exits. shows the version number and exits.
.TP .TP
.BR -w , \ --windowed .B -w, \ --windowed
runs the game in windowed mode. runs the game in windowed mode.
.
.SH Options for --multiplayer .SH Options for --multiplayer
.
The side-specific multiplayer options are marked with <number>. <number> The side-specific multiplayer options are marked with <number>. <number>
has to be replaced by a side number. It usually is 1 or 2 but depends on has to be replaced by a side number. It usually is 1 or 2 but depends on
the number of players possible in the chosen scenario. the number of players possible in the chosen scenario.
.TP .TP
.BR --era=value .B --algorithm<number>=value
selects a non-standard algorithm to be used by the AI controller for
this side. Available values: "idle_ai" and "sample_ai".
.TP
.B --controller<number>=value
selects the controller for this side. Available values: "human" and "ai".
.TP
.B --era=value
use this option to play in the selected era instead of the "Default" use this option to play in the selected era instead of the "Default"
era. The era is chosen by an id. Eras are described in the era. The era is chosen by an id. Eras are described in the
data/multiplayer.cfg file. data/multiplayer.cfg file.
.TP .TP
.B --nogui .B --nogui
runs the game without the GUI. Must appear before runs the game without the GUI. Must appear before
.B --multiplayer .B --multiplayer
to have the desired effect. to have the desired effect.
.TP .TP
.BR --scenario=value .B --parm<number>=name:value
selects a multiplayer scenario. The default scenario is "multiplayer_test".
.TP
.BR --algorithm<number>=value
selects a non-standard algorithm to be used by the AI controller for
this side. Available values: "idle_ai" and "sample_ai".
.TP
.BR --controller<number>=value
selects the controller for this side. Available values: "human" and "ai".
.TP
.BR --parm<number>=name:value
sets additional parameters for this side. This parameter depends on the sets additional parameters for this side. This parameter depends on the
options used with options used with
.B --controller .B --controller
@ -162,27 +139,35 @@ and
.B --algorithm. .B --algorithm.
It should only be useful for people designing their own AI. (not yet It should only be useful for people designing their own AI. (not yet
documented completely) documented completely)
.TP .TP
.BR --side<number>=value .B --scenario=value
selects a multiplayer scenario. The default scenario is "multiplayer_Charge".
.TP
.B --side<number>=value
selects a faction of the current era for this side. The faction is selects a faction of the current era for this side. The faction is
chosen by an id. Factions are described in the data/multiplayer.cfg chosen by an id. Factions are described in the data/multiplayer.cfg
file. file.
.TP
.B --turns=value
sets the number of turns for the chosen scenario. The default is "50".
.TP
Example to test your own AI:
wesnoth --multiplayer --controller2=python_ai --algorithm2=python_ai --parm2=python_script:py/my_own_python_ai.py --side2=Rebels
.
.SH AUTHOR .SH AUTHOR
Written by David White <davidnwhite@verizon.net>. Written by David White <davidnwhite@verizon.net>.
.br .br
Edited by Nils Kneuper <crazy-ivanovic@gmx.net> and ott <ott@gaon.net>. Edited by Nils Kneuper <crazy-ivanovic@gmx.net>, ott <ott@gaon.net> and Soliton <soliton@sonnenkinder.org>.
.br .br
This manual page was originally written by Cyril Bouthors <cyril@bouthors.org>. This manual page was originally written by Cyril Bouthors <cyril@bouthors.org>.
.br .br
Visit the official homepage: http://www.wesnoth.org/ Visit the official homepage: http://www.wesnoth.org/
.
.SH COPYRIGHT .SH COPYRIGHT
Copyright \(co 2003-2006 David White <davidnwhite@verizon.net> Copyright \(co 2003-2006 David White <davidnwhite@verizon.net>
.br .br
This is Free Software; this software is licensed under the GPL version 2, as published by the Free Software Foundation. This is Free Software; this software is licensed under the GPL version 2, as published by the Free Software Foundation.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.
.SH SEE ALSO .SH SEE ALSO
wesnoth_editor(6), wesnothd(6) wesnoth_editor(6), wesnothd(6)

View File

@ -60,7 +60,7 @@ binds the server to the specified port. If no port is specified, port
15000 will be used. 15000 will be used.
.TP .TP
.BI -t,\ --threads \ number .BI -t,\ --threads \ number
sets the number of worker threads for network I/O to n (default: 5). sets the number of worker threads for network I/O to n (default: 5, max: 30).
.TP .TP
.B -V,\ --version .B -V,\ --version
shows version number and exits. shows version number and exits.

View File

@ -439,6 +439,7 @@ bool game_controller::play_multiplayer_mode()
std::string scenario = "multiplayer_Charge"; std::string scenario = "multiplayer_Charge";
std::map<int,std::string> side_types, side_controllers, side_algorithms; std::map<int,std::string> side_types, side_controllers, side_algorithms;
std::map<int,string_map> side_parameters; std::map<int,string_map> side_parameters;
std::string turns = "50";
size_t sides_counted = 0; size_t sides_counted = 0;
@ -468,6 +469,8 @@ bool game_controller::play_multiplayer_mode()
if(name == "--scenario") { if(name == "--scenario") {
scenario = value; scenario = value;
} else if(name == "--turns") {
turns = value;
} else if(name == "--era") { } else if(name == "--era") {
era = value; era = value;
} else if(last_digit && name_head == "--controller") { } else if(last_digit && name_head == "--controller") {
@ -510,6 +513,8 @@ bool game_controller::play_multiplayer_mode()
return false; return false;
} }
level["turns"] = turns;
const config* const side = era_cfg->child("multiplayer_side"); const config* const side = era_cfg->child("multiplayer_side");
if(side == NULL) { if(side == NULL) {
std::cerr << "Could not find multiplayer side\n"; std::cerr << "Could not find multiplayer side\n";
@ -1528,24 +1533,44 @@ int play_game(int argc, char** argv)
if(val == "--help" || val == "-h") { if(val == "--help" || val == "-h") {
std::cout << "usage: " << argv[0] std::cout << "usage: " << argv[0]
<< " [options] [data-directory]\n" << " [OPTIONS] [DATA-DIRECTORY]\n"
<< " -d, --debug Shows debugging information in-game\n" << " --bpp number sets BitsPerPixel value. Example: --bpp 32\n"
<< " -f, --fullscreen Runs the game in full-screen\n" << " --compress INFILE OUTFILE compresses a savefile (INFILE) that is in text WML\n"
<< " -h, --help Prints this message and exits\n" << " format into binary WML format (OUTFILE).\n"
<< " --path Prints the name of the game data directory and exits\n" << " -d, --debug shows extra debugging information and enables\n"
<< " -t, --test Runs the game in a small example scenario\n" << " additional command mode options in-game.\n"
<< " --load FILE Runs the game, loading FILE\n" << " --decompress INFILE OUTFILE decompresses a savefile (INFILE) that is in binary\n"
<< " -w, --windowed Runs the game in windowed mode\n" << " WML format into text WML format (OUTFILE).\n"
<< " -v, --version Prints the game's version number and exits\n" << " -f, --fullscreen runs the game in full screen mode.\n"
<< " --fps displays the number of frames per second the game\n"
<< " is currently running at, in a corner of the screen.\n"
<< " -h, --help prints this message and exits.\n"
<< " --load SAVEGAME loads the file SAVEGAME from the standard save\n"
<< " game directory.\n"
<< " --log-error=\"domain1,domain2,...\", --log-warning=..., --log-info=...\n" << " --log-error=\"domain1,domain2,...\", --log-warning=..., --log-info=...\n"
<< " Set the severity level of the debug domains\n" << " sets the severity level of the debug domains.\n"
<< " \"all\" can be used to match any debug domain\n" << " \"all\" can be used to match any debug domain.\n"
<< " --nocache Disables caching of game data\n" << " --nocache disables caching of game data.\n"
<< " --nosound Disables sounds\n" << " --nosound runs the game without sounds and music.\n"
<< " --compress file1 file2 Compresses the text-WML file file1 into the\n" << " --path prints the name of the game data directory and exits.\n"
<< " binary-WML file file2\n" << " -r, --resolution XxY sets the screen resolution. Example: -r 800x600\n"
<< " --decompress file1 file2 Uncompresses the binary-WML file file1 into\n" << " -t, --test runs the game in a small test scenario.\n"
<< " the text-WML file file2\n" << " -v, --version prints the game's version number and exits.\n"
<< " -w, --windowed runs the game in windowed mode.\n"
<< " --multiplayer runs a multiplayer game. There are additional\n"
<< " options that can be used as explained below:\n"
<< " --algorithm<number>=value selects a non-standard algorithm to be used by the\n"
<< " AI controller for this side.\n"
<< " --controller<number>=value selects the controller for this side.\n"
<< " --era=value selects the era to be played in by its id.\n"
<< " --nogui runs the game without the GUI. Must appear before\n"
<< " --multiplayer to have the desired effect.\n"
<< " --parm<number>=name:value sets additional parameters for this side.\n"
<< " --scenario=value selects a multiplayer scenario. The default\n"
<< " scenario is \"multiplayer_Charge\".\n"
<< " --side<number>=value selects a faction of the current era for this side\n"
<< " by id.\n"
<< " --turns=value sets the number of turns. The default is \"50\".\n"
; ;
return 0; return 0;
} else if(val == "--version" || val == "-v") { } else if(val == "--version" || val == "-v") {