.. SPDX-License-Identifier: GPL-3.0-or-later
.. SPDX-FileCopyrightText: Freeciv21 and Freeciv Contributors
.. SPDX-FileCopyrightText: James Robertson <jwrober@gmail.com>
.. SPDX-FileCopyrightText: Louis Moureaux <m_louis30@yahoo.com>
.. SPDX-FileCopyrightText: David Koníř <david.konir@gmail.com>

.. Custom Interpretive Text Roles for longturn.net/Freeciv21
.. role:: unit
.. role:: improvement
.. role:: wonder
.. role:: advance

How to Play Freeciv21
*********************

If you are looking for how to install Freeciv21, look in :doc:`/Getting/install`. If you are looking for
how to get Freeciv21 running, look in the :doc:`faq`.

If you have never played any of the retail Civilization games, it is easiest to start by reading the legacy
Freeciv Manual, available separately at: http://www.freeciv.org/wiki/Manual

If you are looking for help on playing Freeciv21, then keep reading!

Basic Strategy
==============

First of all, this is not a *perfect* strategy, but it will get you started playing Freeciv21. Part of the
appeal of Freeciv21 is in developing new strategies as you play more games. This guide is mostly based upon
the Classic ruleset. There are other rulesets out there that ship with the game, but the base information
presented here is the same for all rulesets.

The game is divided into several steps or stages:

#. `Choosing the first city site`_.
#. `Selecting your first city locations`_.
#. `Selecting your technological advance`_.
#. `Mapping the countryside`_.
#. `Defending the cities`_.
#. `Deciding which units to build first`_.
#. `Improving the land`_.
#. `Deciding where to build cities`_.
#. `Taking care of the cities`_.
#. `Interacting with other players (diplomacy)`_.
#. `Exploring the world`_.
#. `Things to keep in mind`_.
#. `Production phase`_.
#. `Annihilation of your opponents`_.

Choosing the First City Site
----------------------------

Start the game by wandering around :strong:`briefly` to find a good place to build the first city. Do not feel
tempted to investigate any yellow roofed villages yet, they might contain :unit:`Barbarian` tribes. Build the
city close to Resources (Fish, Wheat, Wine, or Buffalo) and perhaps close to fresh water (River or Lake). Keep
in mind that the first city you build will be your capital! It is advised not to place your capital on the
coast. That can open you up to losing it from an attack from the sea.

The idea is to balance the quality of the site you find against getting your first city established as early
as possible. You will find that *balance* becomes a key aspect of playing Freeciv21.

Selecting your First City Locations
-----------------------------------

In the Classic ruleset, you start the game with 5 :unit:`Settlers`, 6 :unit:`Workers`, and 2
:unit:`Explorers`. Once you have planted your first city as your capital, you need to find a place for your
remaining :unit:`Settlers` as quickly as possible. This initial expansion phase of the game is important to
establishing your base cities. Cities are everything in Freeciv21. The more cities you have, the more of every
type of resource you can produce. Winning in Freeciv21 is a factor of your nation's ability to out-produce
your opponents.

As mentioned in `Choosing the First City Site`_ above, you want to try and place your :unit:`Settlers` so you
can create cities that have Resources available to them. These tile enhancements give bonuses to help your
nation grow.

Selecting your Technological Advance
------------------------------------

With your first city built, your nation will start to produce scientific output called Bulbs. Bulbs are used
to study technological advances. As your nation learns new technologies, new units, city improvements, and
wonders become available to build in your cities.

There are too many scenarios of which technological advance path to take, so make your best judgement. You
will probably want to learn a new form of government. You start the game in Despotism in the Classic ruleset.
:advance:`Monarchy` or :advance:`The Republic` are good early targets. As soon as you have researched a new
government type, start a revolution (
:menuselection:`Civilization --> Government --> Revolution`) and change over to it. Cities operate much better
under Republic than they do under Despotism, but note that it is much harder to keep military units outside of
city limits under a Republic. Also, do not forget to recheck your
:ref:`national budget <game-manual-national-budget-view>` after you have changed governments, as the maximums
vary for each type.

Depending on the amount of fresh water you have available, you might need to make a push for
:advance:`Construction` so you can get your cities larger than size 8 by building an :improvement:`Aqueduct`.
If you are on an island (see `Mapping the Countryside`_), you might need to expand. Learning
:advance:`Map Making` will give you the :unit:`Trireme` unit that can set sail to find new lands
(see `Exploring the World`_).

