I've been fooling around with AI war of late and have been reading a lot of the creators ideas.  Here's one which stands out to me, which I think SD botched up badly in GC2, and I fear the same fate for Elemental.

 

Minimizing AI Opportunity Costs Through Game Design: In general, since I'm the designer/programmer of the game as a whole, as well as of the AI, this gave me a lot of flexibility to set myself up for success with the AI. If some aspect of the game design was bad for AI, I would change it. Activities that have a high opportunity cost (such as expensive one-shot attacks, or very expensive ships that gain value over time and should be protected, etc), were generally something that I avoided for combat in the main, as this had a much smaller pool of almost-best choices.
End of quote

 

Now, AI war is a drastically different game from Elemental (and from GC2 for that matter), but the point being that if you want a solid AI you *have* to be sure the design of the game makes it possible for the AI to actually work at a higher level.

 

I get the feeling that Elemental has too much cool stuff for the AI to really ever be particularly effective, especially once it's weaknesses are found, since (and maybe I'm wrong, but I think this is Brads philosophy, or was...) the AI is supposed to play by exactly the same rules as the player (something which isn't the case in AI wars actually, but that's beside the point).

 

Anyway, AI war is available on Impulse, and I suggest that gamers who like a heavy strategy game with a bit of a 'puzzle' feel check it out.  It's not your grandfathers RTS...

 

http://www.arcengames.com/aiwar_features.php

 

[edit]  I'm not the designer, but my quote is from him...

14,005 views 12 replies
Reply #1 Top

I think that having to many features/options isn't a problem for a well written AI. I am writing an AI for a hybrid RTS/TBS right now and my game is fairly complex, its very similar to the layout of Elemental's combat system. The key to writing a good AI for a game where the AI behaves like a player, is to write the AI as if it is a human being, instead of a machine. Personalities, impulses, desires, strategies, all of these should be the core of the AI, and while doing optimizations and calculations is important it shouldn't be relied upon too much to make decisions.

I would love to talk with Frogboy about designing AI but I understand if he is too busy!

Reply #2 Top

Quoting UmbralAngel, reply 1
I think that having to many features/options isn't a problem for a well written AI. I am writing an AI for a hybrid RTS/TBS right now and my game is fairly complex, its very similar to the layout of Elemental's combat system. The key to writing a good AI for a game where the AI behaves like a player, is to write the AI as if it is a human being, instead of a machine. Personalities, impulses, desires, strategies, all of these should be the core of the AI, and while doing optimizations and calculations is important it shouldn't be relied upon too much to make decisions.

I would love to talk with Frogboy about designing AI but I understand if he is too busy!
End of UmbralAngel's quote

that's why AI can only as good as it's creator, as it uses the creator's logic to beat the player. The Dev are supposely good players as they are the one who create the game. But, the hardcore players will eventually better than them in no time. So the good AI is the AI that updated regularly. So I propose the Dev to open the AI source so the community can make a good AI for Elemental.

The example for good AI is the AI for Space Empire V (balance Mod) where the current version of AI is much-much better (and harder) than the vanila version.

Reply #3 Top

Quoting Brainsucker, reply 2


that's why AI can only as good as it's creator, as it uses the creator's logic to beat the player. The Dev are supposely good players as they are the one who create the game.
End of Brainsucker's quote

 

Well... yes and no.

 

To begin with, I've written a large post on AI fundamentals elsewhere in the forums.

 

But, 1) AI can absolutely surpass it's creator.

It's like saying a computer cannot perform computations more complex than it's programmer.  That's hardly true.  It would also imply that the programmers of Deep Blue are far and away the absolute grandmasters of chess.  This is also false.

 

The problem is the underlying statement "uses the creator's logic".  You have to actually understand how decisions are made and WHAT an AI actually is, in order to make sense of that.  And to be completely honest, I'm not entirely sure that you do.

 

It must be understood that mathematics and logic are closely related languages.  If any part of that statement is a concept which strikes you as untrue, there's no need to read any further.

 

Under an absolute system, there are truths and falsehoods.  1 is less than 2.  1 and 1 is not 3.  And so forth.

From this, we can build more complicated statements of truth and falsehood.  1 and 3 make 4.  4 is greater than 1.  4 is greater than 3.  Therefore the sum of two positive integers is greater than either integer alone.

 

From there, we create futher complexities - conditional statements.  If the sum of two values is greater than 6, then it shall be performed.

 

And that, at the fundamental level, is the actual Logic used by an AI.  Logic is the only Logic there is.  Anything else is Illogic.

 

