Announcement

Collapse
No announcement yet.

Exciting AI improvements.

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

  • #61
    not quite randomly. when a unit is built it gets assigned a AI-strategy. city defender, attacker, etc. so at the time. while some units are probably attack-only (swordsmen, all horse-based units), some are used for both (archers, axes, longbows, etc.). depending on what the built unit was intended for, an pikeman might get a city raider for isntance.
    Indeed it does give city defenders in the right situation.

    1) --> certainly! but there probably is no flag/function called boolean couldBeAttackedAnyMomentNow()
    and don't forget that with your idea he might upgrade better for defences, but not with foresight. if we see the AI approaching with 4 knights, we'll have some elephants, spears and pikes to defend and we'll ignore upgrading the axemen. can the AI do that too?
    Thinking farther than the next battle isn't simple and often is gambling. The reason is that you don't know for sure what the enemy has, except if you make use of the AI cheating but that would be too obvious. You could keep track of the "best" unit that you have seen so far of the enemy and prioritize promotions that work good against that one on grass land.

    2) --> hardcoding is dangerous. 75% is a nice lead, but if you face cavalry vs. cavalry, giving combat I makes quite a big deal (10% more --> 68% chance of winning).
    No it isn't. cavalry vs. cavalry gives 50% < 75% => choose the best promotion and promote.


    as for the downside example with the archer: the algorithm ofcourse would consider the archer NOT a threat and wouldn't bother promoting.
    However the algo I suggested above doesn't handle this. In fact it's very hard to determine all possible moves of the enemy ahead and certainly too slow for the AI. Just consider all possible moves an axeman can do and then those a horse archer can do. Now suppose you had 2 stacks of 10 units each. The number of possible combinations is just mad.

    Also if your unit is in a stack then things get even more complicated. How many other units are there that protect that unit? It depends on the attacker as there are many different vs xyz promotions. Then the order in which the units fight and the odds of the attackers matter. This is very complicated.

    Also most of the time a cavalery unit will be above 75% vs an archer so the promotion wont be triggered. Only strongly wounded units will fall for this trick.

    let's see what blake comes up with. so far it's been great
    Indeed

    Founding on a luxury or food resource does not prevent the civ from obtaining the happiness or health it provides once the appropriate technology has been discovered (calender in this case).
    I didn't know that, thanks. Only very rarly found on a resource myself.

    I sure hope that the AI will be a challenge on prince.

    Comment


    • #62
      The AI doesn't get smarter on more difficult levels. The only change in their "thoughts" is that they are more aggressive towards you particularly. I thought....

      Comment


      • #63
        I've been rewriting the AI automated workers code a bit.

        It's tricky stuff and I don't want to get anyone's hopes up too far because it's tricky and a full rewrite of the code not just tweaking, but in a game I just ran a monarch AI using my new worker code built the Oracle in... get this... 1720BC.
        It's amazing what those AI's can do with more productive terrain improvement.

        Comment


        • #64
          Originally posted by Blake
          I've been rewriting the AI automated workers code a bit.

          It's tricky stuff and I don't want to get anyone's hopes up too far because it's tricky and a full rewrite of the code not just tweaking, but in a game I just ran a monarch AI using my new worker code built the Oracle in... get this... 1720BC.
          It's amazing what those AI's can do with more productive terrain improvement.
          Monarch...1720BC...dang...what did it grab, metal casting?

          Comment


          • #65
            Another pretty cool thing is I've added some simple understanding of forests, it'll now be less likely to chop forests if the city is low on health. Of course at present the AI's rampant locustism is probably how it musters it's armies, but I figure it's ability to poprush is going to be wicked once I activate some code to maximize food - AI cities grow fast so they'll get tremendous yield from the whip.

            One thing with worker automation I'm having trouble with is the rampant road building, it just really likes those roads, so many parts of the code has the workers build roads (workers very nearly lay road everywhere they move). I might just increase their worker-training priority and let the AI production bonuses cover the cost of the increased number of workers needed.

            Comment


            • #66
              Originally posted by Blake
              One thing with worker automation I'm having trouble with is the rampant road building, it just really likes those roads, so many parts of the code has the workers build roads (workers very nearly lay road everywhere they move). I might just increase their worker-training priority and let the AI production bonuses cover the cost of the increased number of workers needed.
              I can see some (limited) method in this madness: the AI is so keen to pillage improvements that it makes sense to have a whole bunch of roads as many routes will get cut in AI only wars.

              Comment


              • #67
                Wow, this looks incredible Blake!

                I wish I could help. I've got a wedding video to finish, a financial package to write, AoN lines to read for, and ApolyCon footage to edit.

                It sounds like a re-working would do wonders, what with reusing code for different things (I'm thinking of the city founding and "blue circle" code). If we could get those separate we could place level-aware code in one and not the other and maybe take steps to making this an AI-based difficulty instead of bonus-based.

                Man it's going to take me a couple of months to get to a point that I can help any, but I'd love to do what I can.

                Tom P.

                Comment


                • #68
                  Thank you Blake
                  We will actually be incorporating a lot of your work in the patch.

                  Comment


                  • #69
                    Hey, if this stuff really beefs up the AI, then the AI production/science/barb bonuses can be toned down. So much the better!



                    -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


                    • #70
                      Originally posted by alexman
                      Thank you Blake
                      We will actually be incorporating a lot of your work in the patch.
                      Hearing this is not making it easier to wait for the patch...

                      Comment


                      • #71
                        Originally posted by alexman
                        Thank you Blake
                        We will actually be incorporating a lot of your work in the patch.
                        Great news!
                        "As far as general advice on mod-making: Go slow as far as adding new things to the game until you have the basic game all smoothed out ... Make sure the things you change are really imbalances and not just something that doesn't fit with your particular style of play." - WesW

                        Comment


                        • #72
                          Originally posted by MikeH
                          I dunno about improving the AI, this thread has actually taught me a lot about city placement, whipping and build orders.
                          Me too

                          Comment


                          • #73
                            Originally posted by alexman
                            Thank you Blake
                            We will actually be incorporating a lot of your work in the patch.
                            I was heard.

                            About road building - maybe you can teach it only build roads in following cases:

                            city - city
                            city - river
                            resource - city/river

                            That should be enough roads
                            -- 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


                            • #74
                              For once, I can sincerely say: "I hope I get my ass kicked." Because if I download the patch and I don't, I'm going to be a bit dissapointed.

                              BTW, there is logic to all those extra roads just as long as you don't need the workers for somehting else.

                              Comment


                              • #75
                                Originally posted by alexman
                                Thank you Blake
                                We will actually be incorporating a lot of your work in the patch.
                                Great news!
                                Jon Miller: MikeH speaks the truth
                                Jon Miller: MikeH is a shockingly revolting dolt and a masturbatory urine-reeking sideshow freak whose word is as valuable as an aging cow paddy.
                                We've got both kinds

                                Comment

                                Working...
                                X