Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2003:
[freeciv-ai] How to beat AI
Home

[freeciv-ai] How to beat AI

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv AI List <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] How to beat AI
From: Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>
Date: Mon, 04 Aug 2003 01:14:14 +0200


  Hi, all

   This is the final version of that document. I hope it!

   Any comments?

   P.S:    If  someone wants to check my spelling, go for it.

How to beat the AI computer players

0. Introduction

    This document is intended to teach first time users some basic strategies of Freeciv. It does not explain the game mechanics, but instead provides some basic strategies and describes the best ways to win against the warmongering AI players. At least it will allow you to not fail miserably during the first few turns...

    We also advise new players to read the manual on the server.

0.1 How do I set up the server?

    In order to get a feel for the game, just open two terminals and type in one terminal 'civserver' or 'ser' (if you're in the source directory), then in the other terminal type 'civclient' or 'civ' and connect to the server. Then on the server console type 'start'. This will set up the server with only one player (you) and barbarians so that you can play a solitaire game without any AI enemies.

    For a game with some AI players just type 'set aifill 5' before typing 'start' at the server console. This will set up a new game with you and 4 AI players.

    There is another option which is the 'generator' option. This chooses the type of world and the start positions in it. There are five different types of generators. If you want an easy beginning, it is better to choose the generator options 2 or 3. This will place each player in their own island isolated from the other AI (or human) players. To do so, just type 'set generator 2' before typing 'start' on the server.

1. AI Levels

    There are three types of AI levels: easy, medium and hard. In the upcoming version of Freeciv, Freeciv 1.15.0, there will be a novice level to further weaken the AI's abilities.

2. Expansion

    One of the key things in a game is the amount of terrain a civilisation has control over. More land means more population, more resources and more trade. So the first thing to do is to build as many settlers as you can to found new cities. Then use these new cities to build more settlers. You can use work lists to build a defender in every city and then begin building settlers.

    The best places to settle a city are near specials. The cities use the tiles around their location (2x2) and the tile the city is located on to produce food, shields and trade. So the best places to settle new cities are where these specials fall inside the 2x2 city radius. Probably, the best specials for fast growth are Wales and Fish, which are in ocean tiles. Placing your cities beside ocean tiles will allow your city to grow as fast as possible, and it will enable you to build a Harbor later for further increasing food output.

    Try to not leave gaps between cities, and create the necessary cities to fully fill all of the terrain. Build cities even when there are not specials within the city radius. You can later improve the terrain within the city radius and in the later stages of technological advance, transform the terrain to better suit your cities' needs.

    When building cities along the borders of your nation, or where you know there will be attacks, it's better to locate the city on terrain tiles which have a defense bonus if possible. Locating cities on defensive bonus tiles such as hills provides any military unit fortified in the city with additional defenses. Try not to locate a city on a hill if this implies losing out on encompassing a special tile within that cities' radius. You can then send your best defensive units to fortify the city.

    Continue settling cities until you are surrounded by your opponents. You can then send “bodyguards” (defensive units) with your settlers to steal terrain from your opponents by simply founding new cities within their “borders.” Or you can skip founding new cities near enemy territory and send the settlers to other lands that are not yet owned. You can send the settlers to land not owned by your enemies, you can send your settlers to explore new islands with triremes or caravels, or you can use the settlers to irrigate and improve your home land.

    When you finish your expansion because you cannot expand further without overlapping city radii, you must let your cities grow. To do so, do not keep building settlers, but instead order your cities to produce military units and send them to the borders of your nation. You can use them to fortify border cities or to attack your enemies. Use other settlers to improve the terrain within your city radii. You can even build some caravans to establish trade routes or build some wonders which can provide very beneficial bonuses to your nation militarily, culturally, and technologically.

3. Governments

   There are four types of government you should be interested in researching: Monarchy, Republic, Communism and Democracy. Monarchy and Communism are the most useful when at war with your enemies, and Republic and Democracy are the most convenient when at peace with your neighbours.

    You begin the game in Despotism. Make researching Monarchy or Republic one of your first goals. Switch to one of these types of government once you have discovered them. To research Monarchy, set the long term objective to Monarchy in the science report. There is a huge amount of corruption in Despotism, and the trade-tax-science of cities far from the capital will be lost due to corruption. Surrounding your capital with cities 2-3 tiles distance from it will maximise the science output of your empire.

    When under Monarchy or Communism each city will support up to 3 units for free - they will not consume 1 shield per unit each turn - and military units don't cause unhappiness. That is why these are the most beneficial government types for a militaristic government.

    Under Republic or Democracy each unit needs one shield for upkeep. Each military unit outside a city causes unhappiness and cities can revolt, which means that cities cease to produce anything until their revolt is quelled by adding Entertainers or increasing the Luxury rate. Managing wars with enemies in these government types is expensive and not very productive. On the other hand, these regimes are good for trade based economies. These government types provide trade bonuses unlike the previous ones. With these types of government your cities will grow faster because cities celebrating a “We love the King Day” will grow at 1 citizen per turn. Mainly, the differences between Republic and Democracy are that with a Republic government you will suffer some corruption, but with Democracy you do not. In a Democracy your cities and units cannot be bribed by enemies, but citizens are more likely to revolt when in war (due to increased unhappiness from military units being away from cities for extended periods of time).

4. Terrain Improvement

    For a detailed explanation of the different terrain follow this link.

    Terrain improvement must be done while you are still expanding and occupying new land. You will want to connect all of your cities as quickly as possible. You must be able to send military units to the border cities of your civilisation in order to engage in war with your enemies. You will also need to establish communications with other civilisations to establish trade routes. To do this, you must build roads between cities with Settlers. Roads provide trade bonuses which will in turn increase your economy.
    Be aware that roading your land makes it easier for an attacking force to conquer your cities, as they too will be able to use your roads for faster movement of their military units. Keep some attack and defense units distributed all around to help protect yourself from easy invasion.

    To make your cities grow, irrigate and road the plains. First the plains, that will give you food, production and trade (2/1/1). With that production you will be able to more effectively counter the AI attacks with more defensive units stationed at each city.

    Then irrigate and road the grassland and create mines in hills and mountains. Also make roads in hills and mountains. A defender or attack in a hill or mountain tile will have defensive bonuses which makes for good places to station troops to repel enemy attackers.

    Keep in mind that if you place a worker of a city on a hill or mountain tile, this will slow down or stop the growth of the city. The AI does not do a very good job of managing this aspect of city growth, and therefore it is to your advantage to grow your cities first by irrigating and roading the plains and grassland tiles, then concentrate on increasing the production and trade of the hills and mountain tiles within your city radius. This is why the production/wonder cities of the AI players are usually small cities. It's always better to have a city of size 8 and production 15 than the same city with size 3 and production 7.

    If you build a harbor in a coastal city the default routine of the game will choose the ocean tile for the citizens within your city to work instead of the irrigated tiles. You will lose the production of the irrigated tiles by allowing the computer to auto-manage your citizen work orders so rearrange worker orders of the citizens within your cities manually.

    When you discover Railroad you can railroad the entire countryside. Try to connect all your cities with rails as a first priority. Specifically concentrate on railroading the mountains and hills because these tiles will gain bonuses in production while river tiles will gain bonuses to trade.

    Because the AI does not adequately understand the concept of supply lines, you can exploit this tactic to gain an edge over the AI. The supply lines of the roads and rails that connect your high production cities to the front lines are important. Normally, your high production cities will be near hills and mountains, but not near the border lines of your civilisation. Therefore, you must move your units to the front lines. Being able to get a newly produced military unit to the front lines in one turn using rails is significantly better than getting the same unit to the front lines in 10 turns! The AI doesn't understand this concept at this stage of the Freeciv development, so AI units will take longer to arrive at their front lines than your units if you employ the building of roads and rails to connect your cities.

    Exploit the weakness of the AI. The AI doesn't know about strategic cities and connected cities. To attack a civilisation that occupies two peninsulas connected by a land pass you can conquerer the cities that connect the enemies empire in this “choke point.” The AI doesn't understand that this cities are strategic to connect and protect the empire, and therefore will not be as concerned about protecting them differently than other cities as a human player would. Concentrate all your forces in the attack and subsequent fortification of these fallen enemy cities so that you can conquer one half of the enemy's empire, and then the other half.

5. Trade

    Trade is an important variable in the game. The large empires generate important amounts of trade, so they are rich and powerful. Trade is money, and this is what moves the world!

    Each turn, the trade of your civilisation is divided in Luxury, Science and Tax. This is managed by the tax rates indicators/controls in the Sidebar of the main map.

    The trade that your civilisation generates comes from the trade you earn from the city worked tiles and the generated by the trade routes of your cities.

    The trade of the tiles can be improved by building roads in all the city worked tiles, and later, by railroading the river tiles.

    You can generate more trade establishing trade routes between cities. It's better to always create trade routes between your cities or with the cities of your allies. If you establish one with an enemy city you are giving trade to that opponent.
    The best trade routes are those established between the largest, the far away cities and those in different continents or islands.

    When you establish a trade route you will receive a certain amount of money for that. This will help you to build improvements, units or wonders, but the most interesting effect is that it will give a little amount of trade each turn. This will give you a big boost in your science research in the long term. So, first create trade routes between the cities in your nation borders. And also, remember that currently cities only have 4 trade routes available, so use them intelligently.

    When the cities grow, the trade routes give more taxes. So, keep your cities growing and your trade output will increase over time.

    The current AI rarely establishes trade routes, so its trade will always be least than your. Also, the AI player doesn't know how to increase trade when it needs luxury. You know that, just build trade routes. Or use ocean tiles instead of land tiles in the cities where you want more luxuries!

6. War

6.1 Defense

    The AI defaults to war when it has the first contact with an enemy unit. Therefore, the AI player will begin to build attack units the first time it contacts you. Prior to building attack units, the AI will build Barracks in each of its cities in order to produce veteran units that would be more useful in battle.

    You need to neutralise the impending attacks from the AI. One of the things you can do is to place your capital and border cities on hills or forests. That way you will benefit from the terrain bonuses and your defensive units will be more likely to survive attacks from the AI, and will become veteran units after enough successful battles.

    It is important to place veteran defensive units in border cities to make it more difficult for the AI to win against you when attacking these cities. A way to stop the AI attacks is to build the veteran defensive units in the high production cities inland, and then send them to your frontier cities. It is more useful to use the resources of your high production cities to fortify your border cities.

    Remember to frequently replace your obsolete defensive units as you discover new technologies. You can upgrade them or disband them in a city to add shield to its production queue to build an advanced unit.
    It is very important to have the lastest researched defensive units in your border cities. The AI is omniscient and sees what you have in your cities. If the AI player sees that you have defensive units that it cannot easily win against, it will not attack that city and will search for another, hopefully of another player, and will leave you alone.

    The best defensive units are Phalanx, Pikemen, Musketeer, Riflemen, and Mech.Inf. Also Marines and Alpine Troops can be used in a pinch, but are better utilised when exploiting their special abilities.

    Another thing that you can do is to build city walls in your border cities and your capital. Be especially mindful of building city walls to further fortify cities containing Great Wonders as the AI will place higher importance on capturing these cities than your other cities.
    Also, its a good thing to build barracks in border cities. In case of an emergency is a lot better to build a veteran unit than a normal one.
    Later in the game, building city walls in coastal cities can be doubly useful in resisting sea attacks. When someone researches Ironclads, Destroyers or Cruisers, build coastal defenses to protect them from sea attacks.

    Another good thing to do is to send attacking units to border cities to protect those cities as well as inland ones. It is better to attack than to be attacked.

    You can also build diplomats and send them to your border cities to protect them. A defending diplomat can be very useful stooping an attacking diplomat from bribing your city or stealing your technology.
    You can also use them in an aggressive way to bribe enemy units or incite revolts in enemy cities. The easy AI will not build diplomats for this purpose so it is to your advantage to exploit this feature of the diplomat unit against the AI.

6.2 Attack

    To attack a city of another civilisation try to use the most technologically advanced units available. If these units are also veteran units, your units will be more likely to survive and conquer the city.

    You can not conquer a city sending a lone unit to a city. This is a waste of resources. You must build an army with both defensive and aggressive units, using the aggressive units to attack the cities and its defenders, and your defensive units to protect the attacking units and later to fortify in the conquered city. If you don't do this the AI will counter-attack and liberate the city, and then steal a technology advance (if you have more than the AI) in the process.

    Also, it's good to know that the Horseman, Chariot, Knights, Dragoons, Cavalry and Armor are good to attack cities without city walls. These units are fast units and are useful in killing enemy units that invade your terrain. To attack cities with walls you will need strong units like Archers, Catapults, Cannons, Artillery and Howitzers.
    In fact, you can check which unit type is best to build in the work list Tab of the City Window. In the Info Column you have for each available item a short description of its properties (Attack, Defense, Movement). Just choose the best attack unit to build. If you have a unit with equal attack strength as another with more movement points, it is best to build the faster unit as it will provide your army with more flexibility in dealing with situations as they arise.

    And of course, always attack the weakest civilisation with the least amount of technology first. You can use diplomats to establish embassies with other civilisations so that you can investigate its cities and plan your attack strategy in addition to viewing the enemy units that are visible to you. Do not attack a city that you can't conquer because your technological advances are not sufficient enough to provide you with adequate attack units. Instead, simply send some diplomats to incite a revolt or sabotage the city.

    Exploit AI weaknesses. The AI is vulnerable to coordinated mass attacks. When the AI sees that is being attacked, it will build defensive units instead of aggressive units. Therefore, if you send an army of 10 Howitzers into enemy territory it will be easier to conquer the AI than if you had only sent in a few Howitzers at a time. A very useful strategy is to attack with Howitzers only once, and return to your conquered city to recover the hit points lost during battle. You will be able to do it if the distance between the cities is small and there is a road or railroad path that connects them.

    Always try to conquer a city in 1 turn. The AI can attack in the next turn and kill all your units if you do not conquer in one turn. Use Naval and Air units to soften up a city or stack of units before attacking with ground units.

    Another trick is that the AI does not use it's units in a planned two or more turn counter-attack, per se. If there are Knights or Alpine Troops in a city, they will not attack an Armor unit that is 2 tiles away. If you want to attack a city, place your fast units 2 tiles away and the AI will not attack you!! This also works for Diplomat units.

    When there are combats, the units get damaged and so are unable to survive to enemy attacks another time. Then you have to send the damaged units to a friendly city - owned or allied - for them to recover its health and its hit points. Also after an attack they could become veterans if they were not, so a good player will always try to recover the hit points of the damaged veteran units.

    Also remember to use the production of the fallen enemy cities to support the up keep of your attack units. Under Monarchy or Communism its very easy, just use the 3 free units of each city to support your army. Under Democracy or Republic is not so easy but you can try it because its more effective. That way you can use the production of your enemies to go against them!

6.3 Barbarians

    Barbarians can be turned off ( 'set barbarians 0' on the server console).

    If you leave huge masses of unexplored land or unsettled land, barbarians will appear randomly. They will appear in the form of stacks of barbarian units on ground tiles or on sea tiles - the sea raiders!!!

    Barbarians are AI controlled, but they are considered a special player. Barbarians only build aggressive units and send them to attack your cities without any defensive unit backup. To liberate your fallen cities, just build an army of fast attackers - Knights or Dragoons - and attack your former cities. Barbarians will almost never build defensive units within a conquered city, so it is relatively easy to reconquer a barbarian controlled city.

6.4 War under different governments

    There are differences in the level of unhappiness that the military units cause under different types of government.
    The best government to wage war with is Communism. Under Communism and Monarchy, military units outside a city do not cause unhappiness, and you have limited martial law. Military units in a city reduce unhappiness, and up to 3 units can be used to keep citizens content. A side benefit of using military units to constrain citizen unhappiness is that you won't have to build as many Coliseums or Cathedrals to keep the people content.
    Under a Republic or Democracy, each military unit outside a city causes unhappiness. You will have to increase the luxury rate of your empire - which will cost you money or science - or you will have to build improvements in your cities to increase citizen happiness.

   Another thing to keep in mind, is that military units are not free. They cost shields to build and maintain. You must use 1 production point - 1 shield - to upkeep a unit each turn. Therefore, the units already produced by your civilisation reduce the capacity to generate new ones or to build new improvements.
    Under Monarchy or Communism you can upkeep 3 military units for free in each city. This is very useful because you can use the defensive military units to impose martial law and defend the city, and you can produce military units in your high production cities, send them to the destination city, and assign the unit to the new home city to increase the defense and happiness of the destination city freeing up the production point used to support that unit for further production in the high production city. This way you will maximise your production amongst all of your cities.
    Under a Republic or Democracy you have to support the upkeep of each military unit. Therefore, only produce the necessary units when you want a defender for a known threat because most attacks will not be a complete surprise.

7. Diplomats & Spies

    Here, we will not talk about Diplomacy. Currently the AI has no diplomacy - Freeciv 1.15.0 maybe has it -.

    With a diplomat you can do mainly hostile actions against other players.

    With a diplomat you can bribe an enemy unit. To do it try to enter its square and choose the bribe option. Only try to bribe technology superior units that yours - if you have enough cash -, if this is not the case just kill it.
    You can also try to bribe the settlers and engineers that you find when you are invading enemy territory. That way you can improve the new terrain with the AI units.

    You can establish a embassy with another player. Just take the diplomat to an enemy city, try to enter it and choose 'Make Embassy' from the actions dialog that pops up. Having an embassy with another player, means that you know which technology has. This is useful if you want to attack that civilisation. Also, you can see its currently researched technology and its goal.

    With a city you can also do all the following activities: investigate a city of an opponent or ally, sabotage a city, steal technology, incite revolt of that city and take ownership and poison a city.

    When you research Espionage you will be able to build Spies, and upgrade your diplomats. The spies are faster than diplomats, and often they survive to its missions in enemy territory.

    The current AI in Freeciv 1.14.0 is not able to attack you with diplomats, but will build defensive diplomats in border cities. The next version will be able to send you diplomat to do some hostile action against you.

8. Technology

    In general, you want to be ahead of all other civilisations technologically. Note however that it is sometimes only necessary to have the right techs, not necessarily all of the techs. You can steal technologies by capturing enemy cities when the enemy has technological advances that you do not, or techs can be stolen by diplomats using the “Steal Technology” command.
    Technology is one of the most important variables in the game of Freeciv. If you're the most productive civilisation, but you are last in technology you will end up being killed. A huge army of Warriors can't stand up to a veteran Cavalry.

    If you see that you're in the lead technologically and need money for buying City Walls, Coastal Defenses, or other improvements, stop researching and generate money; however don't do it for a long period of time as you still want to maintain your technological superiority.

    The strategy in choosing the long term objectives for developing technology differ whether you are alone on an island or on a continent surrounded with enemies.

    When you're alone in an island you can research attack technologies first and then defensive technologies. You must research technologies to build naval units as a priority (Automobile, Combustion, Steel, Magnetism, Navigation, Map Making) and naval defenses (Metallurgy). You must also develop technologies for ground units, however this is not as important as the ability to move your ground units across the expanses of ocean that separate you from the other civ's. The most successful strategy in this scenario is going for Republic, Map Making, Horseback, Magnetism, and Steam Engine.

    If you are in a continent with enemies, it is better to research defense first and then technologies that provide attack units. If you are in the beginning of a game it is recommended to first research 'Horsemen' and 'Bronze Working' to be able to build Horsemen and Phalanx's to resist the AI attacks. Concentrate next on researching Monarchy, and then focus on 'Iron Working' and 'The Well'. Finally, begin developing the technologies that will provide more advanced ground attack units.

    Anyway, try to be in the first to research or obtain Gunpowder ( Musketeers ) and Conscription (Riflemen) as this will give you good defensive units and will disencourage the AI players to attack you.

    One of the most annoying things of the game is the obsolescens of Barracks. When you research Gunpowder this will obsolete all your existing Barracks, but you will be able to produce Musketeers. You will have to build it another time, even though you can use the money earned when selling them. And this will happen another time when you research Mobile Warfare. This event will obsolete Barracks II, but will give you the possibility to build Armor, which is a powerful fast ground attack unit.

9. Wonders

    For a detailed explanation for each of the Wonders follow this link.

    Well, although there are a lot of Wonders that do useful things, here we will only talk about some of them, only the most useful.

    Also, note that the AI doesn't know when a technological discover will obsolete a Wonder, so it will happily build a Wonder even though it's doing to be obsolete in the next turn, and also, it will not try to research an obsoleting technology to stop the effects of a Wonder owned by an enemy. And, again, it will not stop researching a technology which obsoletes an owned Wonder.

    These are the useful Wonders (in my opinion):

    Pyramids: Grants the benefits of a granary to each of your cities. So, you don't have to build granaries in each of your cities. This is useful for the periods in which you don't want to keep your cities celebrating in a republic or a democracy ( war? ).
    Oracle: Obsoleted by Theology. Doubles the effect of each of your temples. The AI hardly will research Theology.
    Great Library: Obsoleted by Electricity. You can try if you're lucky! If the two civilisacions that the server chooses are the ones in tech lead you can stop research and generate cash and luxuries to make your cities grow, if not bad luck!
    Sun Tzu's War Academy: Obsoleted by 
Mobile Warfare. You don't have to build Barracks and Barracks II. So, it means that if you conquer a city with that Wonder you can sell your barracks. It also means, that you must build Barracks III!
    Magellan's Expedition: Gives all your sea units +2 movement points. This is a winner's Wonder.
    Michelangelo's Chapel: Grants the benefits of a
Cathedral to each of your cities. If you are in a Republic or Democracy you'll want that Wonder.
    Shakespeare's Theatre: Makes all unhappy citizens content in its own city. This is very useful to place that Wonder in a production city. That way, you can build huge armies from that city under Republic or Democracy to crash your enemies.
    J.S. Bach's Cathedral: Makes two unhappy citizens content in each of your cities. Another democratic Wonder.
    A.Smith's Trading Co.: Pays the upkeep of all of your buildings that otherwise cost one gold per turn. Very useful for large empires.
    Darwin's Voyage: Immediately delivers two free advances.
    Women's Suffrage: Grants the benefits of a police station to each of your cities. If you want to make wars in a Republic or Democratic government you need that Wonder.
    Cure For Cancer: Makes an unhappy citizen content in all of your cities. Another democratic Wonder.
    Hoover Dam: Grants the benefits of a hydro plant to each of your cities. This is a winner's Wonder. Increases production and reduces pollution.
    Manhattan Project: Want to make World War III?
    Apollo Program: Want to begin the Space Race?

10. Happiness

    For a detailed explanation refer to cities.

    People needs to be happy to live. So, one of your missions in the game is to keep your population happy or at least content.

    There are tree types of citizens: happy, content and unhappy.

    Your first task in the first stages of the game is to avoid your cities falling in disorder. If a city revolts it will not produce food, shields and trade. So, you will loose for this turn taxes, trade and production.
    To avoid this you can do three things:

  • You can increase the luxuries of that city. You can do it modifying the main city dialog. You can do it clicking on a worked tile of the city to free it and make an elvies.
  • You can increase the luxury rate of your nation. You can do it modifying the rate taxes in the rates indicators/controls at the Sidebar of the main map.
  • You can build improvements in the cities that turn unhappy citizens content, for example temples, coliseums and cathedrals.
  • You can build Wonders that keep the unhappy citizens content, so build Oracle, Hanging Gardens, Michelangelo's Chapel, Shakespeare's Theatre, J.S. Bach's Cathedral, Women's Suffrage and Cure For Cancer. This is the cheapest method.
  • If the city or your empire is generating luxuries, you can try to increase the trade that generates the city, because this will increase the luxury output. You can exchange land worked tiles for ocean tiles ( this will reduce your production) or you can build marketplaces, banks or stock exchange buildings ( this will increase your gold ).

    Later in the game you will want to make your cities grown as large as possible. You can do it waiting for natural grow or you can make celebrate your city by increasing luxuries. You can only put a city in rapture if you're in a Democracy or Republic. Basically, its the same as above, but have in mind, that the only way is to increase the luxuries, which will reduce the science and tax output of your cities. You can try to build improvements to turn unhappy citizens content, but this will not help you if there aren't unhappy ones.



[Prev in Thread] Current Thread [Next in Thread]