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."

8 of 146 comments (clear)

  1. Article summary: by ActionJesus · · Score: 5, Insightful

    "I just wrote a game. Heres some techy stuff to get it posted on slashdot. Yay advertising!"

  2. 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

  3. Summary useless by toxicbubble · · Score: 5, Informative

    Summary reads like a marketing blurb but the actual article is slightly more interesting. The basic idea is that in an RTS game, the AI is at a unit level rather than an 'almighty all-seeing controller'. It is a fairly interesting idea and does sound sort of different way of thinking about computer RTS opponents. Weather or not this actually makes for a fun game or a good idea remains to be seen, but at least there is something (dare I say) slightly innovative about this.

    1. Re:Summary useless by x4000 · · Score: 5, Informative

      Quite valid -- intelligent agents are not a new idea (I'm the dev from the article). However, the vast majority of RTS games are still using decision trees, I guess because the prevailing wisdom is that such is needed because of the complexity of RTS play. Is it so surprising that industry lags behind academia? But, even my approach is not purely an intelligent agent approach, but rather combines in a bit of global logic as well (for reinforcements, choosing global attack targets, etc). I think that a hybridized sort of approach is really needed for RTS games, since they do have so many levels at once.

  4. Not all that new by The+Optimizer · · Score: 5, Insightful

    I seem to remember most all of these things were in (or experimented with) the RTS games I worked on a decade ago - Age of Empires/Kings/Mythology (Decentralized Intelligence, Strategic Tiers, Sub-Commanders, etc). Not all of those were exposed to the end-user via the AI script / expert system / etc, and things improved with each iteration.

    I also remember that while some Ai things may have seemed like great ideas, and were neat to implement, they didn't always make for a better game experience.

    And I personally say you should make an economic AI that is bound by exactly the same rules as human players, and doesn't cheat at all. And as I remember, the definition of 'doesn't cheat at all' was an occasional ongoing discussion and subtle things that could be considered as cheating, like 'Can I Path from here to there?' or the reactions times of the computer vs a human sometimes had massive implementation ramifications.

    A good test in my book was 'can the AI handle a wide range of truly random maps / game worlds.

    Humans will always be finding the limits of Computer player AIs, and saying you'll just put in counter code whenever someone tells you of your AI's limits... Hmmm... I think that's weak.

    All this has been done before, and all this will be done again.

    All the above is solely my opinion and recollections, and in no way speaks for anyone but myself.

  5. Add some flaws. by apodyopsis · · Score: 5, Informative

    I'll ignore the shameless plug.

    Ever since I wrote my first connect 4 game in the 80s - and was totally thrashed by it, I never beat it - its been clear to me that the trick is to degrade a computer player in most circumstances to the level that it appears to have human flaws and play in a more human fashion.

    Of course this logic only goes so far and some games require a search space so vast or a completely different programming model that even now a computer cannot beat a competent real human (Go is an excellent example of this).

    The point is that it is easy to program a computer to win, the hard part is to program is lose convincingly.

  6. Superficial Intelligence by Anonymous Coward · · Score: 5, Funny

    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 which blew up the stock market.

  7. Re:Like to see.... by x4000 · · Score: 5, Informative

    I'm not going to release the game for free, given that if I'm to be able to continue to pursue game development it can't continue to be in my hobby time forever. For similar reasons, I'm not going to release the entire code as open source. However, I've already open-sourced a lot of smaller things from my code (force feedback code from my other game, fixed-int math from this game, etc). Also, I've now added a second part to the article which has some partial AI code from the game, and people are free to use the ideas there and build off of them as much as they want. I don't want people to make AI War clones, but rather to think about the ideas that I am presenting and implement them in their own way. The AI War code is not the only way to approach this general design philosophy, not by a long shot. Here's part 2 of the article, with the added code and such: Designing Emergent AI, Part 2: Queries and Code