AI much too eager to pillage

Discussion in 'Civ4 - Strategy & Tips' started by morchuflex, Mar 13, 2006.

  1. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    The point you make about predictability is a good one. It's good if the AI would make some unpredictable, non-optimal moves. However, the pillaging behaviour of the AI is pretty predictable and non-optimal.

    You know that the AI will pillage with that lone unit that is just outside your border and you know that you will kill that unit when it does. I don't say that the AI should never pillage. It should do it sometimes, just not all the time.
    Another thing is that the pillaging unit is almost always a single unit or a few units of the same type (mostly horse based fast units). These groups can be defeated with minimal losses. It would be nice if the AI sometimes used a mixed group of 3 different types of units so that the pillaging group can defend itself.

    Pillaging is not a bad strategy in itself, but always pillage with a single (type of) unit (which is close to the strategy of the AI) is a bad strategy. The strategy could be improved without becoming predictable.
     
  2. maltz

    maltz King

    Joined:
    Jan 24, 2006
    Messages:
    967
    The thread confuses me a bit, since I keep reading people saying "War of Attrition" is useful in Civ games. Personally I don't use it, because I build more catapults than melee units. ;)

    AI will send out "spare units" from a city during a war. They even do it when they are down to the last few turns of holding a city, and sending units out from this city will make them lose the city in the next turn (!). Perhaps they are just doing suicidal attacks to show they have guts.

    When they are assaulting the invader. they just throw whatever they have to spare. I have not seen any particular pattern, except they usually have a few catapults to throw away.

    When the AI goes attacking, it seems to me that there are 3 AI attack types:

    A. Single pillage units, as the topic mentions. The AI does it when they recognize that I have a poorly defended city, but they don't have what it takes to bring down the city yet.

    B. Small, mix of unts, such as 1 spear + 1 archer + 1 axeman. Depending on how many cities / what kind of resources the AIs has to produce troops, the number and composition may differ.

    C. Stack of death. A huge humber of units, sometimes of the same type. I have seen Isabella with a stack of 15 horse archers (fortunately they were here to help me!).

    Personally I have not really seen too much pillage done to me. I was mostly the invader, and had their spare units sent at my advancing stack of doom. I always keep one or two spears and horses behind, so I can intercept their pillaging force, though.
     
  3. jpowers

    jpowers Emperor

    Joined:
    May 7, 2002
    Messages:
    1,491
    Location:
    The Castle Aaaaaaaargh
    Neither of these statements are true.
    1. The brute-force ability of a computer to process state space allows it to be undefeatable in a game of checkers, able to easily beat the humans that programmed it. Once memory and processors catch up, chess will be next.
    2. The entire field of learned computer behavior gives computers access to the same building blocks of adaptation that humans use. So far we have not been able to throw an equivalent amount of horsepower than that which humans have in their brains, but this is a physical limitation, not a philosophical one.
     
  4. Brave Jay

    Brave Jay Warlord

    Joined:
    Mar 2, 2005
    Messages:
    243
    Location:
    Texas
    The only way that i would consider pillaging is if i did not have the strength to take the ai's cities outright. Then I would focus on mines and anything the ai would use as production, and of course strategic resources. i hate the thought of pillaging towns if i think i will be owning those towns in a few short turns.

    The Ai does tend to spread itself thin way too many times. I have seen many times that it will send a unit here or there into my land to pillage or destroy workers, meanwhile i am sending a huge force to the ai capital only to find it not fully defended the way it should be. If i were the ai in that case, i would focus on sending every unit i could spare into my capital to try to thwart the attack while building defensive and counter units asap. the ai doesn't seem to ever consider doing it though.
     
  5. DynamicSpirit

    DynamicSpirit Fear him of the pink tie Moderator GOTM Staff

    Joined:
    Dec 23, 2005
    Messages:
    6,180
    Location:
    London, UK
    I'll pillage towns for the gold if I'm planning to raze the city that uses them.

    btw on the subject of pillaging, I love the way you can pillage city ruins, leaving behind pristine countryside. I'm sure there's something the wrong way round there :crazyeye:
     
  6. Brave Jay

    Brave Jay Warlord

    Joined:
    Mar 2, 2005
    Messages:
    243
    Location:
    Texas
    That's cool. I didn't know you could pillage ruins. does it give you any gold?
     
  7. DynamicSpirit

    DynamicSpirit Fear him of the pink tie Moderator GOTM Staff

    Joined:
    Dec 23, 2005
    Messages:
    6,180
    Location:
    London, UK
    I don't think so, though I may be wrong. (It's not the sort of thing I've done very often, I just mostly notice the menu button there and the popup that says 'will remove city ruins')
     
  8. Brave Jay

    Brave Jay Warlord

    Joined:
    Mar 2, 2005
    Messages:
    243
    Location:
    Texas
    they should make it give you a little gold, you know how archaeologist are always uncovering rare treasures and artifacts from ancient city ruins
     
  9. pholkhero

    pholkhero Deviant Mind

    Joined:
    Feb 24, 2006
    Messages:
    5,656
    Location:
    Philadelphia
    I also think that if you want to build on the site once occupied by another city, clearing hte ruins will ensure that your new city will have no "yearning to join the motherland" of the previous city's civ...
     
  10. megalomaniac

    megalomaniac Push the red button!!

    Joined:
    Dec 31, 2005
    Messages:
    64
    Location:
    South Korea
    You fail to consider something:
    If the programmer or anyone else who can understand the code were to follow the same algorithm used by the computer, their play would be exactly on par with the computer. The problem is that no sane person would want to take the time to perform all the analysis and decision-making calculations (hundreds of lines of code) executed by the computer every turn in a split second. People could do it, but not in a timely manner. The limitation is that of human patience, not processing power.

    Take for example the game of chess. Some of history's best minds have attempted to create an algorithm (an AI) that could defeat the best masters of the day. I have not seen or heard of any of them being successful to this day.
     
  11. Fetch

    Fetch When in doubt, reboot.

    Joined:
    Jan 26, 2006
    Messages:
    615
    Location:
    Statesboro, GA
    Don't forget Deep Blue. Read about it here. Deep Blue (a supercomputer) beat Garry Kasparov in 1997.
     
  12. DynamicSpirit

    DynamicSpirit Fear him of the pink tie Moderator GOTM Staff

    Joined:
    Dec 23, 2005
    Messages:
    6,180
    Location:
    London, UK
    I think there is something more. Yes, people could do it, given enough time, but they probably wouldn't understand why whatever decision has fallen out of the algorithm is a good or bad decision, and what the overall basis for making it was.
     
  13. Wreck

    Wreck Prince

    Joined:
    Jan 4, 2006
    Messages:
    331
    Sure, but neither does a CPU understand what it's doing when it runs Civ. Nor, for that matter, do your neurons understand what your brain does. That doesn't mean you can't think. It shows a confusion between parts and the whole.

    As for humans acting like computers... well in theory it is possible, I guess, if you allow for very, very precise humans who never tire or make mistakes. However in reality humans are fallible, that is to say, human. And we would not be able to do what computers do in running most programs; we'd make mistakes long before completing the task. So the person you're responding to isn't completely right about that. (I realize his point was theoretical of course, and he's right as far as that goes.)
     
  14. Brazenheart

    Brazenheart Chieftain

    Joined:
    Mar 6, 2006
    Messages:
    7
    Location:
    Boston, MA
    Absolutely. Despite its many intricacies, however, chess is a relatively simple game to program an AI for. The "brute force" technique to win at a game of this nature involves building a tree of all possible game decisions and then analyzing which decision will put you on a path where the minimum amount of "good" (as defined by your heuristics) you can obtain is highest and the maximum amount of "bad" your opponent can inflict on you is lowest. Hence, for a simple game (like, say, Othello), you can look out nine turns from now and decide what move will put you in the best position in nine turns. It's called a Min-Max algorithm.

    The problem arises when there are a number of choices that diverges rapidly (such as Go or Civilization), you can no longer use this brute force method. You're basically reduced to heuristics. In essence, the AI is unable to analyze the effect of its actions in the long term.
     
  15. Wreck

    Wreck Prince

    Joined:
    Jan 4, 2006
    Messages:
    331
    The best chess AIs can beat all chess players but one, and him, sometimes. Insofar as Moore's law will keep rolling, Kasparov is most likely the Last Human Chess Champ.

    But anyway, I wish folks here would stop using chess to compare to Civ4. Chess is a bad analog. Chess is a game of perfect information. In theory, one can analyze the game fully from the start position; with ideal play, it's a black win, a white win, or a draw. If you had the processing power and storage, you could compute the full-game strategy for chess.

    Civ4 is nothing like that. Not only do you lack lots of information when the game starts, but there is randomness in the game. Thus no fixed strategy can be tabulated, as can be done for chess.

    Chess, as a problem in AI, is misleading. For all of the hugeness of the search space, chess is still a very limited size search space by comparison to many other games. Thus, chess is vulnerable to what amounts to brute force searching. Now, admittedly part of the fun of doing chess AI is in trying to make better heuristics for pruning the search; there's something like intelligence there. But still, most of the power of modern chess AIs is not in being "smart", as such, but in seaching millions of positions.

    Put another way: Kasparov looks at a board, and "sees" only a handful of viable moves; the best ones. Maybe 2 or 3 of them; then he searches the best ones a few ply. Deep Blue looks at a board and sees 6 viable moves, searches every move to 10 ply, then starts pruning the worst positions, seaching to 20 to 30 ply. What it's doing is nothing like what Kasparov does.

    The "strategy" used in chess also works in checkers, which has an even smaller search space. But it doesn't work in go, which has a much larger board, and more pieces (though only two types). And it certainly won't work in Civ4, where the board is vast.
     
  16. cymru_man

    cymru_man Prince

    Joined:
    Oct 12, 2002
    Messages:
    400
    Location:
    UK
    What does annoy me, is when they move a mixed stack with like a load of 1 movement units and a few horses through your land. Every time they move 1 space and the AI uses the leftover movement points on the horses to pillage. *that* is annoying. But as a whole I don't think I've noticed AI suicidally pillaging, except for key resources (lux/strategic)
     
  17. Wreck

    Wreck Prince

    Joined:
    Jan 4, 2006
    Messages:
    331
    So, what would in Civ4 to make the AI "smarter"? Well, someone back there suggested artificial learning - good luck on that; if you succeed, you win the AI holy grail and become a zillionaire. :) No, the only thing we can do that's likely to work is hard-coded strategies. That is, we as smart humans analyze the game, and determine good heuristics for what to do in all the most common situations; then we find a way to program the AIs to do that.

    The key here is, essentially, reaction. What the AI can't do in a systematic way is plan in the sort of sense we're used to. Rather, it just reacts.

    A human assembles a kill-stack and moves it up. He uses it as a sort of composite entity, which moves together (although flexibly leaving back parts to heal), attacks in a calculated way (usually going for 0% walls, but not always), pulling back if too damaged, etc.

    An AI doesn't do this. It just has a bunch of units; if they coordinate it may be one of several reasons:
    • pure luck
    • programming to specificially make an AI create a stack, with specific exceptions for healing, running away, etc.
    • programming which makes stack-like behavior, without real coordination
    It is that last that I consider desirable (hence my earlier suggestions), because I consider it the most powerful approach that is easily within our grasp (meaning: profoundly dumb).
     
  18. megalomaniac

    megalomaniac Push the red button!!

    Joined:
    Dec 31, 2005
    Messages:
    64
    Location:
    South Korea
    Ok I stand somewhat corrected on that count. I say somewhat because Kasparov defeated Deep Blue in 2 of the 6 games, and one of them forced a stalemate. Deep Blue may have won, but it is by no means unbeatable. Also bear in mind that the development of chess "AI" has been going on for at least 200 years now.

    On another note, brute force algorithms are impractical for implementation even into games as simple as checkers. There are simply too many possible outcomes for the program to consider before making a move.

    As for making the Civ AI smarter: they could adjust the weight on pillaging in the AI's priorities. That way it wouln't be so eager to destroy every improvement it sees (maybe just around strategic resources).
     
  19. DynamicSpirit

    DynamicSpirit Fear him of the pink tie Moderator GOTM Staff

    Joined:
    Dec 23, 2005
    Messages:
    6,180
    Location:
    London, UK
    While that is strictly true, I suspect the difference isn't as significant when you factor in the need to consider the other player. In chess, just as in civ, the strategy that you would use against a novice player is often different from the strategy that would work best against an experienced player. You might for example be able to reliably lure the novice into traps that an experienced player would always know to avoid. That's where ultimately brute force algorithms that examine every possibility fail: They don't take account of the need to analyze what the other player's skill level and tactics appear to be, and to adjust your own tactics in accordance with that. When you take that into account, you are - in both chess and civ - dealing with estimated probabilities that your opponent will or won't do certain things, and ISTM that viewed in that way, the randomness in civ just comes in as another probability - which therefore doesn't change the principles of what you're doing. eg. you might reckon there's a 10% chance your opponent will try to found a city near that gold sometime in the next 20 turns, and a 50% chance that a barb will appear there. And you'll need to decide on best tactics to take both things into account.

    Of course this is all theoretical - It'll probably be Civ 10 or Civ 15 or something before anything approaching this reasoning makes any appearance in Civ AI ;)
     

Share This Page