Where the creator's input comes in is two fold: the application of rules and the assignment (and calculation) of values.

 

If at war, then:

If value of current army is equal to or less than X, then increase until value is X+10

To determine value, reference units available to chart 1 (value of units)

If value of current army is greater than X, then:

Compare value of current army to value of neighboring factions

If value of current army, etc....

 

More complicated forms include a consideration of the likelihood of an event to discount the value of an event, and so forth.  To really get a more in depth discussion, search for an AI thread under my name.

 

So actually, the creator's skill is, largely, irrelevant.  They need be able to create the proper conditional rules and such that enable an AI to 1) perform various tasks, and 2) know when to perform various tasks.

 

You could be the best starcraft or TF2 or whatever player around - doesn't mean you can create a really good AI in the same game.  And you can be a really really bad player at a game, and still create a very good AI.  Which happens frequently - because an AI program is just that - a program.  A set of instructions, performed step by step.  It's humans who deviate constantly, who write and rewrite rules as we go, who make irrational decisions and attempt to rationalize them.

 

At worst, the AI is unrefined.  The sets of rules it follows is complete (in that it works at all), but lacks in variety (in that it does not know to do certain things).  The table of values it references for decision making is likewise unbalanced - the AI over values some things, and completely devalues others in a manner that far and away most humans would not agree with under most circumstances.

 

But this also leads me to 2) just because you create something doesn't mean you are good at it.  What does it take to be a programmer? or a game maker?  Well, the ability to code instructions in a machine language.  That's one person.  Then there's art.  That's another.  A writer.  A guy who simply thinks things up.  Another guy who turns imaginary things into discrete things.  A set of guys who run through make sure it all works.  Another set that make sure things aren't unbalanced.  So on and so forth.

 

But just because, for example, you wrote (a portion) of the code that is the game, doesn't mean you are awesome at it.  It doesn't give you any special ability or insight, or any of that.  Chances are, in any online game you've played with strangers, you have, at one point or another, played with someone involved in making games (and possibly even that game).  And called them a noob.

 

The best players at Quake, or WoW, or Starcraft weren't the people who made it.  They generally don't even rank in the top players (probably because they are busy making games and fixing exploits the top players find).

 

So cut a little slack =)  They are only human...

Reply #4 Top

@Jingseng : That it is. What I mean is that the AI can only explore the things that thinkable by it's creator.

Honestly, I'm a gamer, and not a coder. So I don't know about the logic of AI from the point of view of AI Creators. But, I say that from the view of a gamer. My point of view is simple, good players have their own play style. I will use the 4x Game Space Empire V (the Balance Mod). When I play the early version, i can always stick on some weaponary and design. and that style of playing (I use the Star Trek Style of design) will stick as long as it can owned the AI

At that moment, the AI has not the capability to counter my tactic, so I can destroy them whenever I want. But with the recent update, i must always change my designs, strategy, and even my production policy; as the AI will update for several turns to fight against my strategy. This way I will improve my strategy and tactic to stand against the AI. But, this kind of AI will not exist without good players input; as the AI creators won't make a good AI that can counter my previous strategy without knowing about it at the first place.

Soooo...., AI can be only good as it's creator. If the creator doesn't aware of the players playstyle, he won't able to create a good AI that can counter the human's strategy.

Reply #5 Top

Quoting UmbralAngel, reply 1
I think that having to many features/options isn't a problem for a well written AI. I am writing an AI for a hybrid RTS/TBS right now and my game is fairly complex, its very similar to the layout of Elemental's combat system. The key to writing a good AI for a game where the AI behaves like a player, is to write the AI as if it is a human being, instead of a machine. Personalities, impulses, desires, strategies, all of these should be the core of the AI, and while doing optimizations and calculations is important it shouldn't be relied upon too much to make decisions.

I would love to talk with Frogboy about designing AI but I understand if he is too busy!
End of UmbralAngel's quote

 

I agree. A human would not factor into 20 different calculations to see if taking this city is worth it. If your enemy just annihilated your champion and 20 soldiers, you'd want revenge. If you are to write a AI to behave more human, it should make irrational decision sometimes, but not too over-the-top, based on grudge. Sometimes the action need to be unpredictable and a bit of randomness to make the AI fun to play with.

Reply #6 Top

Quoting UmbralAngel, reply 1
I think that having to many features/options isn't a problem for a well written AI. I am writing an AI for a hybrid RTS/TBS right now and my game is fairly complex, its very similar to the layout of Elemental's combat system. The key to writing a good AI for a game where the AI behaves like a player, is to write the AI as if it is a human being, instead of a machine. Personalities, impulses, desires, strategies, all of these should be the core of the AI, and while doing optimizations and calculations is important it shouldn't be relied upon too much to make decisions.

