Announcement

Collapse
No announcement yet.

AI improvement via non-SLIC

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

  • AI improvement via non-SLIC

    Anyone else still looking at improving the AI without SLIC? I've gotten a much smarter AI without using SLIC to this point but there are still some quirky things it does that confuse me. In particular how does it set its strategies. If we can control the intelligence of strategy picking by the AI, the game actually does seem to work. I have the AI using diplomacy fairly well. I've seen countless wars between the civs where cities change hands repeatedly. I've even been attacked by large multiple stacks. But I have also seen a civ that is losing a war with another civ, not move the over 70 units that it has just sitting around. I also had a stack worn down by multiple stacks, then just when i was surrounded and too weak to survive another attack, it offers a cease fire. Talk about no killer instinct.

    I'd like to have a place where people could list specific changes to files and their specific results, much like the post about increasing time in the const.txt. You definitely see better decisions by the AI later in the game, but not too much difference early.

    Decreased unit costs has a HUGE impact on the AI's ability to wage war. Before reducing costs (25-33%), i rarely saw AI stacks of more than 6. Now I see stacks of 10-12 running all over the place. Since the AI uses the matching criteria to determine whether to attack, the smaller stacks rarely had the firepower necessary to attack entrenched armies. With the larger stacks, they attack more frequently and entrench alot less which also promotes more combat. But again, if you run around with 12-unit stacks, they probably dont have a mixure of units that will make them strong enough to attack you.

    I also increased movement factors slightly. The AI tends to think only about this specific turn. The farther it can move in that turn, the more options it will consider.

    Always, i hope ya'll get the gist of what I'm asking, so if you have a specific change, plus post it under this thread.

    ------------------
    History is written by the victor.

  • #2
    Generally, I'm not in favor of reducing the cost of a unit, because what you are doing then is also benefitting the player, allowing him to build more military himself.

    But with the production adjustment in the diffDB file, that helps the AI have a bonus of whatever you want. Certainly not the ideal, but workable, and it was a good workaround.

    As for unit selection, there are line of type in the strategies.txt file that breaks out the percentage of what the AI will build, so maybe tweaking those in conjuction with some creative relabeling of unit designations (calling a Knight a defensive instead of an attack or flanker unit in the units.txt file) will cause the AI to build more of them. You can also designate a higher level of devoted production for support costs in that file, allowing the AI to field an even bigger army without disbanding older troops, and raise the level of what the AI will tolerate for being in an 'At War' status. But these have to be balanced with the AI needing to maintain a growing infrastructure so it also does not find itself losing the tech war in the long term.

    The one thing I would like to see fixed is the purely defensive stacking of the AI, especailly when faced with enemy units. I've seen 30-40 units parked outside of a city that I was attacking, and I was able to whittle down those forces without being counterattacked, before tackling the city. The AI had me seriously outgunned in numbers and could of taken out my stack if it employed a 1-2 punch, but it didn't do so. So I attacked, pulled back a bit and kept sending a steady stream of reinforcements.

    And does anyone know what the Power Points line for each unit refer to in the Units.txt file? I do not have a clue on that one.
    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


    • #3
      I agree with all your points. At first I also bulked at lowered costs, but modifying the diffdb alone didnt give make the AI much better. Dont forget, as shipped the harder levels mean the AI simply starts far ahead, at which point the diffdb would handicap it since it was way ahead. I originally figured the barbarians would be my greatest threat and tweaked the risks file so that they are "modern"(BARBARIAN_RANK_MAX 2), numerous (MAX_HUT_BARBARIANS 6 and MAX_SPONTANEOUS_BARBARIANS 4), and frequent (BARBARIAN_HUT_CHANCE 0.5 and BARBARIAN_CHANCE 0.25). I found that unless i had 4 or 5 units defending a city by turn 20, the barbarians would wipe me out very quickly. By not starting the AI so far ahead, they arent handicapped and they greatly outproduce me. Since the barbarians prefer attacking the human player, my super aggressive barbarians keep me from steamrolling over the AIs as I'm constantly replacing lost garrison and scouting units. Every game i lose at least one major city to the barbarians and the civs collectively lose at least 3 or 4. i also think this is more realistic as barbarians were as much a historical threat as any nations. So altho it would at first seem that lowered costs benefit the human, with the other changes, it has actually made for a very competitive and enjoyable game. its not usually until at least 1500ad that I take the lead. I'm in the process of determining why the AI civs consistently seem to fall behind at that point. My guess is that I've not tweaked the advance build lists properly and they are researching something that hangs them up. Every game at least one civ and in many cases, most of the civs will get to gunpowder before me, but then i get to tanks first and then its over. I've also tweaked the unit types but be careful because you get some really screwy battle lines if you arent careful, like machine gunners in front of archers, ships in front of land units during a land battle, civilians in front line, etc. I've upped all the military support percentages (strategies.txt) to at least 35% and you are very correct that that is a necessity, but it seems to come into play only as the support costs get higher as the AI is far below the shipped percentages early in the game.

      Ultimately it comes down to playing style. I'm a controlled expansionist meaning i dont go out to conquer the world from day 1. I build some scouts, a garrison, then start on buildings. I build settlers (which are still expensive) when I find strategic or highly productive locations and I only use force when my borders need additional room or I've been attacked or encroached upon. I figure the results have spoken for themselves as I'm usually on the defensive until at least 500bc and usually much later. The AIs will beat me to about 75% - 80% of the wonders and feats. i've been down to my last city as late as 200ad (didnt take the lead in that game until 1970s). had multi-ship ai navies attack me and been invaded (8 units, 2 of which were settlers) via naval transport. I've seen civs fight long pitched wars among themselves (in one case the barbarians finished off the one civs last 2 cities, hows that for realistic!). All this without any SLIC coding.

      Even with these results, the AI still does whacky things and there are too many flags in too many files for me to figure out what each one does on its own so I'm hoping that others will lend their knowledge

      ------------------
      History is written by the victor.

      Comment


      • #4
        Currently I'm testing the early game setup situations in my mod. Some interesting things occuring regarding Barbs...

        I've bumped up the Barb setting in the risk file at about the same level as what you have, though I do not have the goody hut chance set so high, and also bumping up the setting to make them a problem for longer in the game

        What I've found to happen is that in just about every test I've run, the Barbs manage to take out a civ early. Then they continually crank out military from their cities they have captured. If the Barb civ is far away from me, then they become a thorn in the AI's side. From a personal preference, I would rather have the original civ in place and the Barbs be an ongoing irritant, but not to the point of having the Barbs overrrun everyone.

        On the flipside, I like the fact that I continually have to keep my cities well-defended, as they are constantly popping up. And when they attack a city, even if they lose, they often reduce the pop of that city, setting me back a bit.

        What I may do is push back the starting time for barbs from the default setting of 20, allowing the AI civs a chance to establish themselves. Any opinions on this?

        A question - how much percentage-wise did you reduce the cost of units? In my setup, I went in the opposite direction for units cost, bumping them up a small amount. (but this is because of the AI boost in DiffDB and the fact that in my early game, there are only military and settlers to build on the tougher levels, as improvements are pushed back) I may have to reverse that trend.

        Swiching AI build priorities in the AdvanceList.txt file should help - you may have to determine just what is effective for the AI to build though (and once again, this is a subjective matter), and that may mean having it build something first that goes against its personality. (Having a economic personality go for military advances first, and bump up the production support tolerance levels too)

        Could you email me your risks.txt file and your diffDB.txt file to look at?

        email address: hexagonia@yahoo.com
        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


        • #5
          I'll post the files up to my "website" late tonight when I get home from work. (about 9pm CST). There are numerous changes. Most are marked by "## JAW" but sometimes I make fast changes, or what-if changes that work and those arent always labeled.

          I had the same problem at first, with the barbs wiping out entire civs. I at first simply bumped up the garrison sizes but found that the civs werent building any garrisons at all. I found a build queue list (cant remember the exact name off the top of my head) that controls which build list the AIs use. I moved the garrison list to the top of every list and since then the civs arent losing as many cities. The barbs will still wear down some garrisons, and if that city is building a wonder, the civ wont be replacing the lost units. Almost every city I see now that is taken by the barbarians is either very young and hadnt had a chance to build its garrison, or is building a wonder. And since the barabarians are equal to the toughest units currently available (not realistic but i wanted the extra challenge on the impossible level), it forces me to keep my garrisons at modern levels. No more holding my capital with a hoplite when its in the 1900s. Theres another flag in the risk file that tells how close the barbarians can appear near a city. I made it 7 so that any nation with a solid border wont have to worry about its interior cities being under constant attack. Since the AI seems to ignore the minsettledistance flag frequently, they tend to have overlapped cities thus a solid borders and only their outer cities tend to be subject to attack as the game progresses. I also start the AI civs with 3 settlers which helps them build a border faster, and gives them a small starting advantage since I almost always start with 2. I too had contemplated delaying the arrival of the barbarians, but the other changes seem to have balanced everything. My last game I saw 4 cities fall to the barbarians (not the actual cities but I saw parts of red borders on the small map). Every city was "liberated" by 500bc, altho not always by its founder. I was annoyed because I couldnt get to any of them and really needed the settlers that the disbanded cities would have provided. Unfortunately, I've received info that the barbarians are programmed to act like a civ if they capture a city, which is exactly what I see them do too often, instead of becoming the unit producing centers that I had envisioned. I'm assuming the barbarians are using the default strategy so I'll see how changing that will affect them and if it has negative effects on the actual civs.

          I reduced most ancient unit costs between 25-33%, and the cost of civilians i think about 10% (I'll post my newest units file too). I'm trying to reevaluate the entire cost/support/attack/defense structure to make it correspond more to reality. I'm starting with a roman cohort (1/10 of a legion) as 500 men, and a roman cavalry was about 250. From that, I'm making most foot units 500 and mounted units 250. Then I try to figure out how many boats would be needed to transport x number of units. Based on these things is how I'm trying to determine costs. Its far from completed so I came up with some basic guesses just so I have something in case my new cost structure turns out to be totally whacked. Eventually, when these units are created, the appropriate number of people will be deducted from that city's population, or added if disbanded within a city.

          My guess for my advance screw up is that I have some prequisite(s) after the the wanted advance, so that the AIs are bypassing certain advances which leaves them with only the more expensive ones to research thus dragging down their tech advancment rate. With so many advance lists, i figured i'd mess up a few.

          With every strategy's support rate set at least to 35%, the AIs have plenty of room to build large armies. I did increase the benefit of bazaars/brokerages/banks to compensate ( i thought the %'s too low regardless).


          ------------------
          History is written by the victor.

          Comment


          • #6
            risks, diffdb, and units files have been posted on my ftp site.

            ------------------
            History is written by the victor.

            Comment


            • #7
              Was just there, and I am glad to see that I was on the right track on a lot of what I was trying to do. I added your Barb changes to my setup, and will give it a test run tomorrow.

              Spent most of the evening resetting ranged attacks as it seems that a unit has to have a minimum of 15 for a ranged attack. When adding my early units, I started out with values of 5. Playtesting revealed those units with range sitting on the front lines, when they should of been raining death from the rear...

              What is the significance of the following lines in DiffDB.txt?

              AI_INTELLIGENCE_FACTOR 25
              AI_GANG_UP_FACTOR 25

              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


              • #8
                Alpha,

                The Garrison switch was the key I needed. Thanks, it is now working fine. I dropped the cost of the earliest 2 units, and it looks like the AI is holding its own at this point in time. And the Barbs really put a crimp on what you can do against the AI civs, as you cannot go right out and build cities/conquer other civs too easily at the same time.
                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


                • #9
                  quote:

                  Originally posted by hexagonian on 02-02-2001 11:16 PM

                  AI_INTELLIGENCE_FACTOR 25
                  AI_GANG_UP_FACTOR 25




                  i'm not sure what they do. I was hoping that changing them would do something but i never saw any difference.

                  The barbs really make the game more difficult. The great wall becomes a necesity so that dictates what advances I research. I have to hope to find some settlers or to buy a few because I spend so many resources beating back the barbs, that I need to keep 1 city doing nothing but pumping out units. And since I changed it so that the barbs get the most advanced units available, i lose a ton defending my cities. And I get attacked so often that my cities have great difficulty in growing.

                  ------------------
                  History is written by the victor.

                  Comment


                  • #10
                    You ought to post these files here as a mod. Its a nice addition. Couple this with the AIFrenzy, and you will have a wicked game.

                    I had run a test Saturday in my mod with the alt Barb settings and the AIFrenzy. I went to turn 100, and the barbs were constantly popping up, so I was not only building garrison units, but also small offensive stacks for each city that needed to be stationed outside of those cities to prevent suprise attacks which stood the chance of decimating population.

                    I also planted a city by the American border, which the Americans prompty took out a couple of turns later. They then proceeded to send a stack of 8 at my capital. I tracked it with a smaller stack - meanwhile I was scrambling to get a defensive stack in place to counter them. The whole time I also had to keep my cities garrisoned because of the constant Barb threat. I managed to get a stack of 11 up in time,and when the Americans ran into it, they promptly turned tail and retreated, even ignoring the lone units that I was throwing out as bait, which would of brought it up to my stack.

                    It was sweet. Unfortunately, I was playing through my scenario and didn't realize the process that you need to do everytime you load a saved game in a Scenario. So I couldn't reload the game.

                    Any idea on the PowerPoint setting in units.txt?
                    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


                    • #11
                      have you tried removing great wall wonder to see if it changes barb behavior??? if you are correct and this is our of the game then have barb uber alles, or such.

                      be curious as to results. i've tried similar things with cost, but not the other options you've added, will add them in and play again.

                      jsnider

                      Comment


                      • #12
                        i havent figured out a use for powerpoints and I suspect its another holdover field from CtP1 (not sure it was used there either).

                        I've made so many chances in other in so many files that I dont even know which ones are needed for a mod. I dont play any mods right now because I think tweaking the files has gotten me better results w/o any glaring weaknesses. I went thru and modified all the diplomatic settings so I get a more realistic diplomacy w/o SLIC. They even threatened last night to destroy my capital if I didnt stop trespassing and I've received requests to swap advances. I dont like Diplomod because of the early map swapping by the AI before they even make contact. To me thats no different than playing with fog turned off and isnt much fun. I dont like frenzy because it tended to leave cities defenseless once it started to attack me. By tweaking the files, the AI knows how to stack and unstack and last night I was invaded by over 40 units in 5 stacks. I eventually lost a city because I couldnt rush reinforcements as fast as they could. I never know which city is the target my way as I've seen the AI bypass a heavily defended city to attack a lightly defended one deep within my borders. With frenzy, the AI tended to make too many suicide attacks that did nothing but give me more vet units. By letting the game play as intended, the AI uses the matching criteria to determine whether to attack (except for the barbs who are suicidal until they start conquering cities). Without frenzy the AI is free to send armies after the barbs and to fight wars among themselves. In my game last night, even tho one civ was at war with me, I was too far away so they took the barbarian cities of Vandals and Visigoths. Its really a shame that they designed the game to turn the barbs into a civ if they started capturing cities, as I think its more fun when the barbs are rushing around attacking everyone like crazy. I have a theory that it may be the combination of the barbs holding 2 or more cities and the human player building the Great Wall that triggers their civilized behavior. I noticed last night that almost immediately after I finished the Wall that they stopped harrassing the other civs too. At which point those civs turned their attention towards me and have 2 of my frontier cities surrounded by I'm too well defended for them to attack but not strong enough to break out. I may use a limited auto update tho for the AI since it knows to upgrade its units within its cities, it doesnt know to do it in the field and they sometimes end up with huge armies of useless units. Right now I just use those armies as cannon fodder to get vet status.

                        ------------------
                        History is written by the victor.

                        Comment


                        • #13
                          quote:

                          Originally posted by JSnider on 02-05-2001 06:57 PM
                          have you tried removing great wall wonder to see if it changes barb behavior??? if you are correct and this is our of the game then have barb uber alles, or such.
                          jsnider


                          Same wolf different username....grrrrrrrrrrrrrrr

                          I just came up with that theory late last night and havent had time to test play it. First I want to see what happens if I let the AI build the Wall.

                          ------------------
                          History is written by the victor.

                          Comment


                          • #14
                            I figured out why the AI starts dropping behind at a certain point. I never realized it before but, I shoot way ahead at the same point I start building trading posts and bazaars. I went thru some old saved games just to see what AI cities looked like. Many of the civs had built no buildings at all. So as long as everyone was purely living off the land, the AIs were ahead. In the BuildListSequences file I added a new BuildingBuildList called Start that immediately follows the garrison list. In it is city walls, granary, bazaar, academy, mill and factory. At least every city will now have the minimum. I may add other buildings as I see them being necessities. This should also help the AI since they wont be building wonders so early and with walls can defend against the barbarians better. I also added 5 prod to trading posts in forests/jungles/mountains to represent wood mills and stone quarries. I added trading post to the
                            improvement list under production so the AI should build more now, helping both their prod and gold.

                            As I always feared, the AI doesnt understand city size limits. Some small cities had aquaducts because they were on the growth strategy. Some of the military and science civs NEEDED them but wouldnt build them. in my game, I had also lowered the % of AI specialists to 10%, and had lowered the specialist from 30 to 20. I'm going to have to relook at that and make their largest cities dedicate more scientists and factory workers since they are all working the land, but not growing, so in essence those workers are wasted. I may have to strategically add all the city limit increasers to every build list so no matter what the AI is playing it wont neglect city growth limits. Under the Gold strategy, i notice that freight is second on the list, this is way too high as I've noticed that some civs change trades routes almost every turn and never seem to be lacking the caravans needed to do so. That means they wasted alot of prod building those caravans which just sit waiting to be used. Anyone ever notice any kind of caravan limit in any file?

                            ------------------
                            History is written by the victor.

                            Comment


                            • #15
                              I've noticed that the AI did not place a high priority on building Trading Posts. I normally build a lot of them, so I do well economically. Adding a production boost only helps me out further.

                              I remember this being an issue in the MedMod for CTP1. Wes added mines to be built in forests, but the AI seemed incapable of building them.

                              There's a tile impovement build list in the default game that only has the basic elements; Farm, Mine and so forth. Shouldn't that list be filled out with all of the tile improvements? I was looking at that list earlier, and it seem a little thin. I believe that there weren't even any of the Net improvememts on that list, but the AI seemed to have no trouble building nets so I didn't do anything with it.

                              And with the edit you made to the BuildingBuildList.txt file is there any other file you need to edit so the AI will use that sequence? (Dumb question, I'm sure, but I'm still learning...)


                              [This message has been edited by hexagonian (edited February 06, 2001).]
                              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

                              Working...
                              X