Mapping the Countryside
-----------------------

After the capital city has been built, it will start producing a :unit:`Warrior` unit by default. These units
can be used to walk around exploring the countryside. However, the Classic ruleset gives you an excellent unit
to explore with. Aptly named the :unit:`Explorer`. Remember, it is risky to leave a city undefended, so
perhaps keep the first :unit:`Warrior` in the city, and use the :unit:`Explorer` to explore.

You will come across Huts on the game map. There is a risk / reward with walking your :unit:`Explorer` into
one of these Huts. The rewards can be great: gold, free units, free :unit:`Settlers`, and even free technology
advances. However, the risk is that you loose :unit:`Barbarian` hordes that swoop through your new, undefended
cities like a hot knife through butter. You have been warned.

Defending the Cities
--------------------

At this point, defend your cities by always leaving a :unit:`Warrior` unit in them. As your civilization
develops and new units become available, replace the obsolete units with new ones to ensure your cities have
sufficient defense. The units most often used for defense are (in order of strength): :unit:`Warrior`,
:unit:`Phalanx`, :unit:`Pikemen`, :unit:`Musketeers`, :unit:`Riflemen`, and :unit:`Mechanized Infantry`.

Keep in mind that with some types of government, military units inside or outside cities can reduce or create
unhappiness. Also remember that when a land unit is inside a city, it gets a 50% defensive bonus, as if
fortified (:menuselection:`Unit --> Fortify`). This happens automatically so you can tell the unit to "sentry"
(:menuselection:`Unit --> Sentry` and watch for enemy units that come through your territory. When a new city
is built, the city starts to build the best available defensive unit from the above list by default.

Deciding Which Units to Build First
-----------------------------------

After building one or two :unit:`Warrior` units, start building :unit:`Settlers`. :unit:`Settlers` take city
population, but if you picked a good city site, your city should be big enough by now. The amount of
population that it takes to build a :unit:`Settler` is ruleset dependent. In the Classic ruleset it takes 1
population to build :unit:`Settlers`. :unit:`Settlers` are best put to use building new cities, while they can
also build infrastructure improvements (see the next section), it is better to use :unit:`Workers` for this
when available. You start the game with 6 :unit:`Workers` in the Classic ruleset. It should be noted that
unlike :unit:`Settlers`, :unit:`Workers` do not consume food from their parent city. Keep in mind that a large
population increases both the amount of productivity and your civilization's research rate, not to mention
that cities secure land for your empire, so building new cities should be a high priority in the early game.

Improving the Land
------------------

Each city has an area of land around it that can be used for growing food, producing goods, and generating
trade. This area is called the *Working Radius*. This output can be increased by using :unit:`Workers` (or
:unit:`Settlers`, and later :unit:`Engineers`) to improve the land close to your cities. The land can be
improved with Irrigation (increasing food output), Roads (allowing units to move faster and in some cases
increasing trade), and Mines (increasing production), among other improvements. The ability to do some
improvements on some tiles may require a technology advance to be learned by your scientists.
See :title-reference:`Help --> Terrain --> Terrain Alterations` for more information.

Deciding Where to Build Cities
------------------------------

The best location for a city is a matter of taste. A city which is placed near the sea is easier to spot by
opponents, but can also serve as a port for seagoing units. They also usually need a
:improvement:`Coastal Defense` city improvement later on for defense against an attacking navy. The best
strategy is to build a few of both, but keep in mind that your opponents will find it harder to locate your
city if you do not build it by the sea.

Now is a good time to talk about city planning strategies. There are many strategies to city planning that are
good to discuss here in the early game.

.. note::
  There are a few different kinds of Tilesets available in Freeciv21. For sake of example we are talking about
  the Hex(agonal) type of Tileset in this section. The concepts are very similar with the Square tilesets as
  well. If you are looking at Square tiles, you can change to Hex tiles by going to
  :menuselection:`Game --> Load Another Tileset` and picking ``Hexemplio`` from the list.

Let us first talk about two concepts: *Vision Radius* and *Working Radius*. Each city has a vision radius and
a working radius. The vision radius is the tiles that the citizens of a city can see on the map. If an enemy
unit comes within the vision radius of a city, a sentried unit inside of the city will wake up and alert you.
Within the vision radius is the smaller working radius. When thinking of city planning, you should be most
concerned with the working radius of a city. These are the tiles that the citizens of your cities manage to
extract Resources (Shields, Food, and Trade). When the working radius of a city overlaps with that of another
city, only one city at a time can manage that tile. This is another one of those *balance* items in playing
Freeciv21.

When you have a :unit:`Settler` selected, it will have a red outline shown on the map. This is the city's
working radius if you placed the :unit:`Settler` at that spot with the :menuselection:`Work --> Build City`
command.

This image represents a city with its working radius. The bolded hexagon represents the city center.

.. _City Center:
.. figure:: /_static/images/how-to-play/city-center.png
    :scale: 75%
    :align: center
    :alt: City Center Working Radius
    :figclass: align-center

    City Center Working Radius


There are two approaches to positioning cities: Smallpoxing and Largepoxing. In Smallpoxing you fit as many
cities as you can anywhere you can place them. Right at the minimum distance from each other. Here is an
example of what that looks like:

.. _Smallpoxing:
.. figure:: /_static/images/how-to-play/smallpoxing.png
    :scale: 75%
    :align: center
    :alt: Smallpoxing
    :figclass: align-center

    Smallpoxing


Notice the overlap in the working radius of all the cities.

With the Largepoxing strategy, you give maximum space to all cities with no tile overlap. Here is what that
looks like:

.. _Largepoxing:
.. figure:: /_static/images/how-to-play/largepoxing.png
    :scale: 75%
    :align: center
    :alt: Largepoxing
    :figclass: align-center

    Largepoxing


The two strategies are antonyms of each other. In Largepoxing your cities can get very large in the late game,
but at the beginning of the game you will have a lot of land that is not being used. Another challenge is it
takes more moves for your :unit:`Settlers` to reach the planned city center of the city. In Smallpoxing you
only have to move a few tiles. With Largepoxing you have to move twice the distance and time (in turns).

There is a third strategy. It is not called “Midpoxing” per se, but the strategy is similar to a middle ground
between the Smallpoxing and Largepoxing strategies. Here is an example of a Midpoxing strategy:

.. _Midpoxing:
.. figure:: /_static/images/how-to-play/midpoxing.png
    :scale: 75%
    :align: center
    :alt: Midpoxing
    :figclass: align-center

    Midpoxing


Recall that there are a number of factors to consider when it comes to city planning and placement:

#. Distance from the Capital.
#. Available Resources on tiles around the potential city centers.
#. Locations of freshwater from rivers and lakes.
#. No wasted tiles. Force overlap of any kind so that every tile is available.

Taking Care of the Cities
-------------------------

Every city has a group of citizens. The number of citizens depends on the city's population. When you click on
a city, the :doc:`/Manuals/Game/city-dialog` will open and show how the land around the city is being
managed. You can assign the city's citizens to manage the land, or they can be specialists that contribute to
your civilization in other ways. Especially at the start of the game, care should be taken to ensure that the
citizens are employed so that they maximize food, trade, and then production.

If too much food is being generated, a citizen can be taken off the land by clicking on the occupied land
tile. This citizen can then be transferred to a specialist. There are three specialists: Taxmen (collect
gold), Entertainers (create happiness), or Scientist (create bulbs). By default, Freeciv21 will add an
Entertainer when you take a citizen off the land.

If you click on the central tile of the land (the "City Center"), the citizens will be rearranged to maximize
food production. You will also want to look at the level of food in the Granary and the amount of surplus food
the city is producing each turn. The city will lose excess food at turn change. For example: The Granary in
the city has 18/20 food (needs two food to grow to next city size) and the city is currently producing +4 food
surplus each turn. This means that at turn change you will lose 2 food as waste at turn change. This is a good
opportunity to move the citizens around to get food to +2 surplus. This could be accomplished by taking a
citizen off a tile producing 2 food and turn it into a Taxman for a turn to get gold. At turn change, open the
city and restore the citizen to farming. This kind of individual city management style is called
"micro-management" and is a very powerful mechanism of game play.

The golden rule of taking care of a city is that there should be at least as many happy citizens as unhappy
citizens. A city where this is not the case falls into disorder. Such cities are labeled with a raised fist or
a lightning bolt (depending on the tileset). Take care not to let this happen to any of your cities, as cities
in disorder produce nothing, and are prone to revolt.

Interacting with Other Players (Diplomacy)
------------------------------------------

When one of your units first meets a unit of another nation, or finds one of their cities (or equally if
they find you), a basic contact is established between the two nations. This provides each with basic
intelligence about the other, which can be accessed from the
:ref:`Nations and Diplomacy View <game-manual-nations-and-diplomacy-view>`.

This communication will lapse after a ruleset defined number of turns with no contact, which is one turn for
the Classic ruleset. Establishing an embassy will give a more permanent communication channel, as well as more
advanced intelligence such as details of technology. Embassies are one-way, the nation hosting the embassy
receives no benefit and once established, cannot be revoked.

If you are in contact with another player, then you can arrange a diplomatic meeting. From the
:ref:`Nations and Diplomacy View <game-manual-nations-and-diplomacy-view>`, this is done by selecting the
nation with whom you wish to meet and clicking :guilabel:`Meet`. If the entry under the embassy column is not
blank and the other player is connected (or is a server AI) then a treaty dialog will pop up.

In this dialog you can negotiate an exchange of assets (maps, vision, advances, cities, or gold), embassies,
or relationship pacts such as a Cease-fire or Peace. The list of items that can be traded through diplomacy is
ruleset dependent. There is no need to trade like for like. You can trade, say, an advance or city for gold,
you can consider this buying and selling. Each player builds a list of offered items. To remove an item from
the list, double-click on it. When both players indicate satisfaction, the pact is concluded.

Pacts affect where your units can go and what they can do, and a pact with one nation can affect your
relations with others. Under authoritarian governments such as monarchy you can break a pact at any time, but
the representative governments (Republic and Democracy) have a senate which will block the unprovoked
cancellation of a treaty, unless a foreign :unit:`Diplomat` or :unit:`Spy` sparks a diplomatic incident. The
only way to dissolve a pact in this situation is to dissolve your government by going into anarchy. The
details of pacts are described in the :title-reference:`Help --> Diplomacy` section.

A few notes:

#. You cannot give away your capital.
#. You can only request property that you know about; so you cannot request technology unless you have an
   embassy, and if you cannot see a city on your map, then you cannot request it. Of course, the owner of that
   city can still offer it to you, in which case the area around the city is shown on your map before you
   accept the treaty.
#. One important thing to note: when a city is transferred, any units in the field and supported by that
   city are also transferred, except those sitting in other cities. So make sure the other player is not
   getting a better deal than you expect.

Exploring the World
-------------------

After you have fortified your cities with troops, build :unit:`Triremes` in the cities near the sea. Use the
:unit:`Triremes` to map the world in search of your opponents and new lands. If you are on an island, you
should spend less on military and more on expansion. Or if you are located close to an opponent, it is truly a
good idea to make a Peace treaty and share the advances you have made. Diplomatic units are very useful here,
and :strong:`will` pay off later.

Things to Keep in Mind
----------------------

* What the next advance you will need is.
* What your tax, luxury goods and research rates are currently set to.
* Treaties are often broken, so do not neglect defense!
* Some wonders can be made obsolete by a new technology.

Production Phase
----------------

At some point you will have a large number of cities and your nation has learned many technologies. As you
move into the industrial age you can build :improvement:`Factories` and :improvement:`Power Plants` in your
cities. You want to get as much production as possible out of each city. Pollution becomes a problem. As soon
as you can, try to research :advance:`Mass Production` for :improvement:`Mass Transits`, and
:advance:`Recycling` so you can build :improvement:`Recycling Centers`. Once you have got all your cities
going strong, you must build military units.

.. note::
   If you come into contact with another player, you should immediately build a few attack units, and
   at least one defense unit per city.

When you want to begin thinking about attacking someone, set science to 0%, and raise taxes as high as you can
without provoking disorder. Remember, money can build units too!

Annihilation of Your Opponents
------------------------------

This can happen at any time, but it is more fun with the advanced weapons.

Pick a relatively weak enemy, and send over a few ship loads of troops. Take over their cities, and use them
to build more units to take out the rest of them with. Show no quarter! To the death!

Repeat as often as necessary!

.. note::
   For pacifists: Freeciv21 also allows a player to win by building and launching a spaceship which arrives at
   Alpha Centauri before anyone else. It is known as the Space Race victory.
