Results 1 to 18 of 18

Thread: Hard Rules of war: Another look at AI

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Research Shinobi Senior Member Tamur's Avatar
    Join Date
    Aug 2004
    Location
    #2 Bagshot Row
    Posts
    2,676

    Default Re: Hard Rules of war: Another look at AI

    Interesting list & question. I was thinking of doing the same sort of thing but exclusively with the diplomacy engine -- "how hard can it be" gets asked a lot, I was going to give it a go and see.

    There are a lot of approaches you can take: everything from a huge list of rules (rules which can be broken by the human player to great effect, as you noted), to the game-time impossibility of a neural network.

    There are other middle-of-the-road ways as well. One way that hasn't been explored terribly well for game AI is genetic algorithms. The basic idea is that any situation is a problem to be solved, with more or less optimal solutions, and solutions can be evolved by considering hundreds or millions of solutions to the same problem, then store the best result for future use and mutation. Thus the genetic aspect.

    In programming terms, given a specific set of inputs, in this case:
    • how many troops of what type does the enemy have
    • how are they arranged
    • what are their vectors (velocity and direction)
    • what terrain are they standing on
    • what is between them and us

    what is the best troop position & vectors for the AI army?

    The problem is that the list of factors to consider is not just limited to what I've listed, and can be postively Huge.

    But, this sort of approach is extremely flexible because in genetic algorithms, one cannot specify rules like you were listing. The computer has to learn not to charge horsemen into sharpened wooden stakes from experience. The experience comes before the game ships (i.e. the AI is trained as part of the game development process).

    Rambled on too long. I'd definitely like to see some exploration in this area rather than the endless moaning that goes on. CA have been facing a challenge greater than any other strategy game on the planet for years with the battlefield AI.

    Good luck!
    Last edited by Tamur; 07-21-2006 at 19:00.
    "Die Wahrheit ruht in Gott / Uns bleibt das Forschen." Johann von Müller

  2. #2
    Member Member sunsmountain's Avatar
    Join Date
    Sep 2003
    Location
    Netherlands
    Posts
    414

    Default Re: Hard Rules of war: Another look at AI

    So I ask could you really try and capture the essence of war strategies with hard rules or is it doomed to be overcome by competent human players no matter what?
    Yes, it's a book called Sun Tzu's Art of War, and CA have already implemented it since the start. The reason they abandoned the Medieval:TW AI was because of a new engine, and they wanted 20 individual units to think for themselves (unit level AI) as well as listen to army level AI, something they found lacking in the MTW AI.

    Unfortunately, they bit of more than they could chew, since individual units are now stubborn as hell and coordinate their attacks little. They are now in the process of writing the army level AI which has to calculate a respons given any situation. They think they will succeed because they think that if the army level decision is wrong, the unit level decision is still right. A human can do this. A computer might.

    I'm still undecided about whether they will succeed. They haven't so far...

    The problem is that the list of factors to consider is not just limited to what I've listed, and can be postively Huge.
    It is. Because of that, of the factors you list, 2 are used, 3 are not:
    # what are their vectors (velocity and direction)
    # what terrain are they standing on
    # what is between them and us

    Troop type is evaluated together with relative distance to a particular unit by that unit. If it is advantageous for that unit to attack that troop type and the enemy is close, attack & run. If further away, attack & march. If disadvantageous and close, wait. If disadvantageous and further away, move away from that troop type towards a second enemy while keeping your distance with the first enemy, leading to stupid stuff like AI line breaking, all its sword units focusing on your 1 spear unit... etc. The AI should start thinking sooner rather than later.

    But, this sort of approach is extremely flexible because in genetic algorithms, one cannot specify rules like you were listing. The computer has to learn not to charge horsemen into sharpened wooden stakes from experience. The experience comes before the game ships (i.e. the AI is trained as part of the game development process).
    The biggest problem with these algorithms is that kind of the right answer in battle is the wrong answer. If you're kind of approaching my units from the right attack vectors, but your flank is kind of showing, I'm kind of going to butcher you. Next time, the flanks will be good, but that means the unit has turned, and then the attack vector (and essentially, timing) is wrong.

    CA's approach has the black/white advantage, it either works or it doesn't. But they have to get it exactly right...
    in montem soli non loquitur

    (\_/) (>.<) That's what happens with bunnies
    (x.X)(_)(_) who want to achieve world domination!

    becoming is for people who do not will to be

  3. #3

    Default Re: Hard Rules of war: Another look at AI

    * Use artillery to force enemy off high ground.

  4. #4
    Member Member DensterNY's Avatar
    Join Date
    May 2005
    Location
    New York, New York
    Posts
    155

    Default Re: Hard Rules of war: Another look at AI

    Good discussion and as you guys can see the minute you start to try and analyze the AI situation you realize how complicated it can be. As we've established strategy in war must be dynamic in relation to battle conditions, your enemy and the quality of their commanders. A human player can make quick decisions to accommodate changes and to take advantages and minimize disadvantages. Unfortunately, I'm not sure what guidelines the AI has in TW beyond Medieval I but there are entirely too many moments when the AI is simply stuck.

    I'm not sure what could be the next step in AI development because even if they eventually figured out how to make a generally competent AI in the field then you will still have to plan for guile and deceit. I know I've won quite a few battles by sneaking shock troops/cavalry behind enemy lines and smashing into them when formally engaged.

    Also, in the end the human player will simply dominate because we can learn and adapt to win. Yes, CA did reference the Art of War but as a human player I have Caesar, Scipio Africanus, Hannibal, Alexander and Genghis as my tutors.
    "The greatest pleasure is to vanquish your enemies and chase them before you, to rob them of their wealth and see those dear to them bathed in tears, to ride their horses and clasp to your bosom their wives and daughters."

    -- Genghis Khan

  5. #5
    Member Member sunsmountain's Avatar
    Join Date
    Sep 2003
    Location
    Netherlands
    Posts
    414

    Default Re: Hard Rules of war: Another look at AI

    I'm not sure what could be the next step in AI development because even if they eventually figured out how to make a generally competent AI in the field then you will still have to plan for guile and deceit. I know I've won quite a few battles by sneaking shock troops/cavalry behind enemy lines and smashing into them when formally engaged.
    If they would succeed in making a generally competent AI I would already be afraid, actually. Because competence already implies being able to handle different tactics. And when you really get down to it, there are no such things as sneaking or smashing, there are only positions, vectors, attack rolls, casualties, etc.

    Also, in the end the human player will simply dominate because we can learn and adapt to win. Yes, CA did reference the Art of War but as a human player I have Caesar, Scipio Africanus, Hannibal, Alexander and Genghis as my tutors.
    And the AI has the possibility of calculating all possible outcomes in advance, vastly outweighing any historical general. Perhaps not during battle, as it is constrained by time. But that will be the only safeguard against an AI simply outsmarting us.
    in montem soli non loquitur

    (\_/) (>.<) That's what happens with bunnies
    (x.X)(_)(_) who want to achieve world domination!

    becoming is for people who do not will to be

  6. #6
    Member Member DensterNY's Avatar
    Join Date
    May 2005
    Location
    New York, New York
    Posts
    155

    Default Re: Hard Rules of war: Another look at AI

    Quote Originally Posted by sunsmountain
    If they would succeed in making a generally competent AI I would already be afraid, actually. Because competence already implies being able to handle different tactics. And when you really get down to it, there are no such things as sneaking or smashing, there are only positions, vectors, attack rolls, casualties, etc.
    I meant competent as opposed to completely incompetent which is what we've had since RTW with the AI. As it stands it cannot cope with nearly any tactic that the human player has to offer so it would be a refresher for the AI to behave at a minimum as it did in MTW. At least then it fought as an army and moved and positioned itself to its maximum advantage as opposed to attacking pell mell with no strategy at all.

    Quote Originally Posted by sunsmountain
    And the AI has the possibility of calculating all possible outcomes in advance, vastly outweighing any historical general. Perhaps not during battle, as it is constrained by time. But that will be the only safeguard against an AI simply outsmarting us.
    Although I understand your concept that the AI has the computer's raw calculating ability at its disposal it really wouldn't benefit in this situation even given a fast enough processor. First, it could evaluate the troops, terrain and quality of general of its opposition then guess what the enemy may do and then calculate from there but this is only effective against another AI general who'd behave in an expected manner. However, a human AI can and will do any number of unexpected things which would mean the AI's original calculation would be thrown out. And as it was busy trying to recalculate what to do the human general would be butchering their troops and routing them from the field.

    I believe it was Julius Caesar who was asked about field strategies and he answered something to the effect, "Show me my men and show me my enemies and then I'll give you strategy and tactics." So in order to have a challenging AI we would need one schooled in the arts of war, disciplined, intuitive and battle experienced.
    Last edited by DensterNY; 07-24-2006 at 19:50.
    "The greatest pleasure is to vanquish your enemies and chase them before you, to rob them of their wealth and see those dear to them bathed in tears, to ride their horses and clasp to your bosom their wives and daughters."

    -- Genghis Khan

  7. #7
    Research Shinobi Senior Member Tamur's Avatar
    Join Date
    Aug 2004
    Location
    #2 Bagshot Row
    Posts
    2,676

    Default Re: Hard Rules of war: Another look at AI

    Quote Originally Posted by DensterNY
    So in order to have a challenging AI we would need one schooled in the arts of war, disciplined, intuitive and battle experienced.
    Which is exactly the thrust of my initial post in this (very interesting) discussion -- it is possible to give an AI the base rules, discipline, and experience you speak of. Intuitiveness, that's a different story of course.

    Or at least it is possible in theory. Reality, that's yet to be determined.
    "Die Wahrheit ruht in Gott / Uns bleibt das Forschen." Johann von Müller

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO