Announcement

Collapse
No announcement yet.

AI questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AI questions

    So, I was wondering if people could tell me some of their best strategies for beating the AIs? In particular, what does the game allow you to do that the AI should do, but doesn't?

    Thanks for the input, guys!

    Chris Pine
    Lead Programmer
    Civilization III

  • #2
    Hi Chris, thanks for asking! There is an awful lot of good stuff in the AI part of the suggestion list for Civ3. I'd suggest giving it a quick read if you haven't already.

    Here's my own brief critique of the AI in Civ2 (Based on limited information I don't think SMAC is much better). I'll suggest a couple of obvious improvements the AI could use (IMHO anyway). Since I'm a programmer I'll start couning with 0... ;-)

    0) AI needs to expand more quickly, especially at the start. It is waaaay too conservative, and incurs huge "opportunity costs" in size due to slow expansion. The AI should also build cities in niches on the shore that have only a few land squares but could develop into decent sized cities with a harbor...


    1) AI should mass units for attacks (right now the AI throws individual units at enemies)

    2) AI should have some concept of distance and "striking range" of each civ. I chuckle every time I extort money out of an AI civ half way around the world, that I'd be Very
    fortunate to wound in the slightest way. The AI also caves into pressure Much too easily
    IMO. It should take a Very serious threat to make it give up money or tech.

    3) AI needs to understand the probablility of success of attacks. NO more attacking fortified units on mountains.... (this may have been improved in the recent products of the genre)

    4) AI should properly execute surprise attacks (rather than not attacking at all, or with a single unit). When a human surprise attacks it is usually with masses of troops on the frontier or offshore. So you should have a flag tripped when the AI Wants to surprise attack, and then it should wait for troops to be massed before it actually carries out the attack. AI also needs to know what the player can see to do this well. That's so that massing troops doesn't just give the player advance warning.

    5) AI should build more diplomats/spies and Use Them. Even used in a ham-handed manner they are pretty nasty. Bribing cities when enemies have a pile of units around the city are especially damaging to the enemy. If you could add logic to let the AIs use the ZOC-cancelling functions of diplos and spies AI attacks and counter-attacks could be Much more devastating.

    I haven't included anything in this list that is particularly hard IMO... I think just improving these could help the AI to be a significantly better challenge.

    When you get into difficult things I'd add a notion of geography: with this goes fewer defensive units in interior cities, control of strategic choke-points on the map, knowing who natural allies are against an enemy (what good is an ally that can't Reach the enemy?)

    That's probably enough ranting for now

    Good Luck!

    Project Lead for The Clash of Civilizations
    A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
    Check it out at the Clash Web Site and Forum right here at Apolyton!

    Comment


    • #3
      Do you mean from civ2 or SMAC?

      From SMAC, I have a few off the top of my head suggestions:
      - have the AI build roads straight from one base to the next rather than filling all squares with roads. Filling every square with roads is such a waste of time. The "construct road to" command is great and works well, (I use it all the time) but the AI doesn't use it.
      -be better at placing new bases. The AI squeezes bases as close as possible when placing bases more apart would use the city radius more efficiently.
      - coordinate battles with allies. The AI often has enough units to try an attack but it keeps the units endlessly circling its base. Even when I asked the AI to attack a specific base using the "coordinate attack" option in diplomacy, it didn't.

      In terms of strategies I use, that the AI should copy:
      -I use amphibious assaults very often. put as many infantry/rover units as possible on ships and land them on enemy shores within striking distance to attack on the next turn.
      -I often attack where the AI does not expect, like on the opposite side of where we are fighting. The AI then has fighting on both sides.
      - for units with more than 1 mvt point, I move then close enough so than they can attack on the next turn, but not adjacent to the AI base. For example, a rover has 2 mvt pts, so instead of moving them adjacent to the enemy base to have 2 pts to attack with on the mext turn, I move the rovers 1 tile away and wait to the next turn to attack. And, I attack with all my rovers at once.
      - once air power comes around, I always use my air force first then move in ground troops. If the enemy base was weak enough, my airforce often wiped everybody out, my ground troops can just walk in.

      Thanks Chris Pine for asking about the AI.
      Just be prepared to read A LOT of stuff.

      ------------------
      No permanent enemies, no permanent friends.
      'There is a greater darkness than the one we fight. It is the darkness of the soul that has lost its way. The war we fight is not against powers and principalities, it is against chaos and despair. Greater than the death of flesh is the death of hope, the death of dreams. Against this peril we can never surrender. The future is all around us, waiting, in moments of transition, to be born in moments of revelation. No one knows the shape of that future or where it will take us. We know only that it is always born in pain.'"
      G'Kar - from Babylon 5 episode "Z'ha'dum"

      Comment


      • #4
        In Civ 2 the attacks were not planned well at all. The AI just threw units at you instead of making a game plan. They seemed to not know how to set up a strategic war. That's my only complaint.

        ------------------
        ~~~I am who I am, who I am - but who am I?~~~
        "Oh, they have the Internet on computers now!"

        Comment


        • #5
          As someone who has programmed AI in games, all I can say is good luck. Folks here have very high expectations. For me, what OrangeSfwr said is the least I would hope for.

          Comment


          • #6
            I am also very glad you asked. Thank you! The problem is to know where to start.

            I begin with a remark: on many issues I think the rules of CivII have to be changed. But all my remarks here apply to CivII as it is now. And it should be pointed out that I have only a very dim notion of the way programming AI works.

            -It is obvious the AI doesn't have a plan and doesn't recognize an emergency. It doesn't understand whether it is weak or strong and is capable of making outrageous demands when it is on the brink of disaster. It doesn't comprehend what it most needs in an emergency. When its capital is conquered and its Palace destroyed it needs Masonry to build a new Palace, not Gunpowder or Railroad. When it happens to start on a small island it should research Map Making to build ships and colonize other continents as soon as possible. When I would gladly help an ally by giving it Flight for free when attacked by Bombers, it will not accept it but ask for Space Flight instead. The AI waits normally way too long before it changes to Monarchy.

            -In general the AI should explore more. Its units very easily end up in a loop, making every turn the same movement and never passing a bend of the coast. The AI also tends to explore in one direction making its capital extremely vulnerable, because it lies not at the centre of its empire but on one of its borders.

            -Border defence of the AI is incoherent. It will often forget to build City Walls in an important, but rather vulnerable city. Often a harbour town will not get the Coastal Fortress it deserves. And it very often builds Fortresses without garrisoning it, thus helping the attacker who gets a strategic bridgehead. I will only build a Fortress on the border and station troops within.

            -The difference between land and sea seems for the AI an insoluble problem. Quite often it will concentrate half of its fleet in a small lake, where it is totally useless. Only by accident will it build a city on an isthmus, where it would act like a canal. A caravan just ends its voyage on the coast of one continent, never arriving on its destination, while its owner often has a huge fleet of two hundred ships of the line, all concentrated around its capital and blocking all naval movement, even of the most harmless Transport with Freight. When there is some virgin territory, fertile and spacious, the AI will generally prefer to found a colony nearer to home on the Tundra.

            -In my opinion the settler unit is the true hero of the game: it costs a lot of shields, eats food, but is also capable of bringing about the most important changes: founding new cities, building roads, mines etc. It is vulnerable and should be well protected. The AI will send it to the war frontier, without any escort, where it will often meet an inglorious end.

            -Supply management is not one of the AIs strengths. In general it tends to build too many units. In a city producing ten shields every turn only it will continue producing units until it takes fourty turns to produce one. Or it will build a new settler when there is certainly no food surplus, causing shortage. As far as I know it almost never disbands units to upgrade them, nor will it change the city out of which supply is provisioned. So we do regularly meet some amiable Archers or Frigates in the Nuclear Age.

            -Often the AI forgets to build a road, which takes only two turns, in a tile it exploits and has irrigated, thus missing out on trade revenues. And of course its mines will not be provided with Railroads, while most Forests will be cut down. I belief it never changes any terrain to Forest, which in a region without Hills could boost shield production. Simultaneousy their Engineers roam about aimlessly or build Railroad in Farmland where it adds nothing to production, though it might help foreign attack.

            -Often their choice of improvements is rather illogical. It builds the same Wonder in five different Cities, or tends constantly to change its capital when there is no apparent danger. When the Wonder is built somewhere else, it will not change to another Wonder but prefers to build a Musketeer: about 300 shields are lost. Often a Factory is build in a city without significant shield production, or a Bank in a city without Trade. The AI prefers to build a Colosseum or Sewer System in a City of four heads, while the much cheaper Temple is omitted. Neither seems it to rate a Granary, an essential improvement in my opinion, at its true value.

            -The AI Civs seem never to have grasped the concept of budgeting. They spend money and luxuries in imitation of Louis XV: 'Après nous la déluge!' Because of massive cheating it will not ruin their empire, but it irritates the hard-working, honest Civer who has to think before he spends his money. Their royal coffers turn out to be inexhaustible, though they spend 40% of the budget on luxuries. And it is quite possible under Democracy with only 10 or 20% luxury to make a yearly profit and still invest in research.

            -The AI inclines to stack units, while with the current rules that only makes them vulnerable to heavy losses. Only for slow units with a low defense value, like Catapults and Cannons, does it make sense to combine them with stronger units. The AI very often sends those in the open, an easy prey. And I hope the AI will learn to use the defensive possibilities of some terrain types. Nor should it sacrifice five Cruisers by attacking a city protected by a Coastal Fortress. Shouldn't it remember how well a city is protected, only attacking when its defenses are weak? It could use its Diplomats and Spies to examine city defenses. Would it be possible to change the order of moving? Often the AI starts an attack with the wrong unit.

            -I think it should be possible to program the AI in such a way that it controls the happiness of its citizens more efficiently. It was one of the easiest things for me to learn, especially since happiness is almost 100% predictable. Build a Temple as an essential improvement, a Marketplace and Bank when there is some Trade! Under a Democracy most units should just stay home. And why not use other specialists than entertainers to make more money or research?

            Basically the faults of the AI are easy to point out, at least for a human. Solving the problems will probably be very difficult.

            I think many posters will send their contributions on this very importantissue. Thanks for all effort! I hope CivIII will be a REAL CHALLENGE!!
            Jews have the Torah, Zionists have a State

            Comment


            • #7
              one thing I forgot to mention that is very important:
              -teach the AI not to trade its supercity in exchange for my small city.
              If the city has an invaluable Wonder, the AI should never trade no matter what!
              'There is a greater darkness than the one we fight. It is the darkness of the soul that has lost its way. The war we fight is not against powers and principalities, it is against chaos and despair. Greater than the death of flesh is the death of hope, the death of dreams. Against this peril we can never surrender. The future is all around us, waiting, in moments of transition, to be born in moments of revelation. No one knows the shape of that future or where it will take us. We know only that it is always born in pain.'"
              G'Kar - from Babylon 5 episode "Z'ha'dum"

              Comment


              • #8
                Just my final 2c before I shut up. The AI can be 'taught' or 'learn' or 'have a plan' if it is programmed to recognize certain conditions from many variables. In a consumer-based game such as Civ3, there are only so many variable and conditions that can be practically programmed. What most of you are asking is intelligence similar to humans in factoring many variables and conditions to make the best choice. I just don't think that's possible given the many other complexities of the Civ game. Even the best programmed wargame doesn't have a much greater sense of coordinated attacks from the AI than Civ2. Should we expect the same for Civ3 given that warfare is but one of many parts?

                Comment


                • #9
                  When at war, the AI should be able to decide wether this is just some sort of cold war or if it will involve real fighting.
                  The AI should then, make proper attack plans. At first, it should look, if it has a large enough army to already launch a successful attack. Never launch attacks that dont achieve anything at all (meaning, its useless if they run and run against my city wall all the time). Now if the army is large enough, build supporting troops and send the army into battle.
                  Dont however send it, if the player is much to far away. In this case, rather go into defensive mode.
                  So yes in the beginning of a war the AI should decide wether it should go defensive or offensive. If the player is no real threat and is not worth to be conquered (no valuable cities and/or terrain) or is just too far away, go into defensive mode. There the AI just looks that its defenses are up and prepares itself from possible surprise attacks.
                  When however the player is a threat (near and strong) or sits on valuable land or has valuable cities the AI should go into offensive mode. There the AI only builds up defenses in the frontier cities, while the back cities are producing offensive units. However, the AI should make sure, if offensive units that would be produced would ever engage in combat. So that those cities that lie 20 or more tiles away and have only little production, dont bother much about unit-building.
                  After the defenses on the frontier cities are up, these are to produce offensive units too.
                  But as for defenses and frontier cities there is another thing to consider. If the offensive army the player has is valuable and can bear with the job to hold off any invaders, the AI shouldnt care about building defenses. In this stage, the offensive units would be used for defensive purposes. When then finally the newly produced offensive units enter service they go into attack mode.
                  If the first attack fails, make sure the AI knows if the Enemy has sustained damage or not. If there was no damage inflicted, mass more troops or if it is a hopeless situation go into defensive mode (hopeless situation is when with the current technology you are not able to inflict much damage upon the enemy). When however, nearly all of the defenders were killed: GO! GO! GO!
                  Also, after the enemy has taken a city of the AI, the AI should take strong effort to get it back ASAP. For example when I take a city, but only 1 or 2 units survived and are now defending, the AI shouldnt wait, till I have my defenses up. Of course this depends, on wether the AI could achieve something or not. If it cant achieve a victory or cause heavy casaulties, go into defensive mode. But well in most cases its best to start a broad organized counter-attack.

                  Never target a single city with your whole army. Depends of the army of course. For large armies, I suggest splitting them up and going for different cities. This would be also the ideal tactic when you want to surpress the enemy, so that you can build up either more offensive units or more defensive units. When the army is smaller, you can either choose a guerilla tactic or mass it altogether and try to capture a city.
                  Even if the enemy is able to capture the city back next turn, you have inflicted heavy casaulties! Of course be careful, when you are technically advanced and the option to get an advance when you take a city is on, dont go for this tactic and make sure you can hold the city you are capturing. If you are not able to hold a city go for it. Capture it at least for one turn. Of course this depends on the importance of technology you have over others.

                  Use air attacks to soften cities before you waste your ground troops.
                  Use ships to soften cities. Use anything to bring the defenses of the city down, before you are going for capturing it.
                  Also use spies to destroy city walls.

                  Lurking around a city will let the enemy stay in the city. So you can maybe win a few turns, that you need. Even if the army is not very large or powerful, two seperate stacks lurking infront of a city can achieve that the enemy, doesnt go out. This can give you the required turns. So, yes military units have a purpose besides fighting.
                  Remember a lot of bullets in a war are just shot to make the enemy duck!

                  Send scouts in the enemy terrain and watch how many turns it gets if they are slaughtered. This way you will now if the player has offensive capability in that area. Of course the AI knows if the scout was defeated with defensive or offensive units.

                  Try to make alliances with players near your enemy and tell them to attack them.

                  Never head into too much wars at the same time. Especially not if they lie close to you. A war with 3 of your neighbours is deadly. Rather pay some tribut to one or make alliances with neighbours of them, so that they cant fully concentrate on you.

                  So much for now, sorry that this is quite confusing written.
                  Ata

                  Comment


                  • #10
                    I think the biggest thing that would help AI invasions is follwing through with what they start. Often they'll unload a single transport with some troops (especially in SMAC) and put me off balance for a turn or two, but I can quickly turn the tide.

                    If that transport was followed up with another the next turn, and another the turn after that, and so forth, I'd very probably have a much rougher time.

                    I suppose it's quite hard for an AI to recognize it has a short term advantage that it has to push quickly or lose, but I think that would be a big help.

                    Feints would be nifty as well. A single transport or two lands (or land attacks) so that the player thinks `I'll just go mop this up' and sends thier forces over to the invasion, when the AI is actually planing on hitting them with most of their troops somewhere else far away within a few turns.

                    Joe
                    [This message has been edited by Joe Bourque (edited June 15, 2000).]
                    Joe Bourque

                    Comment


                    • #11
                      As Mark_Everson said, a major thing (in Civ2) is that the AI has a tendency to not mass units but rather throw a rare few at you. I ALWAYS am a defensive, prefectionist civilization, which leads me to be able to repel any low-scale attack which the enemy throws at me.

                      Another thing. There are a rare-to-few cities which the AI defends well enough. I (persionally) always try to have at least two defensive units in every city, and city walls. Even the most perfectionist of civ2 civilizations have a tendency to leave there cities ungarded in such a way that they can be taken easily by a well coordinated, large attack (esp. one that includes cruse missles).

                      ------------------
                      adaMada
                      adamada@springmail.com
                      [This message has been edited by adaMada (edited June 15, 2000).]
                      Civ 3 Democracy Game:
                      PTW Game: Proud member of the Roleplay Team, and Ambassador to Glory of War
                      Intersite PTW Game: Member of Apolyton

                      Comment


                      • #12
                        Hehe, good luck you guys. I'll be content if the AI makes good empires and can plan an attack. Or attack my back side with an ally or something. But at least make them able to sack a Civ.

                        ------------------
                        I use this email
                        (stupid cant use hotmail)
                        gamma_par4@hotmail.com
                        Don't ask for golf tips
                        Your game will get worse
                        HappyLand
                        There is no spoon,
                        But there is a knife

                        Comment


                        • #13
                          The best thing I think could be done for the AI is to leave a great portion of it open to be programed by a 0 level 'hacker' (as civ/SMAC allow in the .txt files). But allow more than is available now. FE, if I switch missiles in to affect air units, have the AI actually ATTACK air units with them. Allow allies that can investigate AI cities to "set up" the city for them, and have the AI capable of determining if the new set up is better than what it had for the task at hand (FE, it will not accept smaller mineral production when building a Wonder). Allow the player to alter a .txt file that improves the AI play: preferences for terraforming, ranking for wonders, build preferences for city improvements, etc. Of course the player can mess up the AI if he wants to but we can do that now. Hopefully after lots of play a group of players will determine what is the optimum configuration for the AI and players will set them up in that fashion when desiring a challenge.
                          I'm consitently stupid- Japher
                          I think that opinion in the United States is decidedly different from the rest of the world because we have a free press -- by free, I mean a virgorously presented right wing point of view on the air and available to all.- Ned

                          Comment


                          • #14
                            Theben has is exactly right (again), although I'd prefer to take his idea further. It would be great to have every characteristic of each unit defined in text files, with an open-source modular AI, perhaps based on something like a Visual Basic scripting language, that provides a decent default AI, and also allows an advanced user to go in and modify either the weighting system that the AI uses to make its options, or to modify the AI's logic or decision-making process itself.

                            Comment


                            • #15
                              Programming AI is hard. Programming AI for strategic decisions is a lot harder. Consider the purest strategic game, Go (or Weichi, in Chinese). No competent computer programs have been developed, although its rules are much simpler than Civ 3.

                              One suggestion: the AI should think when the human player is making moves. That should allow the AI a lot more time to evaluate the situation. I am sure that's already done, but just can't be sure. After all, just sitting there while waiting for the human player to move is a waste of time.

                              An area of improvement for the AI is it never considers relative strength. Therefore, it has no idea whom it should threaten and whom it should appease. It's funny to watch a computer player making silly demands when I am capturing its cities left and right
                              (\__/) 07/07/1937 - Never forget
                              (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                              (")_(") "Starting the fire from within."

                              Comment

                              Working...
                              X