Announcement

Collapse
No announcement yet.

Exciting AI improvements.

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

  • #76
    By the way, Blake, what difficulty bonus you think your changes have given by now (and will give once you finish your great work)?
    I mean in comparisons like "Monarch AI is equal to old Deity AI" or something along those lines.
    -- What history has taught us is that people do not learn from history.
    -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

    Comment


    • #77
      Viagra for your AI's.

      Oh my god. I've done so much code rewriting, I heavily modified the worker automation code in many places, it now improves cities better (IMO) and I've tried to cut down on the worker ADHD (ie keeping running around between resources building roads rather than improving the damn city), for the most part I've failed to cure worked ADHD, at least so far.

      In terms of City Governor I added MUCH improved AI usage of emphasize buttons (unfortunately players must still use emphasize buttons, otherwise governor is unchanged).

      I've tweaked build priorities, granaries are higher, workboats are MUCH MUCH MUCH higher priority. The AI builds A LOT more workers, possibly too many, my main problem is getting them to build workers *early*! I reduced the desire to build Courthouses, they were being valued about twice as highly as they should (ie 1 upkeep saved by a courthouse is worth 2 gold generated by a market, hmmm????).

      I tweaked the draft code and the whip code (again...).

      I just had to go back into the research code and bump up the priority of Pottery (again) by making it recognize how awesome a building which increases growth it.
      And I also reduced the value of religions once an AI already has a holy city, for each additional holy city is has the less desirable the other religions are. Leaders with high religious desires shouldn't be effected too much. The goal of this is to get the AI's to research *useful* stuff sooner.


      Overall the early game isn't much stronger (it kind of spends that time growing). But in the mid game it's early investments really start paying off. I'll let the screenshots tell the story, I "played" a comparison from 4000BC, with default 1.61 and then with my changes, going to 1000AD.

      PERSIAN BEFORE:


      PERSIAN AFTER:



      INDIAN BEFORE:


      INDIAN AFTER:


      I think you have to agree that Delhi there has enjoyed an amazing boost.


      Also look at the scores. They've all increased and some have gone up by 50%.


      DEMOGRAPHICS BEORE:


      DEMOGRAPHICS AFTER:


      Just check out that GNP figure. It's amazing. And bear in mind they're whipping like madmen too - like the cities have permament -1 , heheh, that's my AI's! So the MFG is deceptively low in the after. Also the AI's will maximize production when building high priortity stuff like wonders so they aren't any slower at building wonders.


      Anyway there's one niggling issue I want to fix which is impairing early game performance. For some reason they refuse to farm floodplains. Once I fix that and do a little more AI governor tweaking I'll upload a new version.

      Comment


      • #78
        That seems some 2 diff levels up, especially for the indians

        It also seems that the reason of early poor growth is exactly the roads - it keeps missing important improvements while clumping workers with roads, but later it kinda pays off when it can reach every place very fast and improve away.

        Have you considered this (and is it hard if yes)?
        About road building - maybe you can teach it only build roads in following cases:

        city - city
        city - river
        resource - city/river
        Also - why do you want it to farm floodplains?
        My guess is that part of that very high gold income comes from early cottages on floodplains.
        In case you still teach it to farm them, you could add a condition that financial civs like cottages more (for instant +3 g) and philosophical like farms more (for more food for specialists).
        -- What history has taught us is that people do not learn from history.
        -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

        Comment


        • #79
          I mean it completely refuses to farm floodplains, even if the farm is the only improvement the worker can make (ie Monarch Persia with starting tech of ag and starting worker). The problem is as the AI researches Pottery it also gets a settler out and the worker scampers off to improve resources at the new city and I have a devil of a time getting the workers to come back and improve the damn floodplains with cottages, farming floodplains is not bad since it improves settler spam, and in some cases you need to farm floodplains (ie when there's lot of plains hill around).

          The road problem is that *everywhere* in the code the workers are told to build roads. It's almost as if the AI programmer couldn't decide on an effective roading strategy so just made them very liberal with the roads.

          I think I'll be able to get it working if i can just get it to train the workers more evenly, at the moment it'll train one early on (if it doesn't start with one), then it trains like 3 more settlers and then FINALLY - at about 500BC - it starts this massive worker spamfest. So I just need to get it to have about 1 worker per city at all times with high priority. My workboat code fortunately has worked flawlessly and the AI makes it extreme priority to hook up seafood (which reminds me, I need to make it connect fish before clams/crabs).

          Comment


          • #80
            Look at the amount of soldiers, too! That tells you the AI is certainly not struggling to find hammers.

            Blake - what mix of military is the AI building? Will Ghandi be descending on us with terrifying SoDs?!?

            Comment


            • #81
              Now that is impressive!! It does look like it's moved up at least two levels. People will seriously have to revise their strategies one certain levels with this sort of improvement. Some options will simply be unavailable if the AI is too strong.

              Must make sure to play at least one more game before the patch gets released or else there will be no comparison between one game and the other.

              Comment


              • #82
                The road problem is that *everywhere* in the code the workers are told to build roads. It's almost as if the AI programmer couldn't decide on an effective roading strategy so just made them very liberal with the roads.
                Too bad.
                This roading tactic would have been just okay:
                city - city
                city - river
                resource - city/river
                I think I'll be able to get it working if i can just get it to train the workers more evenly, at the moment it'll train one early on (if it doesn't start with one), then it trains like 3 more settlers and then FINALLY - at about 500BC - it starts this massive worker spamfest.
                Here we've got the reason why early game vs Emperor+ AI is a rush for locations.
                Isnt there some priority-property which you can alter in order to modify this settler-streaming behaviour?
                -- What history has taught us is that people do not learn from history.
                -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                Comment


                • #83
                  Blake - what mix of military is the AI building? Will Ghandi be descending on us with terrifying SoDs?!?
                  I haven't touched the military code. So it's the standard drivel of rubbish.

                  I think I might mess with the AI's discounts. Eliminate the production discount. Because it messes with whipping. Like an AI Axeman costs 29 hammers or something, so it can't ever be whipped for 2 pop. This means the AI suffers disproportional happiness penalty for being forced to whip cheaper units. And it'd be a good excuse to start phasing out some of the bonuses.

                  Note the AI would still be more productive because with cheaper pop (shorter food bar) it can whip more often. In fact I was thinking of giving them a proportional discount off whip anger duration since the AI can't time that nearly as well as the human. Another idea would be to let AI whips always be a minimum of 2 pop for 60h, if the city is at least size 4, the thing being whipped costs at least 35h and isn't too close to completion, this is something I can reliably do, like whip something for 2 pop every 10 turns, but the AI can't plan this sort of thing at all. So maybe, while I have to whip an axeman for 2 pop between 31-34h, I'll let the AI whip it for 2 pop between 21 and 34.

                  I don't want to prop the AI up with new bonuses, but I may swap one bonus for another, more fair, bonus. Like taking away production bonus would mean the AI can't build wonders crazy fast, adding whip bonus would allow them to spam out cheap units faster, this would tend to help out the AI more where it's weakest (ie it does need more units to make up for being tatically dumb, but it can manage wonder building okay because wonders aren't so tactical). Also I'd make the Noble and easier AI's MUCH less whip-happy. If I do this, it'll be tweakable via XML, including disabling completely.

                  Now that is impressive!! It does look like it's moved up at least two levels. People will seriously have to revise their strategies one certain levels with this sort of improvement. Some options will simply be unavailable if the AI is too strong.

                  Must make sure to play at least one more game before the patch gets released or else there will be no comparison between one game and the other.
                  What I'm really aiming at is more even performance over the entire game. At the moment it's early game is not that much more powerful (especially since it starts with stock bonuses) but it's mid game performance is massively improved - the 1.61 AI basically starts out strong by being propped up with bonuses, but then pisses that away as the game progresses.

                  In terms of strategy changes, I think winning space will be harder, against the stronger mid-late game economic performance. If I implement the whipping-discounts I'm certain the AI will be able to drive off axe rushes, since once it gets threatned it should start banging out axes, swords, spears, horse archers etc. It drafts better too. In fact the AI in a mid game war with nationalism should quite eagerly draft and whip out a large army in order to repel an invasion. I fear that when two AI's fight they'll annihilate each other...

                  Here we've got the reason why early game vs Emperor+ AI is a rush for locations.
                  Isnt there some priority-property which you can alter in order to modify this settler-streaming behaviour?
                  Yeah I'll crack it sooner or later. In fact I thought I had, but the AI persisted in it's mid-game glut of worker production. I think the key will be to outright force it to train as many workers as it has land cities. Maybe I'll force it to spread the workers out a bit too rather than having them all at one city.

                  Comment


                  • #84
                    Originally posted by Blake
                    In terms of strategy changes, I think winning space will be harder, against the stronger mid-late game economic performance. If I implement the whipping-discounts I'm certain the AI will be able to drive off axe rushes, since once it gets threatned it should start banging out axes, swords, spears, horse archers etc. It drafts better too. In fact the AI in a mid game war with nationalism should quite eagerly draft and whip out a large army in order to repel an invasion. I fear that when two AI's fight they'll annihilate each other...
                    Hmmm...speaking from the perspective of Monarch difficulty, I'm not sure that making Spacerace harder would be a good thing in isolation. Compared to Domination, I think Spacerace is already harder, insofar as it can go wrong (devastating attack) when you're in the lead. If you're the military top dog then AI attacks are much less likely; and if you're beating them up they find it hard to launch.

                    I think the key will be making the military path a harder one to follow, which you have addressed in terms of whipping/drafting. If militarism is less rewarding then it will persuade people to choose (a more competitive) peaceful option.

                    Comment


                    • #85
                      Great, at this rate I'm never gonna win this game.

                      Thanks, Blake


                      Tom P.

                      Comment


                      • #86
                        Originally posted by Blake
                        I think I might mess with the AI's discounts. Eliminate the production discount. Because it messes with whipping. Like an AI Axeman costs 29 hammers or something, so it can't ever be whipped for 2 pop.
                        Didn't Warlords add a zero-hammer whip penalty of 1 pop for the human player? Maybe adding this for the AI - and leaving their bonuses - would balance this? But, as a complete amateur in this area, I'll leave this to your discretion.

                        Comment


                        • #87
                          Indian before... Indian after


                          -Arrian
                          grog want tank...Grog Want Tank... GROG WANT TANK!

                          The trick isn't to break some eggs to make an omelette, it's convincing the eggs to break themselves in order to aspire to omelettehood.

                          Comment


                          • #88
                            DEMOGRAPHICS BEFORE:
                            DEMOGRAPHICS AFTER:
                            You point out the gold but another score to look at is the Crop Yield (Food)
                            132 vs. 232 that's an increase of 75.7%!!

                            This is really impressive. Very good work thus far Blake.

                            Tom P.

                            Comment


                            • #89
                              Didn't read through the whole thread so I don't know if this has been mentioned but any chance of fixing the AI's tendency to build roads everywhere?

                              Comment


                              • #90
                                Yeah, it's been mentioned. Apparently it's hard to fix.

                                I don't think building roads everywhere is a terrible problem, it's more about the sequencing. Basic road connections are high priority, roading every tile is low priority. Getting the AI to understand the difference... yikes.

                                -Arrian
                                grog want tank...Grog Want Tank... GROG WANT TANK!

                                The trick isn't to break some eggs to make an omelette, it's convincing the eggs to break themselves in order to aspire to omelettehood.

                                Comment

                                Working...
                                X