I would love to talk with Frogboy about designing AI but I understand if he is too busy!
End of UmbralAngel's quote

 

It's not a question of features/options, it's a question of how easy it is to make the AI understand them in a rational way.  My big pet peeve from GC2, the open space design.  The AI was absolutely incapable of dealing with it, it fell for the same tricks/tactics time after time, never employed anything remotely smart, and thus, was trivial to defeat almost no matter the advantages it may have had.

 

Tactical combat is another glaring place where AIs can fall prey to this.  For everything people rave about in AoW:SM, the tactical AI was pretty bad (some of this due to poor strategic decisions in army construction).  Actually it was 'good' in that it behaved 'rationally' but once you figured out how it valued everything, it was too easy to exploit.  Why?  Because the system was designed to be played with exploits.  Remove the ability to have those exploits and the AI suddenly becomes much tougher to deal with.  The tactical combat mechanism in Dom3 does this to a degree, because you can only script the first 5 actions for your units, after which combat for both sides is handled exclusively by the AI.  Now most people want hands on in tactical (I do), but if you leave the system too open, then you make it too easy for the player to 'cheese' the AI, and the player won't even be doing it intentionally, he'll be doing it because it's the natural thing to do.  The best system in my opinion is a WEGO system, where each side is given the chance to assign orders to his units, and then the battle progresses in a realtime fashion with occasional stops to readjust orders, but not 'on the fly' because then it's just a straight forward RTS.  You can use different mechanics control how the stops occur, leadership values letting you have adjustments more frequently than your opponent is one I prefer, or just every unit does it's thing for 5 seconds (or whatever) and then everything pauses for you to adjust orders.  This still provides some 'cheese', but much less so than the system Elemental currently has, especially when one shotting units is such a big mechanic.

 

