Announcement

Collapse
No announcement yet.

DESIGN: AI Improvement discussion

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

  • DESIGN: AI Improvement discussion

    I think that we can agree that one of the primary concerns for an improvement to CtP2 that we'd like is in an improvement of the intelligence of its AI.

    While we look like we could have the source code necessary to make changes, its certainly not a simple task to make improvements, especially when what needs to be changed is undefined.

    I thought it would be a good idea to start a dialogue on the more complex issues, so we could define and discuss problems and solutions in a structured way.

    As a starting point, I think its important to say that the goal of any improvement to the AI code , is not to make it smart itself in ctp2.exe, but rather to allow the AI files more scope and through those to act in a more effective way. There may be necessarily improvements such as more complex mapping or so on, necessary, but without investigating what the problems are, how they could be approached, and how to implement them, we don't know.

    ---

    The AI point I'd like to raise is AI city management.

    In many ways, this is the foundation for the AI. Without effective city development and management, the AI doesn't have resources to compete. While it is possible to give artifical bonuses to the AI to counter this, I think its important to ensure that the AI does a more effective job with what it has.

    In my view things that could be improved are:

    -City Placement (and settler behavior in general)
    -Terrain improvements (and terraforming considering how it can be subsequently improved)
    -Dealing with happiness in individual cities, rather than civ wide as it does now
    -Wasteful changes in building (changing from almost done wonders to build a warrior, for instance)
    -Better, more flexible definitions of buildings, and real building queues for the AI

    Does anyone have any comments? Any problems that you've consistently noticed that the AI has in city development? Any specific feature in the AI files that you wish you had?

  • #2
    Well, IMHO, a better AI does always provide better civving experience. Another reason why I like Civ 3, it has a good AI.

    One thing is, about CtP2 AI, it will often take a city with an "attacking stack", and march it out the next turn, leaving the city empty. Easy prey...
    Solver, WePlayCiv Co-Administrator
    Contact: solver-at-weplayciv-dot-com
    I can kill you whenever I please... but not today. - The Cigarette Smoking Man

    Comment


    • #3
      The way the AI moves is important, but is really a different discussion... I have been developing strategic movement AI ideas for a while and stumbled across more material that can help. I'm working on optimization ideas for them, since they are pretty costly right now.

      Comment


      • #4
        Just couple of remarks from my side:

        The AI never builds in a way, that it could easily defend it's cities, like having center cities, which are hard to reach.......
        Out of this maybe having different building queues/priorities for certain cities, meaning having outer cities concentrate on units, inner ones on wonders/buildings.

        Maybe having different queues according to current strategy, i.e. if hapiness < 74 use hapiness-list, should enable it do get rid of the civ wide mode........


        Might come up with some more tomorrow.............

        Comment


        • #5
          The AI has really no directional sense in general, and in particular in relation to its building cities. Its feasible my work on threat mapping (it was adapted from work in electrical engineering, if I recall correctly) could substantially improve the 'understanding' of the AI.

          Once the AI understands where threats are, and what "close" and "far" are, with regards to its cities, it can act more intelligently.

          As I've stated before, awareness of its own continent, and other continents are important considerations for the AI, which I'm unsure is taken into account now, while human players concentrate on continents, and do well because of it.
          Last edited by MrBaggins; July 30, 2003, 12:24.

          Comment


          • #6
            Originally posted by Solver
            One thing is, about CtP2 AI, it will often take a city with an "attacking stack", and march it out the next turn, leaving the city empty. Easy prey...
            This is number one on my list too. The default game was too-defensive-oriented (the AI never attacked but its cities were usually well-defended) and Frenzy did the opposite. I'd like to see the AI strike some sort of balance especially when encroaching into my territory. Take a city and force me to fight to retake it...

            I'd also like to see if there is a way to help the AI make some military alliances and then actually follow through with an actual (somewhat) coordinated attack.

            My impression is that the AI actually does a good job of infrastruction/city building useage, based on what I saw in Cradle. Obviously it could be better, but it's not bad.

            As for happiness management, that can be improved...Of more importance is to get the AI to recognize happiness caps based on empire size.
            Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
            ...aisdhieort...dticcok...

            Comment


            • #7
              Yes, AI infrastructure can be quite decent. It does, though, make extremely poor work of units it gets.
              Solver, WePlayCiv Co-Administrator
              Contact: solver-at-weplayciv-dot-com
              I can kill you whenever I please... but not today. - The Cigarette Smoking Man

              Comment


              • #8
                I'm not so sure about this.

                I usually, and I'm sure most others do, play CTP2 at levels where the AI starts with significant advantages in an extra starting city, PW and gold.

                I don't believe that you can adequately assess the capability of the AI when considering that it has a headstart.

                Even so, if you play vs one other AI player, on a reasonably large game world, then you can reliably out perform and out produce the AI by 0 AD, repeatedly, even discounting serious military engagements, on Emperor or Impossible.

                This says to me that some part of the AI's development strategy is flawed.

                Even small improvements will stretch the AI's competitiveness into later into the game. We might as well forget about later in the tech tree otherwise.

                Comment


                • #9
                  Ahh, but obvious cheating removes the fun for many. If the AI has its cities grow way faster, starts with an extra one (HUGE advantage), then it's hardly that fun anymore, is it?
                  Solver, WePlayCiv Co-Administrator
                  Contact: solver-at-weplayciv-dot-com
                  I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                  Comment


                  • #10
                    Tile Improvements:

                    The AI has no sense for it what its cities need, or is everything else then usefull. In the current system it looks like the AI checks the boni of the terrain and improves the things on the terrain that is already very good there. For instance if a terrain produces, 10 gold, 20 production and 30 commerce, the AI improves the commerce with the improvement with the highest commerce bonus available. That's why you see in the default game deserts with trading posts and shopping malls, but not in Apolyton Pack for instance. This leads to the fact the AI builds on a terrain type only one type of improvement. Only a river can modify the AI TI building behaviour.

                    So the AI should check if a city needs a mine, a farm or a trading post, and asign to each a value what is needed and should select the one with the highest priority.

                    Also the pop assignment must be improved, the AI has to check if a city is unhappy how much is lost if it adds an entertainer in comparison to a global slider adjustment, of course it has to consider the fact that entertainers can be freed then. But entertainer usage has to be tied on the happiness level of a city. More difficuild is the usage of all the other specialists. But possible conditions could be a low level of food for the farmers for instance.

                    I don't think the current build list are such a good idea, maybe the only function can be what the AI should build, but it has to build a theater for instance if the happiness is low, gold improvements if the gold income from the city is low and so on, the AI should be allowed to change from a unit to a building immediatly, but it should be more difficuilt for wonders.

                    Stack composement is another story, the AI needs to know how a stack must be composed and should build accordingly new units.

                    Then something like a map is need for threat level of a certain tile or a certain region.

                    An invasion code is needed, so that the AI knows how to invade an enemy by land and by water.

                    Code for Aircrafts is needed the AI needs to know how far such a thing can fly with its fuel. And it needs to know that it shouldn't group land units and aircrafts within one stack.

                    Also land stacks with special units and civilians should be taken in consideration for attack, but the AI needs to know that civilians have to be removed from such stacks, if it should go into the battle.

                    -Martin
                    Civ2 military advisor: "No complaints, Sir!"

                    Comment


                    • #11
                      From the experience gained by hours of play and specially as former Minister of Defense of the CTP2DG I want to give some ideas on how the AI should think (thats a simplification of my way of thinking).

                      Attack Strategy
                      The CTP2 AI thinks as if every stack has too much autonomy. Every turn the AI looks for that stack in particular according to its location and other stuff we find in the goals.txt.
                      Instead we should give the AI a strategic mind. Make it find the best oponent to attack (distance from closest cities, strenght, regard, etc...) and from this oponent choose one/some good targets (city, unit, army, etc...) and move all of its units to destroy/conquer the target by using coordinated stacks movement.
                      Defense Strategy
                      Making units too far from the target occupying the place of the ones closer that will be sent to war. Patching the defenses. Of course respecting the minimal defense force to protect the cities so that it doesnt remove units from a city which needs to have greater defenses (Therefore create a threat Level which shall result in the number of units to defend).
                      Divide the empire map in regions and make the defenses not only grouped in cities but find out the best places to have a unit groupage/defense area (closest spot to a greater number of cities considering this cities empire importance).


                      I will try to do a scheme of the ideas i just wrote. But i wish some feedback first.
                      "Kill a man and you are a murder.
                      Kill thousands and you are a conquer.
                      Kill all and you are a God!"
                      -Jean Rostand

                      Comment


                      • #12
                        Martin - that's a pretty exhaustive list, and something that can give the team a looooong time to stay busy .
                        Solver, WePlayCiv Co-Administrator
                        Contact: solver-at-weplayciv-dot-com
                        I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                        Comment


                        • #13
                          Originally posted by MrBaggins
                          I usually, and I'm sure most others do, play CTP2 at levels where the AI starts with significant advantages in an extra starting city, PW and gold.

                          I don't believe that you can adequately assess the capability of the AI when considering that it has a headstart.

                          This says to me that some part of the AI's development strategy is flawed.
                          I think it is impossible, on a totally level playing field, to tell the AI what to do, because it is hard to put a finger on what exactly is the best action in all situations, given that there are infinite opinions on possible strategies and priorities.

                          I mean, how do you tell the AI what it should be doing in 30 turns? Should it expand by military means, and thus build more units that will then attack a rival - or peacefully by building improvements and settling more cities? Should it trade more, or spend more on tile improvements? Will it see the preparations that I may be making now as a threat to itself 50 turns from now?

                          Should it focus on gold, food, or production - and when should it do that? Should it max out a slider at the expense of another? Or should it max out production to build some buildings that will give it more gold/food. How much should it devote to PW, and when should it put the production elsewhere?

                          All these decisions are subjective and are also tied into the need to take a global overview.

                          So programmers will give AI bonuses to aid the AI. Not a pretty solution, but IMO, an acceptable one, because it gives the AI a cushion in all areas - to reduce the need to think subjectively.

                          Again, I go back to my testing with early versions of Cradle. Even on the lower levels, and before the additional PW cheats that were added to my Mod, I was suprised that the AI did a pretty good job on infrastructure issues and city buildings. Not perfect, but much better than I expected.

                          What I do know about the the AI is that it cannot afford to stay small. Most Civ games are a game of numbers - bigger is better... (with the possible exception of EU2, which has built-in penalties for size.) CTP2 tries to do this with empire caps, but the AI does not recognize the cap as a threat to itself. In the default game, the AI usually stayed below the caps, to its eventual downfall. I would warrant that is the main reason why you out-perform the AI. Take a look at the number of cities you have in comparison to the number of cities each AI civ has. That is why you catch it

                          I'd like to see the AI have the ability to recognize the cap for what it is.
                          Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                          ...aisdhieort...dticcok...

                          Comment


                          • #14
                            Hex is right, even with mods, you will often see an AI civ with 8 huge cities, but those are no match to a human player 50-city empire at any rate.

                            AI needs to have plans... a clear idea of what it's doing. And, for defense plans, let it build military road networks.
                            Solver, WePlayCiv Co-Administrator
                            Contact: solver-at-weplayciv-dot-com
                            I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                            Comment


                            • #15
                              I think decision making for an AI in this case is difficult but not impossible.

                              If you think in terms of boolean logic, and try to invent rules, then, yes, the complexity of rules that would be necessary to form judgements would be overwhelming.

                              If you take a more "human" approach and define comparable values, then use comparisons and baseline values to make decisions then the system is somewhat simplified.

                              Civ3 uses this approach: it uses values in the bic file to make value judgements, combined with world data and logic.

                              I think in large part, the CTP2 AI is slavishly following the build lists, alternating between military and civil construction based on a formulaic 'need' for troops.

                              These lists are human derived and essentially fixed, making the AI strategy basically one dimensional.

                              Making a new valuation system and tying it into a strategic overview system is no small task. It might be worthwhile investigating if we can do it, however.

                              ---

                              Having said all of this, city caps are more pressing, and the science paths civs take to get to the appropriate governments are vastly influential too.

                              I also concur with Martins comments entirely.

                              Comment

                              Working...
                              X