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."
"I just wrote a game. Heres some techy stuff to get it posted on slashdot. Yay advertising!"
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."
If you're serious about this, then release it under a Free software license.
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.
The notion of intelligent agents has been around for quite a few years.
Even I, 12 years ago at the University, had to implement a miserable little game where the A.I. was at a lower level than an all seeing, all knowing AI that makes decisions, each agent with it's set of "intelligent", adaptive rules.
So... how is this concept new (or NEWSworthy, for that matter)?
In the end, there can be only one!
You never beat your Connect 4 game? I used to play such a game on my dinosaur PC in the early 90s. The AI even had a name: Olivetti. It was perfect; it would always win.
Unless you tricked it.
You see, you have to counter his every move, and anticipate the last column that will be left. Eventually it'll be forced to put his chip in the last column, which allows you to win.
This looks like a similar approach to one I have been thinking about for a while now.
This type of layered control is very likely to be the future of all AI, not just that in games (I say this because there is some evidence that the human brain works in exactly this manner). I have a suggestion: let the thing fight itself. Begin with the same basic game, and rather than the randomness and fuzzy logic that you use (what does that mean? Can we see your algorithms?), use an artificial neural network for each unit, another for each "squad" (all nearby units, allows for flanking and such). Something with a few input nodes, a single hidden layer, and a similar number of output nodes should probably be all that's needed for the units, and the squad AI would only need a few more than that. This would likely be more computationally expensive, but it has one big advantage: it will learn.
Begin with two full armies, each with their NNs randomly generated. Use an evolutionary algorithm, and have the winner fight the winner. Not only does this allow you to create a solid AI with minimal effort (see here), but when you have your final AI, it will be able to adapt to a specific player's gameplay style (over the course of several games). Replay value is off the charts, development takes a bit more initial effort than what you have, but in the long run you'll get an AI that genuinely uses tactics just like a real human player. I'm not sure how this could be adapted to a commander AI that would dictate broader strategy (due to the complexity of the NN required, you'd probably need a monster computer to run it), but it would be the sort of thing to try.
Also, this same approach would also work for strong AI, if we had any idea what sorts of NNs to create. RTS is a much simpler problem, and has a lot of applications (pathfinding, planning, coordination) to other types of AI.
If I've entirely misunderstood what you're doing here, I'm apologize, but TFA had more pop culture references than technical details. Reply if you want me to clarify any points.
Obligatory Soundbite Catchphrase
The human brain is simply a pattern matching engine designed to find the most appropriate response in order to maximize survival.
"simply"?! How can you not be in awe of such a machine? I counter your implied apathetic bias with my own bias of amazement. (^_^)