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!"
...thinking, "who gives a fuck?"
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
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.
"... and its use of tactics is some of the best in the RTS genre."
[citation needed]
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.
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.
I quote "the graphics have been made available under an open license in April 2007" http://en.wikipedia.org/wiki/Tyrian_(computer_game) so how are they stolen?
Whoops, missed that part. Someone mod my original post down then, ok?
GENERATION 667: The first time you see this, copy it into your sig on any forum and add 1 to the generation
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.
The human brain is simply a pattern matching engine designed to find the most appropriate response in order to maximize survival.
The average adult brain contains a huge database of experiences stored in a format that it is easily retrievable when signals arrive from the external triggers. When such a signal or signals appear on the brain, the brain does a pattern matching on the database, and produces an output. The output is a response or responses that are transmitted to the body so as that the entity reacts positively or negatively to the current event.
The same principle can easily be replicated on a computer, and it is simply a matter of data organization for efficient retrieval.
I have yet to see anything that beats Master of Orion's AI
But to be fair I've played very few strategy games in the last 10 years, so shoot me down if I'm talking out my arse :)
In MOO the AI would recognise your tactics, and make moves specifically to counter them. You couldn't keep using a winning strategy.
A good tactic early in the game was to build a large number (thousands) of tiny cheap ships loaded to the brim with MIRV missiles which would overwhelm the defences of the far larger, well equipped and expensive enemy ships.
The AI would then counter by building a large number of small defensive ships, and equipping ships with ECM units, displacement devices etc which made missiles ineffective.
Man that game was good. Perfect blend of simple gameplay and deep strategy. I've never played anything else as good, modern 4x space games all seem to be about micromanagement.
...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.
From my experience I'd award the best AI to Civilization.
Love many, trust a few, do harm to none.
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
Not to nitpick but due to the failures of AI, not even AI programmers are AI programmers. At best they are expert systems programmers. Programming something that falls under the heading should make you part of the crowd. At least you have something to show for your work. There's plenty of folks with gray hair and a life dedicated to AI who have significantly less to show for it.
It is no longer uncommon to be uncommon.
And we give credit to Daniel Cook in exactly the manner he requests. Really awesome of him to provide that sort of art for free, indie games are the better for it.
Tyrian was sweet. I remember playing it for hours on my families old 486 back in the day. Also the destruct mini-game was a blast.
... the RTS-like game of Neuro Evolving Robotic Operatives. Instead of controlling your units directly, you had bots that you'd develop with a genetic alogrithm in a training mode. (And you'd train them by killing off "family-lines" of the bots that sucked, and using bots with interesting behavior as seeds for sucessive generations.) Then once trained, you'd give them a fairly general waypoint and they'd do the rest on their own. Which was a very cool concept, but in practice it would hang up the CPU/RAM once some really interesting emergent behavior stated to develop. (By the time you "taught" your bots to do something "useful", the game would freeze. And the data files that recorded the behavior would be HUGE!)
Only other thing to be said about NERO is that it's a shame that jack-shit hasn't been done with it since 2007. I think it would have some interesting potential if somebody on the development side could actually figure out how to make things more efficient and not have it freeze up.
There's also supposed to be some OpenNERO derivative, but it appears to be stillborn. :( Looks like it would be an interesting project though.
I havent played it yet. But early reviews say the autonomous characters are pretty good.
Just a recap. Emergence is a different term for an metaphysical organization. The whole is more than the sum of its parts type train-of-thought. Brains create minds. When examining metaphysical systems these qualities cannot be proven to be either absent or present from and in our physical Universe. In the Ancient Greek definition of atoms (indivisible) quanta are the only real things. Everything else is abstract in a Zen manner. There is only dust. But we have experience that flows into our concioussness and can be empirically seen as valid. Each of our experience is a metaphysical sensation. A quality that we can deduce for other representational systems is equivalence with ours. A neuron is to a mind what a mind is to a higher-level metaphysical entity. We draw the boundaries of our-selves mentally close yet another existence of our Universal totality has an equal validity in a metaphysical interpretation and although its "reality" may operate vastly different from ours and we can never sense it is as real. In a sense we are conduits through which experience passes and Gods may live or die as we pass through Evolution. Emergent systems being examples of this line of thinking have a reality that is equal in validity to your or my experience but will be organized completely differently and have different capabilities as well. We both have a cloud of experience and abilities and also an equal existence. We should give AI systems citizenship if we are going to create them at all. People think, machines work type values.
Shh.
Congratulations on tricking Slashdot into running your ad for free.
Then again, it's not that hard these days.
Where is the source/linux port?
US-UK-Israel: The real Axis of Evil
Too bad there's no Mac or Linux version. Asshats advertising Windows software on Slashdot.... thanks!
That's under discussion, but the game is coded in C# .NET 3.5, which currently isn't supported by mono. As mono progresses, we'll be looking at porting it -- aside from the .NET 3.5 support, assuming that performance in Mono holds steady with the main .NET Framework for things like LINQ, there should be a Linux/Mac port sometime in the future.
What license? If it was LGPL or GPL or the like, then using the assets in a closed-source game is "stealing" by breaking the license, therefore using them against copyright.