Results 1 to 30 of 39

Thread: Battle AI Blog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Senior Member Fisherking's Avatar
    Join Date
    Feb 2005
    Location
    East of Augusta Vindelicorum
    Posts
    5,575

    Default Battle AI Blog

    Tuesday Nov 10, 2009

    Battle AI - By Mike Simpson

    Just before the end of Empire the lead Battle AI programmer left CA to return to his family up north.
    Unfortunately, thanks to Mr Wilberforce’s efforts 200 years ago we couldn’t stop him. It left us with a battle AI, which at that stage, struggled to beat good players in a fair fight, and was pretty much at the mercy of great players, even with a level of handicap (I call it cheating) that is all too obvious.

    Since then we’ve had our most talented programmers pick up where the deserter left off, but becoming the master of a chunk of code that took almost three years to write is not an instant thing. In the updates so far we’ve got rid of some of the worst behaviours that are close to the surface, and have started to tackle deeper issues like unstable decision loops that cause the AI to mill around rather than hold its line and fire. We’re also starting to add new behaviours, for example taking better advantage of hilly terrain. These improvements take the code further than we’ve been able before and will be there for Napoleon but we’re not sure yet whether we’ll be able to reverse them back in to Empire in a future update - the code has moved on. If we can we will.

    Our overall aim with the improvements is first to get rid of any erratic behaviour, second to improve general performance to the point where the obvious handicaps can be removed, and then to add a greater variety of ’smart’ behaviours. None of these have a fixed finish line - it’s a process of continual improvement, and each game will get AI better than the last one. Including Napoleon.

    Progress is frustratingly slow but thankfully rewriting the Rome: Total War codebase has left us with a clean codebase that is easier to work on, and an architecture that has way more potential than Rome’s. The main difference is the shift to a goal oriented planning system rather than a static system that has no long term plans. This has yet to fully pay off. But it will. When it does I’ll talk about it again.

    Battle AI is not rocket science - its way, way harder than that. It’s so difficult that very few strategy games attempt it. Most use simple scripts of canned behaviour that fire when you bump in to them, and very simple swarming behaviours. They’re limited, and are “gamey” rather than real world. What I mean by that is that the tactics you use to beat them are something that you have to learn for each game or sometimes each scenario/level, and bear no relation to reality. What we strive for is a game where real world tactics actually work. It’s not the easiest path to take, but it is the most rewarding.

    If you’re a genius C++ programmer, you understand exactly how difficult this problem is, but still think it’s the most interesting code problem in the world, apply for a job. We’ll find space for you.
    Posted by Mark in CA Updates on 2:42:07PM Nov 10, 2009

    http://blogs.sega.com/totalwar/2009/...-mike-simpson/
    Last edited by Fisherking; 11-10-2009 at 20:03.


    Education: that which reveals to the wise,
    and conceals from the stupid,
    the vast limits of their knowledge.
    Mark Twain

  2. #2
    Deadhead Member Owen Glyndwr's Avatar
    Join Date
    Jan 2007
    Location
    Santa Cruz, California, USA
    Posts
    464

    Default Re: Battle AI Blog

    That's nice, now where are the modding tools?
    "You must know, then, that there are two methods of fight, the one by law, the other by force: the first method is that of men, the second of beasts; but as the first method is often insufficient, one must have recourse to the second. It is therefore necessary for a prince to know well how to use both the beast and the man.
    -Niccolo Machiavelli


    AARs:
    The Aeduic War: A Casse Mini AAR
    The Kings of Land's End: A Lusitani AAR

  3. #3

    Default Re: Battle AI Blog

    This was a nice entry - unfortunately the main programmer leaving in the midst of development happens in many games (it has happened to Crusader Kings of Paradox too) - and its a thing that very little can be done about. Its to be commended uopn that a single coder was in control of the whole, this gives more cohesion and allows greater amount of control and detail over the code due to a single person being able to achieve greater knowledge over it, rather than compartmentalise the effort in between other coders and introduce the "broken telephone" effect of inter-team communications.

    The battle AI of Empire TW is by no means finished and i still feel cheated that Napoleon won't upgrade it - but it undoubtedly has potential to be better and the problem at hand (coding battles that all units have missile weapons) isnt an easy one indeed.

    PS To all those that have argued that M2TW had a better battle AI than RTW:BI, note that it is again stated in this entry that the best AI battle code they had was in BI and not in Kingdoms; apparently only peripherals were touched in M2TW by CA oz; it seems that there was no or very little work on the AI for that game, so statements from CA in general and Mr Simpson in particular at the time, that said "we are improving things accross the board" (the TW Story) were most likely simply marketing talk. As many have said for M2TW it was little more than an extensive mod for RTW.
    Last edited by gollum; 11-10-2009 at 20:40.
    The Caravel Mod: a (very much) improvedvanilla MTW/VI v2.1 early campaign

    Please make sure you have the latest version (v3.3)
    Since v3.3 the Caravel Mod includes customised campaigns for huge and default unit settings

    Download v3.3
    Info & Discussion Thread

  4. #4
    Grand Patron's Banner Bearer Senior Member Peasant Phill's Avatar
    Join Date
    Feb 2006
    Location
    Somewhere relatively safe, behind some one else, preferably at the back
    Posts
    2,953
    Blog Entries
    3

    Default Re: Battle AI Blog

    Quote Originally Posted by Mike Simpson View Post

    Since then we’ve had our most talented programmers pick up where the deserter left off
    I hope he means this humourously, otherwise we're playing the blame game again.
    Last edited by Peasant Phill; 11-10-2009 at 21:28.
    Quote Originally Posted by Drone
    Someone has to watch over the wheat.
    Quote Originally Posted by TinCow
    We've made our walls sufficiently thick that we don't even hear the wet thuds of them bashing their brains against the outer wall and falling as lifeless corpses into our bottomless moat.

  5. #5
    Camel Lord Senior Member Capture The Flag Champion Martok's Avatar
    Join Date
    Mar 2002
    Location
    In my own little world....but it's okay, they know me there.
    Posts
    8,257

    Default Re: Battle AI Blog

    That's indeed most unfortunate. Especially the part about the upgraded battle AI not being integrated into Empire.


    Quote Originally Posted by Peasant Phill View Post
    I hope he means this humourously, otherwise we're playing the blame game again.
    I concur. To be fair, I *do* believe he said that with his tongue planted firmly in his cheek, but he probably should've placed quotes around it ("deserter") or otherwise worded it better to reduce ambiguity.
    Last edited by Martok; 11-10-2009 at 21:55.
    "MTW is not a game, it's a way of life." -- drone

  6. #6
    Villiage Idiot Member antisocialmunky's Avatar
    Join Date
    Feb 2005
    Location
    ゞ( ゚Д゚)ゞ
    Posts
    5,974

    Default Re: Battle AI Blog

    That's some good insight. Never thought about that happening but I guess those are the risks you take when you hire a specialist like that. Maybe NTW will have some of the bugs worked out...

    I do disagree about the 'canned reactions' part. All game AIs use a deductive process to narrow down a set of possible actions to a single action that the AI has been scripted to do. It doesn't make them up as they go. I guess if you had some sort of crazy evolutionary algorithm for an adaptive AI like everyone wants to see it would be different but ETW is just as canned as everything else.

    At the end of the day, I rather see CA produce a game as great as they market it than another total failure of a game.
    Last edited by antisocialmunky; 11-11-2009 at 01:27.
    Fighting isn't about winning, it's about depriving your enemy of all options except to lose.



    "Hi, Billy Mays Here!" 1958-2009

  7. #7

    Default Re: Battle AI Blog

    will be there for Napoleon but we’re not sure yet whether we’ll be able to reverse them back in to Empire in a future update - the code has moved on. If we can we will.
    Heh. I knew it. Try to convince people to buy NTW because of the 'fixed' BAI which UNFORTUNATELY can't make it into empire.
    we’re not sure yet whether we’ll be able to reverse them back in to Empire in a future update - the code has moved on. If we can we will.


    None of these have a fixed finish line - it’s a process of continual improvement, and each game will get AI better than the last one. Including Napoleon.
    Seems a little contradictory, no?



    Since then we’ve had our most talented programmers pick up where the deserter left off
    The second they mentioned the lead programmer leaving, I knew they were playing the blame game again. CA has proved to entertain me though nowadays...
    Last edited by peacemaker; 11-11-2009 at 06:28.

  8. #8
    Member Member Zenicetus's Avatar
    Join Date
    Jul 2005
    Location
    On a ship, in a storm
    Posts
    906

    Default Re: Battle AI Blog

    CA could make an immediate, major improvement to the BAI just by eliminating the ability for the AI and the player to garrison buildings. In a more realistic game, both the AI and the player could choose to garrison any building or structure on the battlefield, which would keep the army together. Instead, (and probably due to 3D graphics limitations), only a few scattered buildings can be garrisoned, and they're never close together. The player is smart enough to choose one building to put troops in, with supporting troops nearby, using surrounding buildings to protect the flanks. The AI never does that. It just occupied all possible buildings with single units, while the rest of the army remains somewhere off in the distance. This allows the human player to pick off units one by one. Even when driven out of a building by artillery fire, the AI unit never rejoins the rest of the army, and the rest of the army never provides support. They're sitting ducks.

    I know there's a lot more that could be improved in the BAI, and this doesn't happen all the time because not all battles included buildings that can be occupied. But this is such a failure of a game "feature" that they should really just remove it. Sometimes simplifying the design is the right answer to improving it, instead of piling on more features that just become player exploits. I doubt that CA would ever do this, but it would immediately improve at least some of the battles.
    Feaw is a weapon.... wise genewuhs use weuuhw! -- Jebe the Tyrant

  9. #9

    Default Re: Battle AI Blog

    Rubbish. Nothing more than an attempt at raising sales for Napoleon.
    I'll be proven right as soon as Napoleon is released, which I won't be buying, by the way.
    Last edited by Nelson; 11-14-2009 at 13:56. Reason: slander

  10. #10
    Arena Senior Member Crazed Rabbit's Avatar
    Join Date
    May 2003
    Location
    Between the Mountain and the Sound
    Posts
    11,074
    Blog Entries
    1

    Default Re: Battle AI Blog

    Makes me wonder; what would CA do to cause a very important programmer to leave the project shortly before launch?

    Still, I hope they make a competent AI and I hope even more they put it into ETW.

    CR
    Ja Mata, Tosa.

    The poorest man may in his cottage bid defiance to all the forces of the Crown. It may be frail; its roof may shake; the wind may blow through it; the storm may enter; the rain may enter; but the King of England cannot enter – all his force dares not cross the threshold of the ruined tenement! - William Pitt the Elder

  11. #11
    Mr Self Important Senior Member Beskar's Avatar
    Join Date
    Feb 2008
    Location
    Albion
    Posts
    15,930
    Blog Entries
    1

    Default Re: Battle AI Blog

    Quote Originally Posted by Crazed Rabbit View Post
    Makes me wonder; what would CA do to cause a very important programmer to leave the project shortly before launch?

    Still, I hope they make a competent AI and I hope even more they put it into ETW.

    CR
    Probably because he didn't have the time to finish it, and SEGA executives wearing black suits, sunglasses and earpieces dragged him from his chair and took him to a black professional car and he was never heard of again.

    He was later found in the basement of EA, made to suffer scorn for eternity, programming DRM.
    Days since the Apocalypse began
    "We are living in space-age times but there's too many of us thinking with stone-age minds" | How to spot a Humanist
    "Men of Quality do not fear Equality." | "Belief doesn't change facts. Facts, if you are reasonable, should change your beliefs."

  12. #12

    Default Re: Battle AI Blog

    Well, this new system of AI has me optimistic - the less scripted behavior the better.

  13. #13
    Mr Self Important Senior Member Beskar's Avatar
    Join Date
    Feb 2008
    Location
    Albion
    Posts
    15,930
    Blog Entries
    1

    Default Re: Battle AI Blog

    Quote Originally Posted by A1_Unit View Post
    Well, this new system of AI has me optimistic - the less scripted behavior the better.
    Being honest, scripted behaviour actually makes it better. less scripted can usually overcomplicate or overwhelm.
    Days since the Apocalypse began
    "We are living in space-age times but there's too many of us thinking with stone-age minds" | How to spot a Humanist
    "Men of Quality do not fear Equality." | "Belief doesn't change facts. Facts, if you are reasonable, should change your beliefs."

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