Wikia

Freeciv

Server Manual

Talk0
605pages on
this wiki
Revision as of 17:57, June 27, 2009 by 173.65.177.200 (Talk)

Overview | Command-line options | Server commands | Server options | edit navbar

Back to main manuals page


The Freeciv server is the core of the Freeciv system. It maintains the complete states of all game variables (map, units, cities, research, etc.), updates them based on player client requests, and sends updates to the clients. For multiplayer games it is the central arbiter of the game's progress. For solitaire play, it implements the Artificial Intelligence (AI) races.

Whether for solitaire or multiplayer games, the server operator can run the server in a terminal window or from the client. However, if run from the client, all players will be disconnected and the game ended when the first player quits. The operator from the console as well as players (from the client and depending on the command level they were granted) may set game options, including loading entirely new sets of game rules, or load prepackaged scenarios. Players use client programs to connect to the server via the network (even solitaire games, run on one computer and started from the client, use the network software to connect the client and server programs). Once all players have connected, the game is started either from the console or from the client (start button or using command line), and players then proceed with play.

As the game progresses, server commands can be used to adjust game options, save the game for later restart, or terminate the game.

The Freeciv Metaserver is a server on the Internet which provides a coordination point for Freeciv multiplayer games. If enabled by the operator by command line option --meta, the server informs the Metaserver of the status and progress of the game. This one-way information flow (server to Metaserver) should, in time, allow players to locate servers and games to play on.

Command-line options

Options are accepted on the command line of the server. They may not be combined; that is, "civserver -fp savegame.sav 5555" will not work, instead you would need to enter "civserver -f savegame.sav -p 5555". Most options have a short form (single hyphen and single letter) and a long form (double hyphen and a complete word); their effects are identical.

See the list.

Server commands

You may enter commands into the server at any time, either before or during a game. Command names are case-sensitive, as are filenames and settings (an exception is the playername argument, which generally is not case-sensitive).

Whenever a playername is expected as a command argument, what is needed is the name of the ruler of a race. For example, you probably want to refer to "caesar" rather than "romans."

Most commands or values can be truncated (i.e. you only need to enter the first few letters) and can be entered from the client. If they are entered from the client they must be prefixed with a "/".

Depending on the control level granted to the player, entering a command may initiate a vote.

See the list.

Server options

These are the options that may be set with the "set" command, shown with the "show" command, and explained with the "explain" command. Many, but not all, are automatically sent to client programs; some are private to the server. Most options have for their values simple integers.

The detailed descriptions of the options can be found via the server's own "explain" command either from the console, either by issuing the /explain command from the client. See also server options.

Options classification

Options are classified in two ways: their use and their main topic.

Commonly used (vital) options are listed by simply typing '/show' on the console server or on the client command line. Less used options can be seen by typing /show situational or /show rare.

Each option belongs to a category which reflects its main topic: geological, ecological, sociological, economic, military, scientific, internal, networking.

Also, some options can be changed during a game, some cannot.

Vital options

Options that may only be set if the map has not been generated are used in the map generation process, establishing the general habitability of the map, for example: size, topology, generator, startpos.

  • The size option defines the size of the map, which should be based on the number of players and the planned length of the game. The default map size of 4000 tiles is big enough for a fairly quick two players game, but will be a frustratingly fast game for more than three people.
  • The topology option gives its volume to the world making it cylindical, flat or "donut-shaped" with either a classic or isometric tile alignment.
  • The "generator" option alters the map generation process. The default generator is random. Generator 2 creates a pseudo-fractal map with one or more continents. Map generator 3 makes islands only.
  • Startpos will determine how many players will start on the same continent. Each generator has a startpos default value.

Some other options may be set if the map has not been generated, or if the map is already generated but is a scenario's predefined map and the game has not actually started. They also relate to map and game creation, on a different level: specials, huts, minplayers, maxplayers, aifill, startunits, gold, techlevel.

  • Specials determines how many tiles per thousand will contain special resource (for example fruits, gems, iron, etc.).
  • Huts determines how many tribe villages will be spread across the world.
  • Minplayers will prevent the server from starting before this number of players have connected, maxplayer will disallow new players to connect after this number has been reached.
  • Aifill causes the server to create as much AI as needed to reach this number of players.
  • Startunits determines the number and the kind of units you start with. You can set up to 15 units selected in 9 different families such as City founder, Terrain worker, Explorer, Diplomat, Good defense unit, etc.
  • Gold is the funds for each players when starting the game.
  • Techlevel is the number of known techs each player start the game with. Those are randomly chosen and may be different for each player.

The remaining options may be set even after the game has started: barbarians, onsetbarbs, spacerace and timeout.

  • Barbarians defines if barbarians can unrest and how combative they are.
  • Onsetbarbs determines the date after which barbarians appear.
  • Spacerace determines whether players can build a spaceship.
  • Timeout is the maximum duration for a turn.

A note about the timeout option is necessary. Recall the description above of the end-of-turn updates that take place when all players have entered Next Turn. If there are just a few players, in close communication, leaving it in this mode is reasonable. If there are more than just a few, or if there will likely be breaks where one leaves for a minute or so and you don't want to wait, you can set the timeout to some interval such as 60 seconds. In that case, 60 seconds after one update, the next will take place even if a player has not entered Next Turn. Later in the game this can be annoying, and larger timeouts will be necessary. In general, the more players you have, the longer a timeout you will need, but be aware that going above 300 seconds will bother players.

See here for an extensive list of server options.

You may wish to make adjustments in various settings (gold, techlevel, researchspeed, etc.) to make the game easier; if you are inexperienced, and playing with inexperienced people, probably no one will object. But this is not a good way to learn how to play; starting with uncommon advantages makes it more difficult for you to learn how to cope with the common settings. For the most part, the game settings are there for those who wish to make an entire "scenario", an alternative world with its own environment and consistency, such as a Fall of Rome scenario, or a Medieval Europe scenario.

Files and environment

auth-file (only 2.1.x)

If you compiled your server with auth-option (--enable-auth) you can now put your authentication parameters into a flat file.

This is a example file:

       ; Configuration file for Freeciv server player authentication
   
       [auth]
       ; How to connect MySQL server
       host="localhost"
       port="3306" ; This is handled as string! This is ignored in 2.1.5 and earlier, fixed in 2.1.6.
       user="freeciv"
       password="fc"
                   
       ; What database to use in MySQL server
       database="freeciv"
                      
       ; Table names
       table=""
       login_table=""

The "table names"-Paragraph is optional. Default values:

  • table="auth"
  • login_table="loginlog".

You can then enable the authentication with the following command: civserver -a auth-file.txt

Around Wikia's network

Random Wiki