Also, pardon me for saying this, but an AI that plays as a human is a pipe dream (currently, we'll talk again in a few decades).  It's also not really that much 'fun' to play against if you don't care specifically about some kind of RPG interaction.  The calculations are the most important, because that's the one place the AI can have a true advantage over a human (especially in an RTS).  Impulses?  Desires?  I don't know what you mean by that exactly, you set some goals certainly, but you make it sound as though it's more noticeable through diplomacy rather than some inherent aspect of the AI which the player will recognize as something outside of 'this is the 'destructor AI' it will value destroying units/cities/whatever over other goals.

 

So you set a goal (or set of goals) for your AI(s), then they optimize and calculate their way to achieving them.

 

I agree. A human would not factor into 20 different calculations to see if taking this city is worth it. If your enemy just annihilated your champion and 20 soldiers, you'd want revenge.
End of quote

 

Really?  Go play an RPG then, that sounds more the style you are promoting.  In a TBS I don't 'want revenge', I just want to win.  I'm not going to make a stupid decision based off of some arbitrary 'hatred' of the AI.  lol... it's laughable really, and if it's an AI coded response, then it's just another thing to exploit.

 

But, the hardcore players will eventually better than them in no time. So the good AI is the AI that updated regularly. So I propose the Dev to open the AI source so the community can make a good AI for Elemental.
End of quote

 

This.  It is so true, open it up to everyone, and you'll have a superior AI to anything one man can do on his own.

Reply #7 Top

@Jingseng : That it is. What I mean is that the AI can only explore the things that thinkable by it's creator.
End of quote

In many cases, yes.

However, there can be surprises of the AI figuring out some things on it's own.
This here is the closest I ever got to creating an "AI" and it's quite effective at it's job. While usually not referred to as one, that's how it's built on the inside.
Unlike similiar scripts in that game I don't use hardcoded lookup tables anywhere. All they do is create an ungainly and hard to maintain script.
Instead, it assigns values to the available options in it's scope and goes for the combination of options with the highest cumulative value. That allows it to find solutions that combine two (on the surface) inferior options to achieve a superior result because the negatives of the two inferior solutions cancel each other out when used together.
All I do is give it the raw data on the available items and it draws the rest of the information from the game in realtime.
There have been... a number of surprises because it turned out to be a "throw the kitchen sink" AI that would always find some way to hurt the enemy even if it has to choose means that aren't "in the book" or even go against what are technically it's rules...

This is something you cannot realistically do with a set of rule tables where one is used after the other to refine the result until only one "best option" is left. The "bad" option would be ignored and the sub-table, where the complementary bad option resides, would never be checked.

 

One of the hardest things for an AI to understand is position.
The WOM AI doesn't even try. It picks a target and chaaaaaaarges! End of logic.

AFAIK there aren't even tile-specific boni in tactical battles but that doesn't automatically make headlong charges the best option.
The simplest and most obvious exploit is to have your hammer units wait for the enemy to move up exactly 2 squares and end up in front of your unit without being able to attack.
How convenient. Your first attack on the start of the next turn all but annihilates the unit. Next, please.

The AI would need to think ahead into the next turn, avoiding to move into a position that is extremely advantageous to the enemy.
In this example, do not expend all movement points when it means ending up in melee range of a strong unit without being able to attack. Because that would be stupid.
Maybe move only one square so the enemy has to come to us, expending movement points and not being able to attack twice in the same round.

Or if the enemy has no archers, why would we want to expose ourselves to begin with? Backpedal to keep the enemy at a range where he has to expend all his movement points to end up in front of our melee units. That's a cool place for the enemy to be... when our turn starts.

This is a very simple example of how the AI should deal with position vs movement. Usually there are far more factors.

But all we get is the charge of the light brigade...

Reply #8 Top

The problem is that there is no complex actions available to the AI... if the AI has melee units and no archers what should it do except charge? The only thing it could do is wait 2 spaces away from the Player and skip its turn until the player moves into range. Is that fun to play against?

 Obviously the AI needs to avoid battles where it has the wrong unit composition, but that requires more changes. Without those changes you could spend the whole game chasing around AI stacks and never having a battle (if it build a counter your army).

IMO the unit movement speeds and combat abilities have to be rebalanced so that the AI can have some viable options.  There needs to be ways to give units magic resistance, pierce resistance, and faster moves, maybe a first strike ability... all of these will allow the AI to have interesting combat options that still involve charging forward and making the combat move at a brisk pace.

Reply #9 Top

Quoting shadowtongue, reply 6
...


Tactical combat is another glaring place where AIs can fall prey to this.  For everything people rave about in AoW:SM, the tactical AI was pretty bad (some of this due to poor strategic decisions in army construction).  Actually it was 'good' in that it behaved 'rationally' but once you figured out how it valued everything, it was too easy to exploit.  Why?  Because the system was designed to be played with exploits.  Remove the ability to have those exploits and the AI suddenly becomes much tougher to deal with.

End of shadowtongue's quote

As much as I love AoW (and the various mods that have given it such staying power such as Dwiggs and the 1.4 community patch), the TC AI is pretty ridiculously stupid or at least very easy to exploit.

Picture this...  you're in a city with 3 archers and a pioneer against a bunch of something nasty that can't just bypass your walls (no fliers, wall climbers, phasing units, etc).  Take said "useless" pioneer to a far gate and walk one set out.  "Holy crap," sez the AI, "we can stop battering this wall since there's an open piece WAAAAAAAAAAAAY over there!  CHARGE!"  Walk back in once they get close and they'll head right back to whatever piece they were previously wailing upon since it's now weakened (unless you have some form of repair spell going).

Granted it is smart enough to avoid the obvious stupidities like shooting it's own units due to obstructions but will happily do spells that damage all units but the caster...  including their own.

Reply #10 Top

Quoting UmbralAngel, reply 8
The problem is that there is no complex actions available to the AI... if the AI has melee units and no archers what should it do except charge?
End of UmbralAngel's quote

The AI (and the player = ) needs more ways to combine trivial actions like "move into attack range" into more complex ones.

Only then can the AI judge the value of two squares that are both in attack range.

The implementation of... tactics.

If "in attack range or not" is the only condition to matter at all, an AI cannot be anything other than stupid. How can it possibly be smart when there is nothing to think about?
An energizer bunny with swords mounted instead of drumsticks could do that. Just keep moving forward and keep swinging. Eventually it will hit something.
You don't need an AI for that. A wind-up toy will do.

 

Reply #11 Top

What we need is for it to figure out "I have X, they have Y. Using X does P damage. To use X, I can do Z. Doing Z puts me in A amount of danger." and weigh different possible Zs with the intent to minimize A while maximizing A. Among many other things. The more we can let the AI work on general information and not specifics, the more adaptable it can be.

Reply #12 Top

IMO, the biggest problem the EWoM AI has right now is the game itself. Putting the various exploits aside, the game is simply changing too fast. All of what you guys are talking about can be improved upon and done, but if tactical combat is changing in a week, then it's not going to help (see how well the AI is adapting to new maintenance cost or magic revision). The game rules has to be stable before the AI can seriously be worked on. Until then, everything is just hot fixes.