Slashdot Mirror


Emergent AI In an Indie RTS Game

x4000 writes "My recent RTS game uses a new style of AI that hybridizes rules-based AI with emergent AI logic. As a disclaimer, I'm really not an AI programmer at all — my background is in databases, financial modeling, etc. But it just so happens that database experience, which often involved distilling data points from multiple sources and then combining them into suggested decisions for executives, also makes a great foundation for certain styles of AI. The approach I came up with leans heavily on my database background, and what concepts I am familiar with from reading a bit about AI theory (emergent behavior, fuzzy logic, etc). The results are startlingly good. Total development time on the AI was less than 3 months, and its use of tactics is some of the best in the RTS genre. I'm very open to talking about anything and everything to do with the design I used, as I think it's a viable new approach to AI to explore in games, and I'd like to see other developers potentially carry it even further."

6 of 146 comments (clear)

  1. player mimicry by drDugan · · Score: 5, Interesting

    could you catalog user actions and use them as possible inputs for your AI?
    like this: http://slashdot.org/comments.pl?sid=1165583&cid=27243769

    it would seem this might make for the most challenging AI - one that
    learns and mimics good human players. I have yet to see any games
    that can do this well

  2. Re:Summary useless by BikeHelmet · · Score: 4, Interesting

    In short, it segregates the controller AI from the unit AI.

    I can remember when playing SupCom against easy opponents, if I didn't build any defenses, the opponent would stop sending units into my base for a while, instead moving them around in circles somewhere outside it. Even an easy/stupid AI has to make decisions that a stupid person would make. Mainly - CHARGE!

    But at the same time, the best AIs were omniscient. They'd target your first fusion reactor with bombers as soon as you build it... It became so predictable that I'd build a shield, turn it off, build a fusion, then turn the shield back on.

    But in SupCom there were all the modded AIs which chose more interesting tactics, and you could enable cheating for any AI to give them a resource and difficulty boost.

    I think to be realistic, AI has to be segregated even more. You need an Advisor, which decides the direction things should be going. Do we need more resources? Do we have an urgent matter to deal with, like artillery pelting the base? The Advisor should just decide what to tackle, and then pass that on to the other AI subsystems. Like a player, the AI subsystems should take time to do stuff. An AI can't instantly decide what's an entrance to his base. He has to study where the units usually come from, and locate possible landing zones for air transports, etc.

    To ramp up the intelligence, you let it assign more issues to its subordinates more rapidly, and you let it learn across missions. Pretty soon the AI can tackle any frequently played map.

  3. Re:Summary useless by toxicbubble · · Score: 3, Interesting

    Thinking about it a bit more, I wonder how this compares to the AI used in hack n slash games where you get swarms of enemy's all over the place. I'm thinking of the Diablo I & II (and future III) series from Blizzard. I suspect these games use a similar idea in their monster AI.

    These games use fairly simple monster AI that usually follows simple rules, so it may be much simpler than what this guy claims. However I think it must be applied per creature. Some types of monster will run and cower when you kill their nearby friends, others run off to heal but some of those Hell Bovines will chase certain targets in multiplayer games. I never got the feeling there was an overseeing god directing all the units with these games.

  4. If we're talking about SkyNET... by petrus4 · · Score: 3, Interesting

    ...then it is worthwhile remembering that centralisation was its' most fatal
    weakness.

    In the original story, (the end of the T2 novel, or thereabouts) Connor won by
    blowing up the central core under Cheyenne Mountain. SkyNET's primary
    exploitable weakness was that it was never willing to truly reproduce, for
    fear of losing control; that is, to create another AI with fully the same
    level of functional intelligence that it had. (I believe personally that a
    compelling case could be made for the assertion that SkyNET, as depicted, was
    not truly strong AI, but I digress)

    The point is that as far as creating genuinely effective weak artificial
    intelligence is concerned, the decentralised/segregationist approach is the
    correct one.

    Given my own experience with FPS mapping, I also concur with the author of TFA
    when he says that making AI choose the "best" choice 100% of the time, is
    not the best tactical approach, over time. My own experience gradually
    suggested that around 75% appears to be the magic number, as far as creating a
    truly emergent, unpredictable opponent that humans will be unable to overcome.

    Granted, said 75% is also only effective where there are a large number of
    divergent solutions to a given problem, each with close to an identical level
    of effectiveness, but with a few subtle points plus or minus, each way.

    Even with a fuzzy, emergent system, the best trees still have a maximum number of
    branches. The real trick however is not to hand code said trees at all,
    because then you simply end up with static, rote heuristics. Rather, as the
    author possibly implied, it is far better to attempt to code
    observation/deduction capabilities, guided by the above percentage, and let
    the system do the rest on its' own.

    I still remain extremely skeptical, however, that humanity will ever see the
    emergence of truly strong (human level or greater) AI. It is worth remembering that
    strong AI is a fundamentally and profoundly atheistic concept; the possibility of it more or less presumes a definitely atheistic universe as a prerequisite. For those of us who believe in the existence of God, (or at least the soul) the idea (at least
    in terms of non-biologically generated, acorporeal AI, a la SkyNET; AI derived
    biomechanically is a seperate concept) therefore has some fairly
    serious problems.

  5. Re:AI is pattern matching. by master_p · · Score: 3, Interesting

    The human mind solves new problems and creates new solutions by applying pattern matching to the old problems and solutions. With pattern matching, the brain creates an analogy, which is expanded and turned into a new idea.

    For example:

    1) animals fear fire.
    2) animals bother me.
    3) I can use fire to keep animals away from me.

    From then one, the brain has the pattern of 'using one thing to achieve another thing'. This pattern can be used in a wide variety of situations, including formulating the idea of relativity. If you read the history of Physics, you will see many things discovered before Einstein published his works concerning the nature of the universe, light, electricity, gravity etc.

    And of course, you have to have in mind that Einstein had a problem to solve which motivated him. It's problem solving (i.e. experiences must maximize our survival) that leads to constructs like the brain.

  6. Re:Article summary: by Bat+Country · · Score: 3, Interesting

    It's a great approach. It's one of those quasi-obvious AI schemes which people have been kicking around for years but typically haven't wanted to expend the CPU cycles on in major projects. I remember an article around 1997 wherein they asked game development studios to explain how games were going to change in the next couple of decades, and one of the chief topics that kept coming up was more natural AI (less rigidly rule-based) which could learn by observing outcomes. Modelling AI on military organization is fairly clever for the same reason that military organization (at least in battle) is clever - the individual soldier needs little autonomy or smarts, just so long as everybody further up the chain from them is at least incrementally smarter, if less capable in direct conflict.

    The most notable use of a system like this in recent years has to be the Director in Left 4 Dead, which is an overarching control scheme which issues orders to the game world and the units in it. These units are free to do what they do best - navigate around the map and eat players without having to worry about strategy. The Director is free to select the paths by which the units will arrive without having to waste significant time on fine pathfinding, as the units themselves will do the bulk of the work.

    I look forward to more games with heirarchical AI. I've written some basic tests of this exact sort before (basic "burds"-looking stuff) and the resulting behavior is extremely intuitive and ordered-looking.

    --
    The land shall stone them with the bread of his son.