Announcement

Collapse
No announcement yet.

A Better AI.

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

  • #46
    Originally posted by Blake

    The theory is that the Woodsman restriction means "almost never" which is correct (...)
    The other thing is that this code runs nigh-instantly, while looking at the terrain all around the empire would take ages (relatively speaking). I figure it's quick, dirty and somewhat better than nothing.
    Well I guess I have to agree with you then. You're right, as always

    Promotion logic is a necessary but small improvement though, I guess. The real challenge will be city attack logic.

    I fear the only way to really improve warfare for the AI will be to incorporate several levels of strategy into the AI. It has to decide on a grand strategy, which basicly means "How do I want to win this game? And what must I do to reach this goal?". This involves deciding who to attack, who to make friend with, etc. The next layer is strategy, which involves deciding when to attack, and what cities to attack. The third layer is tactics. Here the AI must decide how to move its actual units. As a fourth layer we could add logistics, which will be logic for building additional units that are needed during the war and moving them to the front and such.

    How to implement such a tiered system into the AI I don't really know. I guess it just has to evaluate each tier each turn, starting of course with grand strategy and doing logicstics at the end. But it has to be done such that it doesn't change its (grand) strategy every turn, of course, because then it won't be going anywhere.

    The above system is of course already partionally in the AI. At least it seems to be, from my gameplay experience. There seems to be some point where they AI decides to go to war - and then it will spend some turns moving units etc, before it actually declares.

    (That, by the way, is a much needed change in diplomacy. The ability to say "Geez, of course I want to war with your enemy, our enemy. But can you give me 5 turns to move my units to the border? It's in the interest of neither of us if I declare now and our mutual foe takes 3 of my border cities, right?". I often find myself forced to decline proposals which I might have accepted if I had had some time to prepare).

    Comment


    • #47
      re: ai warfare.

      It will move many units to the front (which the human sees and knows what's coming), but I often find their second wave is one or two turns back allowing me (thankfully ) time to reinforce the threatened area.

      We'd have to program an overal strategy for the AI. First of all, don't declare war just because you don't like the human. There must be some objective. If you lack the means to achieve that objective, don't declare war. Sometimes they seem to do this well. If there is a city that threatens them culturally or is close to their border they go all out to caputure that city. This is a good objective planning. But other than that, their wars are pretty aimless.

      How can the AI win? Some AI's just need to realize they can't research for ****. At some point (maybe engineering) they need to gear up and go for conquest. Even if they happen to like their neighbors. Attack the weak neighbors first and go from there. Though this raises the question if it is historically accurate. Do we want the AI attacking weak neighbors just to go for domination wins? Even if they share a religion and ideals? I think that would upset some human players. Nevertheless, warmongering civs should concentrate on building huge offensive forces and attacking weak neighbors (not necessarily the human) to gain land- even if they share religion with that neighbor. Often I see warmongering civs at peace for hundreds of years because they share religions with their neighbors. The mongols should be attacking (and not just the human)

      At the very least I think this would give the AI 2 viable ways to win instead of the current one. Maybe 3 if you include conquest.

      Then we are faced with the task at how to program the AI to take cities. They can do it, we've all seen them do it. I'm not sure how to do this. I wouldn't recommend my tactics I use against the AI, as the human could easily exploit this (and if I played multiplayer I simarly couldn't use these tactics). But I still feel the AI needs to concentrate their troops at one city at a time, and not spread them out so much. Yes they still need to keep some units back to protect their own cities, and this does run the risk of the human outflanking them and pushing into their homeland.

      Anyways that would be a warmongering strategy for an AI that has evaluated that they just don't have the research ability to win via spaceship.

      Now if you have a civ that is in the top 2 or 3 in research, and maybe wants to boost their research power a bit, maybe they declare war and take a weak border city from a neighbor. Before they do this they build up a decent enough force to accomplish this. Then agree to peace terms. No need for long drawn out wars here.

      Next up in tight space races, the AI needs to neglect some techs like mass media. It's a nice snazzy tech to pick up, but they are supposed to be trying to win the game. And the AI places too much value on artillery as well.

      Comment


      • #48
        My first game with the new AI is turning out to be interesting. I started with Mali isolated on a standard fractal map at Prince (my usual level). I thought I was dead when the first AI turned up and I was something like 10-12 techs behind, instead of the usual 4-5, but managed to catch up with a few trades.

        The real surprise has been Monty. Instead of getting annoyed with me whilst the other AI's dogpile him he has vassalised Toku and Nappy and is now after Julius. He may even manage domination or will be difficult to beat to the spaceship at best.

        The AI's are definitely more competitive in production. It's too early to tell if this is a one off but they seem to just play better because their economies aren't continually in a hole.
        Never give an AI an even break.

        Comment


        • #49
          I may have a bug to report...



          These guys are automated, and they're doing nuthin. Been like that for who knows how many turns, until I spotted it. I manually made them mine that copper, and then re-automated them. They're fine now...
          How does the new AI handle city ruins? I need to check, if that other ruin is still there...
          I've allways wanted to play "Russ Meyer's Civilization"

          Comment


          • #50
            That's definitely a bug. Two bugs actually, both related to "Auto workers leave existing improvements" neither effect the AI.

            1) City ruins are counted as an improvement.

            2) I half implemented a feature whereby autoworkers would override the "leave improvements" setting for the case of hooking up resources.

            Is 2 a good thing? Should I fully implement it? Or should I revert to the old case where "Leave old improvements MEANS leave old improvements, no exceptions!". Or I could go halfway and have it only improve in the case of having none of that resource... which would be the case when you first discover a tech which reveals a resource - that's actually probably what I'll do.

            Comment


            • #51
              Originally posted by Blake
              2) I half implemented a feature whereby autoworkers would override the "leave improvements" setting for the case of hooking up resources.

              Is 2 a good thing? Should I fully implement it? Or should I revert to the old case where "Leave old improvements MEANS leave old improvements, no exceptions!". Or I could go halfway and have it only improve in the case of having none of that resource... which would be the case when you first discover a tech which reveals a resource - that's actually probably what I'll do.
              I'd rather it was left out personally. It's really an issue in the late game for oil, uranium and aluminium. Sometimes resources, particularly oil and uranium, pop up on a farmed tile and if they were mined would leave a city short of food so I'd not choose to exploit them unless I had no other source of that resource.
              Never give an AI an even break.

              Comment


              • #52
                A difference I've noticed with the new workers AI is that they now improve terrain with a special resource that you can see but don't have the tech to use yet (eg farming silks before you have calender). If it is going to do this then personally I would like them all to get changed to plantations.

                I suppose your suggestion is good as I would at least get one of them to use and could manually change the rest when I feel like it. That would be better than all my towns on uranium being changed to mines on discovery of scientific method.

                Comment


                • #53
                  Leave old improvements should mean leave old improvements! People do not select that option for nothing! If I want my workers to kill old improvements I wouldn't have selected that option.

                  I often do not hook up resources. Many calendar resources aren't really worth improving, and uranium is pretty worthless as well. Sure I need one of them, but in a big empire I usually have several.

                  Hooking just one up is not an option either. Of course I want to hook one up, but I want to be able to decide which one. And not the one within the fat cross of my oxford city that has a town on it.

                  So don't touch that, please.

                  Comment


                  • #54
                    Re: AI warfare

                    Another thing that AI needs to be taught is when to retreat. Right now the AI basicly sends its units on suicide missions. They either win, or they die. Making the AI smarter in estimating when it can win a city is important. But given how creative humans can be in defending we can't expect the AI to always judge right. It should recognize those cases, and retreat.

                    Right now, if it can't take cities, the AI units will just walk around in your land until you kill them.

                    The current AI pattern for warfare is quite simple: It keeps a certain amount of troops at home, and attacks you with the rest of its troops. They all storm to your land and plunder, and they may take a city if they can. The AI does use stacks, but there's not coordinated effort. Often I see one stack arrive in my land, then one or two turns later another stack. Just enough time for me to wound or kill his first stack, and retreat again. His second stack then plunders a bit while I heal, and then I kill it. Had he attacked with both stacks at once, and aimed for my cities directly, I would have been dead meat.

                    If the AI builds new units during the war he will keep them as defence if needed, and send them to the front if not needed. Again though there is no planning or strategy, and these units invade me in small groups which are easily disposed off. A total waste of units.

                    If you have killed its offensive troops, the AI just sits in its cities and defends. It will counter to some extend if you move your troops in, but a great many defenders are left in its cities regardless of how the war is going in the rest of his terrority. Situations in which an AI throws 5 artillery at a big stack of mine, and then only kills 2 or 3 units, while he has dozens of defenders in neighbouring cities, are plentiful. Suiciding artillery when you aren't actually going to attack the enemy stack is a last desperate measure to defend a besieged city, and only makes sense if you have significant reinforcements arriving before the enemy stack can heal up. The AI does this all the time though.

                    Worst though is that the AI will display the exact same behaviour, whether its fighting a defensive or aggressive war. If you declare war on an AI, he will send his 'attack' troops to your territory, where you can kill them, having the full bonus of roads, no war weariness, faster healing and GW benifits. Then you take leisurly take its cities.

                    I'm not saying the AI should never attack in defensive wars. But it should at least be a bit more cautious.

                    Comment


                    • #55
                      I still have the warlords 2.08 version of your AI (I'm always slow in upgrading :P), but I have a screenie of a city site suggestion I don't understand. I don't think you changed anything to this, except for some bugfixing and diversifying the AI, so I guess it would suggest the same in the latest versions.

                      I am going to found on the plains hill, giving me 2 resources, freshwater and one floodplain, which, however, overlaps with my capital. The game however suggests I found my city on the grassland hill. Giving me no resources, no freshwater, and lots of mountains in my fat cross.

                      What is the logic here? Does it look at unrevealed resources, or at what is behind the black fog?
                      Attached Files

                      Comment


                      • #56
                        Simpler than that - blue circles can't appear in grey fog. If you revealed the southern tiles they'd be one down there.

                        Btw new Vanilla version coming soon. Fully updated to the latest Warlords fixes .

                        Comment


                        • #57
                          But the plains hill isn't fogged? It does indeed suggest the tile to the south-east of the plains hills, next to the horses.

                          Is that a better tile than the plains hill? You don't gain any resources, you loose a lot of land tiles, and you aren't on a plains hill anymore?

                          Comment


                          • #58
                            I suspect it'd want to put a blue circle on the southern most grassland forest, or possibly the horses.

                            But blue circles are weird. They aren't always at the highest point. They ARE NOT always where the AI would found cities - they tend to indicate spots valued highly by the AI but I think there's another factor at work - like some factor forcing the blue circles apart - which can result in a blue circle being adjacant to a tile which has higher AI value than the blue circle tile does... or another way of putting it is, the blue circles always tries to come up with alternatives, which can result in some really daft alternatives coming up.

                            Comment


                            • #59
                              Originally posted by ColdPhoenix
                              A difference I've noticed with the new workers AI is that they now improve terrain with a special resource that you can see but don't have the tech to use yet (eg farming silks before you have calender). If it is going to do this then personally I would like them all to get changed to plantations.

                              I suppose your suggestion is good as I would at least get one of them to use and could manually change the rest when I feel like it. That would be better than all my towns on uranium being changed to mines on discovery of scientific method.
                              For the reason given, I'd want auto workers to always build the "special" improvement (wineyards/plantations) etc, because they now tend to farm/cottage special resources when the relevant tech is not yet available. Having said that, I never automate my workers before the Middle Ages, so it's only when it comes to oil/uranium etc that it'd become annoying.

                              One bug(issue?) I noticed - unfortunately I don't have screenie or save so I understand it's difficult to reproduce. I also don't know exactly what Blake/the patch did to the City Governer code. But anyway, here's what I had:

                              Capital city, size two. Grassland cows by river, Plains corn (is it corn? it gave 4f/1h with farm anyway) not by river. I farmed the corn first, discovered animal husbandry and pasturage-d the cows while the city was building a warrior. However, even once the pasturage was done, the governer preferred to work a plains forest/river (1f/2h/1c) over the cows (4f/2h/1c). I did double click the centre of the city to reset the worker allocation and I did wait a turn just to see.

                              I can sort of see the logic - the city at size 2 had a food surplus so I'd expect it to work a hammer-heavy tile (within reason). However, the cows was giving the same as the forest, plus another 3food.

                              Comment


                              • #60
                                So blue circle code is weird. Well that explanation works for me.

                                If I had done as the blue circles suggested I could have placed one more city on that stretch of land. I don't know, what's better, one very good city, or two lesser cities? I always build very few cities, that has been my style from the very beginning. But more cities might be a better strategy.

                                Found another 'bug' though, with city governor. Same as something I posted before, slightly different situation. The city governor preferred two forested grasslands above an farmed grassland by a river and an ivory. The former gives 4 food and 2 hammers though, while the latter gives 4 food, 3 hammers and 4 commerce. Rather a weird choice.

                                City governors seems to have trouble realising that a combination of tiles can sometimes be better than the individual tiles weighed against other individual tiles.

                                Comment

                                Working...
                                X