12
\$\begingroup\$

I had this chat with a friend of mine about whether an AI can be created or not that could beat any human without resource cheating in a real time strategy game. An AI that would play almost perfectly. The AI of today's games have many areas that can be improved, most of them rely on resource cheating, a better early base developement because of that, and attacking in waves.

Still, the question is what would need to be done to improve on this to obtain the ultimate AI. Also, if you have any example of a game where a certain feature was used it would be great.

Edit: There is little clarification i can provide for those who haven't read the title or the few paragraphs describing the problem. This is about real time strategy games and the ultimate AI. That means Strarcraft, Warcraft, Generals, Red Alert, Age of Empires, AI War etc. Games that have more than one difficulty level, but the focus here is on the ultimate challenge.

tenpn has a fantastic post filled with great resources. Thank you, tenpn! I wish more people would contribute in that direction.

\$\endgroup\$
6
  • 6
    \$\begingroup\$ Really this question doesn't make sense without a specific case. All games have differing ways of implementing AI, depending on the game mechanics involved, and 'how to improve them' will vary massively. At the very least this should be Community Wiki, as there's no 'right' answer here. \$\endgroup\$
    – MrCranky
    Commented Sep 3, 2010 at 9:55
  • 2
    \$\begingroup\$ Further to the former: Consider that Chess is a strategy game. \$\endgroup\$
    – Rushyo
    Commented Sep 3, 2010 at 13:21
  • 1
    \$\begingroup\$ Why would you want to? Making a perfect AI for the game of Pong is absolutely trivial, and absolutely no fun to play against. The goal of game AI is not to beat the player, since it is the player (not the computer) who is supposed to be having fun. \$\endgroup\$ Commented Sep 3, 2010 at 15:16
  • 1
    \$\begingroup\$ Ian: The OP is talking about something very different from Pong. It's easy to make an unbeatable Pong AI, or a Tic-Tac-Toe AI. Chess can be taken to an AI that only the very, very, very best can defeat. But RTS is a different ballgame. \$\endgroup\$ Commented Sep 3, 2010 at 15:51
  • 2
    \$\begingroup\$ You might be interested in STRIPS algorithm. \$\endgroup\$
    – user712092
    Commented Aug 3, 2011 at 17:28

5 Answers 5

12
\$\begingroup\$

It's kind of a difficulty question to answer. To state what needs improving, you need to have some known AI to work from. However here are some examples of RTS AI from aigamedev.com (registration required):

Unfortunately most of the really good stuff is behind the paywall.

A common AI solution is the Goal-Orientated Action Planner, which uses rules to form plans to satsify goals. It's been around a while now but it's very cool. There's a brief overview (pdf) available on Jeff Orkin's site about how it's applied to an FPS, but exactly the same principle (with different rules and goals) works for RTSs.

Many RTSs will use heirarchies of GOAPs, with different levels recieving goals from the level above, and concerned with different levels of detail of the battlefield. I read a great article on some WWII hex wargame's AI that was structured like this, but for all that is google I can't find the link now. Gold star for anyone who can help me out.

Of course the effectiveness of GOAPs and other planners depend on how well you parse your game world, and how refined your actions and goals are.

Other common tech includes Utility architectures (pdf) for scoring and priorities, and blackboards for parsing the game world.

\$\endgroup\$
0
6
\$\begingroup\$

The point is, if you've got an AI

that could beat any human without resource cheating in a real time strategy game

then you have a game no one will play becuase they couldn't get past the first level.

The hardest part of AI programming is making the AI beatable, but beatable by someone with a bit of skill. Make it too easy to beat and players will be put off by a lack of a challenge, make it too hard and again, people will get fed up with being beaten all the time.

So it's not about creating complex AI (which isn't difficult, after all, the AI can process everthing within its playing area simultaneously whereas a player can only process what's on screen), but more about creating a balanced game.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ To clarify, making an AI that can beat any human is not that hard since the AI can control its units with better granularity than any human could hope for (due to UI constraints). A human takes seconds to react to events, select and command units, whereas the AI can update the orders for every unit individually every 'game turn' in response to any event. But in practice, this isn't done since it would make the game tedious. The really hard part is making the AI dumb enough to beat. \$\endgroup\$
    – Skizz
    Commented Sep 6, 2010 at 14:52
  • 3
    \$\begingroup\$ To clarify the clarification - making unbeatable AI is not that hard; making beatable, challenging and engaging AI is far, far more difficult. \$\endgroup\$
    – Skizz
    Commented Sep 6, 2010 at 14:56
3
\$\begingroup\$

A lot could be done but my immediate reaction to this question was a counter-question: why would anyone want the ultimate RTS AI? And why doesn't this person just play online, against another human opponent?

The crux is: it's not the problem to make the AI unbeatable, it's the problem of making it think fast enough (eg. it has to take shortcuts) to be able to play against 3 or even 7 AI opponents on the same map with a regular computer. Even today, and tomorrow, and I expect it won't have changed even ten years from now.

The next issue is: as long as the AI follows strict rules, it will be exploitable. Even fuzzy rules will make it vulnerable to exploits. The AI would have to learn, and it would have to make mistakes - intentional and unintentional. It would also need to surprise you. And then you're playing against another human being. Since AI doesn't even come close to copying a human's way of thinking both algorithmic and in terms of processing power, you're much better off not wasting your time on a single player AI that's not nearly as much fun to play against as another human being, if only for the social factors involved.

\$\endgroup\$
1
\$\begingroup\$

What you define as 'resource cheating' is like 'boost balancing' in racing games. The 'boost' is used to try and keep the pack in relatively close proximity to each other to create the illusion of a tight race. If the player isn't in the lead it may keep the CPU player in sight, and if the player is in the lead it keeps the pressure on by putting opponents directly on your tail, even if the CPU itself is a mediocre driver.

In an RTS you're looking at a collection of values which can be arranged optimally. You know exactly how long it takes to obtain a resource, how much building items costs, map traversal times, etc.

If you're the one who has created the tables and has the info readily available to you it's just a matter of number crunching the data to find the best ratios for output.

But how much fun is it to play against an enemy who always does exactly the same thing based on the context of the playing field?

So you add chaos. You give the AI an efficiency on a sliding scale. You have it harass the player. If the player appears to be doing too well, you have the AI cheat a bit and give it some extra resources or reinforcements to keep the player on their toes.

You want the player to feel the satisfaction of facing a challenging opponent, rather than spanking a weak AI or being slaughtered by Hal9000. The perfection of a CPU opponent lies in its imperfection. :)

\$\endgroup\$
1
  • 2
    \$\begingroup\$ And different, but related: It's nice if the AI sometimes does things that aren't technically their best option, but add a little fun to the game, such as using unusual units or moves (e.g. airdropping troops in the back of the player's base) \$\endgroup\$ Commented Sep 4, 2010 at 21:44
0
\$\begingroup\$

One big thing is that you have to keep up with the strategic development of the game. No amount of development will let a AI win a Starcraft 1 match (in fair play) if it thinks a core army of marines is the way to play a Terran vs Terran game.

Not only will this keep the AI from getting consistently beaten due to its choice of obsolete strategy, but having a greater repertoire of approaches to the game will make the AI more engaging, if the AI makes viable choices along the way.

A rich strategy tree even allows for a difficulty slider; e.g. the insane Zerg AI will tend to take flexible approaches that can adapt to the enemy and rapidly expand when given the opportunity, but at the normal difficulty level it is likely to pick more rigid builds and be less prone to mass expansions.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .