Announcement

Collapse
No announcement yet.

Exciting AI improvements.

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

  • #31
    Originally posted by couerdelion
    Programming the AI to play a better game is going to start making their bonuses really pay off, even on the medium levels.

    Next thing, you’ll be finding that you need to make friends at Monarch level for fear of the AI rush.

    But it looks very impressive Blake. Does it significantly improve the AI performance or simply give you better cities to capture?
    I'm sure it gives a small performance boost, but the the main performance gains will only come with the "Holy Trinity"
    1) Good city placement.
    2) Smart build choices to increase growth.
    3) Smart workforce placement and use of whip.

    Like at the moment, the AI doesn't priotize food enough for the whipping to really pay off. Altough it does get in unhealthy/unhappy situations where a bit of pruning will greatly improve economic health as well as providing an influx of hammers.

    Comment


    • #32
      Awesome work Blake! I've wanted to do such a thing myself, but I've never gotten around to it. Somehow I've always found playing Civ to be more fun than improving it. Maybe you're work will inspire me and others to delve into the SDK...

      Comment


      • #33
        Hi everyone.

        I've added some more powerful reasoning ability to the AI. It now counts food! It looks at the resources (improved) and floodplains. It sums up the food surplus from those resources, and the food deficit to work dry resources. Positive food is good, negative food is bad (a gold mine with no food to work it is worse than a gold mine with food to work it). This means it will have a slight tendency to avoid clusters of silver mines (and such), if possible it should try and found cities at the edges of clusters of dry resources.
        And of course it'll love any site rich in food, and sites with lots of food and lots of good food sinks.

        I'm very happy both with continents and great plains behaivour and I've added everything I can think of to the decision making process.

        So I'm now posting the newest version.

        Download "CIV Improved AI" 0.3

        By the way, at the start blue circles will jump around a bit. I'll put it like this. Blue circles do maphack, but they don't quite have full vision into black fog. So don't put too much faith in the blue circles until you've actually scouted the land.

        Things to watch for - None of these SHOULD happen but they might.
        1) Food resources going unclaimed by any city (it'll neglect useless furs and such).
        2) Founding on top of resources without justifaction.
        3) Weird start locations (the code is shared with start location code).
        4) Excessive Slowdown during AI turns (I don't think this will be a problem, I've taken care to keep the code lean).


        Something not to watch for:
        Strategic error. The AI can't "dotmap". I've tried to preserve sanity to stop it going for super-super cities (it might found two cities to work a cluster of 4 food resources) but it'll still do things like found 1 city where 2 would be better and block resources from being ever worked.

        Download "CIV Improved AI" 0.3

        So on the agenda:
        Worker automation AI (Food balance)
        Build Governor AI (enhancing growth builds are good)
        Workforce Governor (good tiles are good, food is good, whipping is good).
        Last edited by Blake; September 29, 2006, 06:36.

        Comment


        • #34
          Wow, even more cool things coming up.
          I hope this doesn't go unnoticed by Firaxis
          -- 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


          • #35
            Woo and yay! This weekend, I shall be mostly testing these improvements.

            Comment


            • #36
              Does this also contain your whipping and research overflow fix? I've been using that fix but I'm thinking that I'll switch to this one. I sounds really great.

              slgann

              Comment


              • #37
                It does indeed include those fixes.

                Comment


                • #38
                  It would be great if the city placement improvements could be matched by auto worker improvement, more for the AIs benefit than mine!
                  www.neo-geo.com

                  Comment


                  • #39
                    Oh now this is rich.

                    If I'm reading the 1.61 code right.

                    The AI does not whip Granaries.
                    The AI does only whips lighthouses if the city has no food.

                    In fact it'll never whip buildings unless there is special case code for them. So I'll fix up the lighthouse code and add granary code, and also add general case whip awareness so it'll whip everything it can (if it makes sense to do so).

                    edit: Done! The AI should now whip large builds (anything) in cities with unhappy or unhealthy population. Exact formula is if ((unhappy * 2 + unhealthy) >= 3) and (pop_cost >=2) and no existing anger then Whip Away!

                    Certain builds - Granaries, Lighthouses, Settlers, Workers, Workboats are considered essential builds, meaning they'll be whipped even if there is existing whip anger. Oh yeah, and if the city is in danger? That's considered essential too. The AI should now (hopefully) ravage it's population with the whip when invaded.
                    Ever thought "The AI could easily drive me back if it whipped a couple of axemen out of that massive city?" ...
                    It brings joy to my heart.

                    I might make some of this dependent on difficulty level (especially the war-ravaging thing), altough if you're going to play this AI then you should probably expect it to be both more efficient and more ruthless.
                    Last edited by Blake; October 1, 2006, 02:23.

                    Comment


                    • #40
                      Originally posted by Blake
                      The AI should now (hopefully) ravage it's population with the whip when invaded.
                      Ever thought "The AI could easily drive me back if it whipped a couple of axemen out of that massive city?" ...
                      It brings joy to my heart.

                      I might make some of this dependent on difficulty level (especially the war-ravaging thing), altough if you're going to play this AI then you should probably expect it to be both more efficient and more ruthless.
                      That's simply fantastic. Anything that makes warmongering more challenging is wonderful.

                      Comment


                      • #41
                        So are your whip fixes now available for download?
                        www.neo-geo.com

                        Comment


                        • #42
                          Everything I've done is available 3 posts up I still have more work to do on the AI.

                          I decided to run a test where play a duel with a single AI and put spies in the AI capital and watch it.

                          It starts out well training a bunch of warriors to sit on their thumbs, wihle founding Buddhism (so much for them always going for Hinduism, hah!).
                          He trains some archers and a worker, the worker starts building roads and farms.
                          Then he starts on a settler, since he gets Bronze Working, he switches to slavery and whips the settler. W00t. Good start. But after BW he gets Iron Working.
                          The settler heads out, upon founding the AI researches Polytheism and the new city gets Hinduism. The AI immediately starts a vital build - Hinudi Monastary!
                          I watch with growing horror as the AI persists in working unimproved hills while the worker builds more farms, despite the masses of already-unworked farms.

                          Thousands of years pass.



                          The AI is busily researching Calendar and STILL hasn't researched Pottery. I'm starting to understanding how the AI is just so damn weak.

                          I give up and research Pottery and offer him the gift, which he accepts.

                          Granaries DO get whipped into the outlying cities but the Capital doesn't deserve one.

                          Then the AI generates a prophet and builds the buddhist shrine. Of course upon generating a prophet you immediately... run 6 priests?!!!

                          And a while late the AI starts a Courthouse, in his CAPITAL. With the -2 upkeep. AND STILL HASN'T BUILT A GRANARY *weeps*. Or a single mine.

                          I have my work cut out for me, that's for sure.

                          I'm thinking I might have to nuke it from orbit and rebuild from the ground up (I mean workforce placement code) it's the only way to be sure.
                          Last edited by Blake; October 1, 2006, 05:22.

                          Comment


                          • #43
                            Originally posted by Blake
                            I'm thinking I might have to nuke it from orbit and rebuild from the ground up (I mean workforce placement code) it's the only way to be sure.
                            You'd only need to nuke it from orbit it was a hugely efficient threat to survival, by the sounds of things a pointy stick should do it.
                            www.neo-geo.com

                            Comment


                            • #44
                              In XML technology files there's a proprety iAIWeight. What is that for? I played a bit around with it and though that the AI would prioritize techs with a high modifier. The AI seemed to pretty much ignore it.

                              Also I've found that the AI build much too much units and not enough buildings.

                              I'd love to help if I could only get that darn SDK to compile.

                              Also that AI code really looks bad. Functions that have about 1300 lines and not a single line of comment. No wonder that that code is buggy.

                              Comment


                              • #45
                                Originally posted by Blake
                                Ever thought "The AI could easily drive me back if it whipped a couple of axemen out of that massive city?" ...
                                It brings joy to my heart.

                                I might make some of this dependent on difficulty level (especially the war-ravaging thing), altough if you're going to play this AI then you should probably expect it to be both more efficient and more ruthless.
                                Then the thing to do is obviously fight more battles on home turf where you have the roads. Let the AI whip the cities down and then move in

                                Now if the AI could employ some basic battle tactics things would get scary and I would be probably be back-tracking all the way to Noble level

                                Edit: Just read your AI story.

                                But if it is playing this well then now I think MY play must be really bad.

                                Comment

                                Working...
                                X