Diplomacy

And How To Make It Better

By on August 7, 2009 8:04:50 PM from Elemental Forums Elemental Forums

ChongLi

Join Date 07/2009
+4

Here's a quote from another thread:

1) Diplomacy: diplomacy, both in Civ or MoM, has never played a mayor role. This thing should change (and it can be made without making changes to the game engine, or graphics). Having lots of options and opportunities for diplomacy, as well as having "metrics" to measure the impact of your actions, etc, would be a great add. Knowing, for example, that my Djinn, stationed nearby an enemy city, is worrying my neighbor, would be useful.

I originally planned to respond to it in that thread, but I soon realized that it is such a huge topic that it warrants its own discussion thread.

Diplomacy is one area that has been severely neglected in all of gaming. The only game I've ever played that had good diplomacy was an MMO called Shadowbane (and the diplomacy occurred between real players and involved the real consequence of losing your city).

Metrics are totally the wrong way of doing diplomacy. You can't quantify a real person's opinions or a culture's customs with some silly numbers. You can't quantify hidden agendas or secret agreements.

A few key rules should be followed when designing the diplomacy system of a game. The AI-controlled players should:

  • Never give away any information unless it suits their agenda to do so
  • Never make their decisions in a random or otherwise non-deterministic way
  • Never treat the human player(s) differently from how they'd treat their AI rivals
  • Always seek to maximize their position in the course of negotiations

All of these rules have been broken by games in the past, to their detriment.

  • The AIs would leak information like crazy, including all of the technologies they possess, their opinions about all of their rivals (including you), their goals and desires and even the fact that they are preparing to attack you.
  • The AIs often behaved in random, non-deterministic ways, accepting/rejecting a trade offer based on a random variable (frustrating and stupid, if you ask me).
  • The AIs ganged up on the human player, having been programmed with an "us-vs-him" mentality.
  • The AIs allowed themselves to be manipulated in trade negotiations, to be bribed and controlled into ruining their own plans and wasting their efforts.

Obviously, the design of a diplomacy system is much more complicated than following a few rules. There must also be a strong strategic foundation for the AI which allows it to formulate realistic goals and take the necessary steps to achieve them. AIs should be able to "see through" a player's gestures towards them and find weaknesses to exploit.

If a player is weaker militarily than the AI but stronger economically, it should not allow the player to bribe it into abandoning its plans for invasion. Rather, it should attempt to suck as much gold, mana, spells and other bribes out of the player that it can to further bolster its position.

This type of system is very hard to design, I admit, but I believe it is worth trying. I hope that the scripts and routines used for the AI are open to the modding community so that modders can fix any glaring mistakes or loopholes in the diplomatic AI.

What are your suggestions to improve the diplomacy of this game and elevate it over the mistakes of the past?

Locked Post 76 Replies +1
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 8:22:25 PM from Elemental Forums Elemental Forums

Veeeeery Eeeenteeresteeng....... How should the AI balance short-term gains versus long-term gains? I would very much like to see different AI levels follow these rules to different degrees.....

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 8:39:31 PM from Elemental Forums Elemental Forums

Obfuscating typical 'game' elements that are really very complex or unknown (like how someone REALLY feels about you) is good.  The GalCiv2 system is good for feedback, but that should be the public face of diplomacy (ie we condemn your military buildup etc) and behind closed doors your enemies should have actual agendas beyond 'we don't like his military score'.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 8:50:36 PM from Elemental Forums Elemental Forums

Warning - this is going to be a long post.

You bring up tech trading as poart of diplomacy and there is one tactic that I use all the time that I think the AI could easily emulate and it would definitely add a depth to that element that is lacking (although it will make it hard to take advantage, but it would be worth the trade off.

The tactic I use is to really push down a certain branch of the tree. I also tend to play tech-centric races with research bonuses etc. As soon as I get a tech that no one else has, in the same turn I talk to all factions and trade whatever I can get from them even if it is a bad trade. I usually start with the opponent I am on the worst terms with and end with my best friend. By trading with them all on the same turn it keeps any of them from trading MY tech to another civ to their benefit. this gives me the benefit of getting maximum returns from my tech. It is even better if I can get two or three advances down the tech tree ahead of everyone and then trade my obsolete designs fo techs that I need. It also gives me the benefit of improving relations with almost everyone. Of course, those that make unfair trades with me, I still make the trade to get what benefit I can, because otherwise some other race will just trade the tech to them. I just mark them down as turds who are high on my list of races that the world (or galaxy) would be better off without.

I think having the AI do this same type of tactic would add some depth. Instead of them proposing what they offer and what of mine they want in return, I think it would be better if they just said "We offer plasma cannon, what do you offer in return?" The shadings of the trade text (ala GalCiv2) Red could indicate they will reject it, Orange could indicate they will take it but will view you negatively for it and will "return the favor" when you want to trade with them next. Yellow, also negative view but less so, Green, they view as a fair trade, and blue could be they feel that you are being generous and will give you a significant friendship boost (or depending on the AI personality, that you are a buffoon that is easily taken advantage of). Also, when the AI initiate and offer, it should not allow the human player to alter the AI's side of the bargain - the human player should only be able to put what he is willing to trade for what the AI is offering. (Giving the human player the opportunity to alter both sides of the deal until the text greens gives the human player too much advantage in determining what techs he gets thru trades - even though the AI evaluates the trade and determines that it is "fair".

Heh, not as long as I expected it to be.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 8:56:49 PM from Elemental Forums Elemental Forums

Actually, as long as the AI has the power to do it to you, altering the other guy's offer might open up some good haggling options....

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 9:10:22 PM from Elemental Forums Elemental Forums

Warning - this is going to be a long post.

You bring up tech trading as poart of diplomacy and there is one tactic that I use all the time that I think the AI could easily emulate and it would definitely add a depth to that element that is lacking (although it will make it hard to take advantage, but it would be worth the trade off.

The tactic I use is to really push down a certain branch of the tree. I also tend to play tech-centric races with research bonuses etc. As soon as I get a tech that no one else has, in the same turn I talk to all factions and trade whatever I can get from them even if it is a bad trade. I usually start with the opponent I am on the worst terms with and end with my best friend. By trading with them all on the same turn it keeps any of them from trading MY tech to another civ to their benefit. this gives me the benefit of getting maximum returns from my tech. It is even better if I can get two or three advances down the tech tree ahead of everyone and then trade my obsolete designs fo techs that I need. It also gives me the benefit of improving relations with almost everyone. Of course, those that make unfair trades with me, I still make the trade to get what benefit I can, because otherwise some other race will just trade the tech to them. I just mark them down as turds who are high on my list of races that the world (or galaxy) would be better off without.

I think having the AI do this same type of tactic would add some depth. Instead of them proposing what they offer and what of mine they want in return, I think it would be better if they just said "We offer plasma cannon, what do you offer in return?" The shadings of the trade text (ala GalCiv2) Red could indicate they will reject it, Orange could indicate they will take it but will view you negatively for it and will "return the favor" when you want to trade with them next. Yellow, also negative view but less so, Green, they view as a fair trade, and blue could be they feel that you are being generous and will give you a significant friendship boost (or depending on the AI personality, that you are a buffoon that is easily taken advantage of). Also, when the AI initiate and offer, it should not allow the human player to alter the AI's side of the bargain - the human player should only be able to put what he is willing to trade for what the AI is offering. (Giving the human player the opportunity to alter both sides of the deal until the text greens gives the human player too much advantage in determining what techs he gets thru trades - even though the AI evaluates the trade and determines that it is "fair".

Heh, not as long as I expected it to be.

From what I know of this game (and what was the fact in MoM) is that the research "tree" (if it could be called that) is different for every player. This makes such a strategy more difficult.

Revisiting one of the rules I mentioned above, the information rule, we can see a problem here. The AI should never share the list of spells/technologies that it possesses unless doing so would further its agenda. This means you would have no idea which spells you have a "monopoly" on and which spells everyone has. If you make an offer of a spell to an AI player, it should take advantage of this knowledge and if the AI already knows such a spell, it should quickly turn around and trade it with the other AI players to screw you over.

The other weird thing about the strategy you describe is that it takes advantage of the turn-based nature of the game and that each player has the exclusive right to all diplomacy during his turn. This might be something that could be changed so that any party may conduct diplomacy with any other party during anybody's turn.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 9:14:33 PM from Elemental Forums Elemental Forums

Quoting Scoutdog,
Actually, as long as the AI has the power to do it to you, altering the other guy's offer might open up some good haggling options....

GalCiv2 does allow it, and it is too easy for a human player to punk the AI. Allowing the AI to do the same thing doesn;t work because you still have to agree to the deal - the AI does not have the option to keep tweaking the trade until the text turns green, it has to make a trade that you will go for and the human has too big of an advantage.

Making the AI comples enough to do in depth evaluations of trades and denying certain techs to you - well it is done, for instance an AI that is not already on good terms with you will rarely trade military tech - but no AI is going to be able to really strategically do tech trades like a human can.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 9:25:05 PM from Elemental Forums Elemental Forums

GalCiv2 does allow it, and it is too easy for a human player to punk the AI. Allowing the AI to do the same thing doesn;t work because you still have to agree to the deal - the AI does not have the option to keep tweaking the trade until the text turns green, it has to make a trade that you will go for and the human has too big of an advantage.

Yes, the concept of "fiddling the knobs until the light turns green" is not a good one and leaks far too much information to the player. A proper system of negotiation should involve a cycle of offers and counter-offers, perhaps even allowing multiple sets of negotiations going on simultaneously, allowing the AI to "go behind your back" and get a better deal.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 9:30:25 PM from Elemental Forums Elemental Forums

@ Chong Li,

Yes exactly the AI should never let you know what it knows. Having a list of techs to trade for gives you WAY too much information into their capabilities.

I also like your idea of being able to do diplomacy with anyone during the movement phase. This would kind of favor the AI players as once they got a tech they could quickly perform millisecond trades among themselves and the poor meat player is going to be able to trade his tech with only one AI and effectively all the AI will get it. It does shut down my unfair advantage, but it almoist goes to far in giving the AI too much of an edge. Maybe it will be concurrent turns and the AI(s) could make all the trades with themselves or humans that they wish, and then the AIs are locked out of iniating trades...but that ends us back at square one.

Having different research trees definitely helps alleviate the - I wonder if you will be able to trade for a tech (or a spell) that is not in your tree at all....hmmm.

Idea! You can only trade a given tech with one other player (AI or otherwise) per turn. That way the AI cannot use its speed advantage, but it also blocks my strategy - it also means that the person who discovered it will get the MOST benefit, as he will by default get one more trade than anyone else - and he also controls WHO gets it first. So unlike my strategy of trading it with my enemies first in order to milk it, it would be smarter to trade it with your friends first and also with weaker players first (i.e you would want to give the benefit to someone who is no threat as opposed to someone as powerful or more powerful than you. That also balances out nicely as it actually gives some benefit to the weaker player and helps bring them more into parity... nice side benefit.

It also means that you are going to do more like in the real world - you are going to trade it first to the highest bidder (becuase you wouldn't want to lose that trade to someone else.....I like it a lot. Your thoughts?

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 9:39:23 PM from Elemental Forums Elemental Forums

I also like your idea of being able to do diplomacy with anyone during the movement phase. This would kind of favor the AI players as once they got a tech they could quickly perform millisecond trades among themselves and the poor meat player is going to be able to trade his tech with only one AI and effectively all the AI will get it. It does shut down my unfair advantage, but it almoist goes to far in giving the AI too much of an edge. Maybe it will be concurrent turns and the AI(s) could make all the trades with themselves or humans that they wish, and then the AIs are locked out of iniating trades...but that ends us back at square one.

I think this is where simultaneous negotiations come in, allowing you to instantaneously make a deal with multiple different parties. Will this bring back your old loophole? No, because the AIs are free to talk to each other during the process and pull out of the deal if you are taking advantage of all of them.

Idea! You can only trade a given tech with one other player (AI or otherwise) per turn. That way the AI cannot use its speed advantage, but it also blocks my strategy - it also means that the person who discovered it will get the MOST benefit, as he will by default get one more trade than anyone else - and he also controls WHO gets it first. So unlike my strategy of trading it with my enemies first in order to milk it, it would be smarter to trade it with your friends first and also with weaker players first (i.e you would want to give the benefit to someone who is no threat as opposed to someone as powerful or more powerful than you. That also balances out nicely as it actually gives some benefit to the weaker player and helps bring them more into parity... nice side benefit.

This workaround may not be necessary if simultaneous negotiations are possible.

It also means that you are going to do more like in the real world - you are going to trade it first to the highest bidder (becuase you wouldn't want to lose that trade to someone else.....I like it a lot. Your thoughts?

I like the idea of trading to the highest bidder. Perhaps they could incorporate an auction-type system into the simultaneous negotiations.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 9:51:04 PM from Elemental Forums Elemental Forums

I could see an auction type system being loads of fun, only down side is it could be time consuming. It also implies that the highest bidder will win, which, even under my "one trade for a given tech per turn" rule, even your biggest rival will have the tech or spell in a matter of a few turns, by not selecting him to trade with you at least deny him the ability (for a couple of turns) from turning around and trading it...personally I would tend toward the highest bidder, but if that also turns out to be my biggest rival I would almost certainly trade it to a weaker civ first, or better yet an enemy of my rival!

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 10:06:51 PM from Elemental Forums Elemental Forums

But what do you think of the simultaneous negotiations idea?

For example, you could have 3 separate windows open on the screen (none of which should block your ability to move units or otherwise tend to your empire) and have various deals going on in each of them, each with a different AI leader. If you manage to reach a deal with all of them, you can simply close all 3 deals simultaneously.

Reason for Karma (Optional)
Successfully updated karma reason!
August 7, 2009 10:09:32 PM from Elemental Forums Elemental Forums

Ok, you clearly gave your ideas quite a bit of thought, so I feel it fair to address them individually.



Diplomacy is one area that has been severely neglected in all of gaming. The only game I've ever played that had good diplomacy was an MMO called Shadowbane (and the diplomacy occurred between real players and involved the real consequence of losing your city).

The reason you only see this with real players is the same reason that you are going to see me using alot to explain some of the shortcomings of diplomacy AI in the past: it is simply impossible to create an AI that thinks like you and I do. The very concept is something that devoted theoretical researchers quest unsuccessfully for. AI will not think like a human, not even close, for a few decades (at least). Its not generally "neglected" so much as it gets to a point where the investment of time into AI behavior becomes astronomical, and the returns diminish drastically.


Metrics are totally the wrong way of doing diplomacy. You can't quantify a real person's opinions or a culture's customs with some silly numbers. You can't quantify hidden agendas or secret agreements.

The AI simply can't have "oppinions" or "hidden agendas". Perhaps the AI could be coded to look for a valuable artifact, and may even be capable of tricking the player into thinking that the AI isn't looking for it, but as for true subterfuge... we wont see that for a long time. Metrics could be hidden, and thier could be some random variables at work, along with a script written to give the AI some initiative, but metrics are the only way to reliably represent a changing oppinion in computer language.



A few key rules should be followed when designing the diplomacy system of a game. The AI-controlled players should:
1 Never give away any information unless it suits their agenda to do so
2 Never make their decisions in a random or otherwise non-deterministic way
3 Never treat the human player(s) differently from how they'd treat their AI rivals
4 Always seek to maximize their position in the course of negotiations

All of these rules have been broken by games in the past, to their detriment.

I numbered your suggestions so I could counter them one at a time.

1- As I said above, its "agenda" will likely be to survive, and little more. Players may also get mightily annoyed if the AI is unwilling to even hint at force makeup and strength - why be diplomatic with an empire you have no understanding of? The "mystery" quickly wanes and the lack of info will make players feel disconected.

2- Random may be the ONLY way to create an AI that acts with initiative. The sheer volume of variables that come into play in a TBS usually means that to take them all into account would cause paralysis amongst the AI. The AI shouldn't be stupid, but it will be pretty boring if its always doing the same thing with little variation

3- Agreed. Although the AI's are generally weaker than the human a short way into the game, so the human HAS to be treated like the big bad steamroller he is. But all things equal, so should diplomacy be.

4- Another good point, but the AI will rarely know whats "best" for it. 35,000 gold might seem like a great deal for a city, but what if its thier only Iron source? Or if it will cut the empire in two? Many games go with the strategy of undervaluing everything the human offers, and drastically over-valueing thier own position. This leads to stale diplomacy, but the alternative is generally human abuse. Hmm..

Those ideas are great, and game developers didn't just ignore the concepts in favor of something else, the concepts were simply unnatainable in a realistic manner. AI often still has to cheat just to face the human on the regular map, do you really think the subtleties of diplomacy are an easy (or even possible) thing to code?



Obviously, the design of a diplomacy system is much more complicated than following a few rules. There must also be a strong strategic foundation for the AI which allows it to formulate realistic goals and take the necessary steps to achieve them. AIs should be able to "see through" a player's gestures towards them and find weaknesses to exploit.

Ok, here is where you begin to lose me. If you want that kind of play, go online. The AI is there to provide a reasonable barrier for the human to beat up on, and not much else. The harder modes generally don't give better AI in most games, they give the AI bonus's. That is because the AI on normal (sometimes on easy!) is the best "thinking" AI you will get.

Tell me how you expect the AI to see through a human plan? Ill use a good example that has hounded some of my favorite games in the past...

A player masses troops on the AI border. What should the AI do? Now, your first (reasonable) reaction is "build a huge army! Prepare to defend!" and thats what many of us would do, but its going to break the AI quickly. Why? The AI suddenly shifts focus from growing to massing an army. If the human is about to invade, great! What if the border just happens to be where the human likes gathering his forces? Even if it is for an innevitable invasion, that invasion could be many, many turns away.

Should the AI crap its pants and abandon the expansion of its nation for an attack that may never materialize? Should the AI strike pre-emptively, thus throwing diplomacy out the door (and becoming the aggressor in what could be a nuetral situation)? Should it ignore the human, and risk being over-run? Should it even bother noticing the build up, perhaps the human moves forces through there all the time? Should it try to be peaceful with a human, who we all know will just abuse its hospitality and stab it in the back? Should it try forming an alliance, giveing gold and resources to other nations and weakening itself for what could be no real issue?

This is the example of a minor issue in a game with thousands of variables. Seeing through the human vale is impossible, even for us humans most of the time, why should the AI be any different?


If a player is weaker militarily than the AI but stronger economically, it should not allow the player to bribe it into abandoning its plans for invasion. Rather, it should attempt to suck as much gold, mana, spells and other bribes out of the player that it can to further bolster its position.

Good point actually, but the human will quickly wise up to the AI if it always acts this way. Why give away gold if the AI will just stab you in the back all the time? You already said you don't like random variables, so how will this work? Did you ever play civ4? after playing a game with monty or ghengis would you ever even talk to them again lol? I would hope we could avoid that predictability...


This type of system is very hard to design, I admit, but I believe it is worth trying. I hope that the scripts and routines used for the AI are open to the modding community so that modders can fix any glaring mistakes or loopholes in the diplomatic AI.

What are your suggestions to improve the diplomacy of this game and elevate it over the mistakes of the past?

It is infact so hard to design that it borders on being impossible. The whole thing could be done through scripting, but your looking at adding another year to productiong and having a massive product with AI's that take half hour turns on a good processor. Your ideas are impressive, but for the most part too pie-in-the-sky. The reason you have never seen it done is because it really cant be... and I have more faith in stardock than anyone when it comes to AI.

So, what do I think they should do? Leave it open and moddable, like you said. Throw some reasonable routines in so that the AI can be proactive. Make the AI realise glaring advantages, evaluate its situation, and act if possible. Powerful mana crystal right across the border? How powerful is the empire guarding it, if the AI is notably more powerful, go for it.

Also, have many AI personalities. One could be more aggressive, one more economic, etc. Make it possible to switch from economic to militaristic when needs arise, and back when the emergency ends. Have the AI also have a very long ranged "focus" ie magic, tech, numbers, money, etc, that it focus's on. Make it unpredictable and dynamic. The only time an AI ever beat me in a game was when it took me by surprise, while I was in my confort zone. Thats the way it needs to act, otherwise the game is a forgone conclusion 1/8th the way into it.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 1:02:35 AM from Elemental Forums Elemental Forums

Have you ever played against the AI in a game like Warcraft 3? One thing that made me recognize the power of an AI in a computer game is the fact that it is capable of multitasking to an extreme degree.

If the hypothetical AI is just peacefully building away, then it is clearly designed improperly. The AI should be building, growing, amassing an army, exploring the world, levelling up its heroes, conquering nodes and amassing items all at the same time.

If you are amassing an army on its borders, it should already be aware of it before you do so. It should also know of weak points and attacking them to divert your buildup.

The key thing about designing an AI is giving it a huge library of strategies that it can draw upon. This is how computers are able to dominate the game of chess. The AI being designed by scientists is a general-purpose AI, something far more difficult and complicated than a specialist video game AI.

1- As I said above, its "agenda" will likely be to survive, and little more. Players may also get mightily annoyed if the AI is unwilling to even hint at force makeup and strength - why be diplomatic with an empire you have no understanding of? The "mystery" quickly wanes and the lack of info will make players feel disconected.

The AI should have more than that for an agenda. It should be amassing huge amounts of data about its situation and drawing on its strategy library to determine what course of action to take. Perhaps it sees you as it its most immediate threat, perhaps not. It should have an overall agenda with respect to how it deals with all of its rivals, whether it attempts to form an alliance with them or betray them.

Perhaps the AI near you is planning to attack you, but for now it is friendly with you? Perhaps the strategy it has chosen from its library requires a certain spell combo and you have one of the spells it needs? It might attempt to acquire the spell from you and then turn around and use it against you.

Good point actually, but the human will quickly wise up to the AI if it always acts this way. Why give away gold if the AI will just stab you in the back all the time? You already said you don't like random variables, so how will this work? Did you ever play civ4? after playing a game with monty or ghengis would you ever even talk to them again lol? I would hope we could avoid that predictability...

What I meant by random variables is more akin to the AI in MoO2 randomly deciding to declare war on you or give you the tech you asked for. If the AI has a personality that is randomly generated at the beginning of the game, I am totally cool with that.

Look, I don't expect them to make a perfect AI. I just want to see one that doesn't fall into the same old mistakes.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 1:48:37 AM from Elemental Forums Elemental Forums

People tend to forget that they have far more processing capacity between their ears than any computer running the game will ever have - and the 'software' running it is highly optimized to make stategic decisions.

The key thing about designing an AI is giving it a huge library of strategies that it can draw upon. This is how computers are able to dominate the game of chess. The AI being designed by scientists is a general-purpose AI, something far more difficult and complicated than a specialist video game AI.

Chess is a comparatively simple game, with relatively few moves possible each turn and clearly defined rules of movement and power. And it still took a supercomputer to beat Kasparov - that wasn't a standard desktop he was playing against.

 

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 3:07:18 AM from Elemental Forums Elemental Forums

Chess is a comparatively simple game, with relatively few moves possible each turn and clearly defined rules of movement and power. And it still took a supercomputer to beat Kasparov - that wasn't a standard desktop he was playing against.

A supercomputer from a decade ago is slower than today's laptop.

Chess may be simpler than a game like MoM or Elemental, but the total number of different strategies is far greater (in the millions). Most of the strategies boil down to a few combos here and there.

I'm not asking for an impossible genius of an AI here, I just want to see it execute some strategies. In MoM, the AI was so bad it'd repeatedly try to dispel buffs that were granted by an item (which was impossible). It'd send its road-building engineers right into your city, attacking it because it was stuck on an obsolete build road order. Aside from the few situations where it was pre-programmed to cast a certain spell, it'd otherwise cast all spells at random.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 10:36:15 AM from Elemental Forums Elemental Forums

A supercomputer from a decade ago is slower than today's laptop.

True, I hadn't looked up the specs on deep blue. 30 cores sounds big, until you realize each one was only 120 MHz.

Chess may be simpler than a game like MoM or Elemental, but the total number of different strategies is far greater (in the millions). Most of the strategies boil down to a few combos here and there.

At most 32 units moving inside a 64 tile gameboard. The number of permutations is indeed huge, but nothing compared to a game that might have 100 units occupying a single tile (of which there will be thousands) and constant new unit generation.

The problem with a set of possible options that huge is that AIs can easily be programmed to do the best option NOW, but can't easily look three turns ahead to see the trap the "best option" is leading them into. It is absurdly difficult to program a computer that isn't predictable without being random. AI doesn't think "outside the box" very well.

I want a good AI as much as anyone, I just don't want anyone to get their expectations too high. Better to expect a GalCiv level AI and maybe be pleasantly surprised than expect a human-level AI and certainly be disappointed. There is a reason multiplayer is being built in from the ground up.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 11:04:55 AM from Elemental Forums Elemental Forums

Quoting WIllythemailboy,

A supercomputer from a decade ago is slower than today's laptop.


True, I hadn't looked up the specs on deep blue. 30 cores sounds big, until you realize each one was only 120 MHz.


Chess may be simpler than a game like MoM or Elemental, but the total number of different strategies is far greater (in the millions). Most of the strategies boil down to a few combos here and there.


At most 32 units moving inside a 64 tile gameboard. The number of permutations is indeed huge, but nothing compared to a game that might have 100 units occupying a single tile (of which there will be thousands) and constant new unit generation.

The problem with a set of possible options that huge is that AIs can easily be programmed to do the best option NOW, but can't easily look three turns ahead to see the trap the "best option" is leading them into. It is absurdly difficult to program a computer that isn't predictable without being random. AI doesn't think "outside the box" very well.

I want a good AI as much as anyone, I just don't want anyone to get their expectations too high. Better to expect a GalCiv level AI and maybe be pleasantly surprised than expect a human-level AI and certainly be disappointed. There is a reason multiplayer is being built in from the ground up.

To be fair though, humans don't play TBS games that way either. In chess yes you have your 32 units and 64 tile game but the restrictiveness of the rules allows you to look a few turns ahead. People do not do well at TBS games because they can calculate all the possible or even likely moves that hundreds of units could make 5 turns in the future. They do well by looking at the big picture and broad stroke (while looking for IMPORTANT details but certainly not focusing on every detail) and by doing a good job of determining threats and weaknesses and weighing risk vs reward.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 1:19:14 PM from Elemental Forums Elemental Forums

To be fair though, humans don't play TBS games that way either. In chess yes you have your 32 units and 64 tile game but the restrictiveness of the rules allows you to look a few turns ahead. People do not do well at TBS games because they can calculate all the possible or even likely moves that hundreds of units could make 5 turns in the future. They do well by looking at the big picture and broad stroke (while looking for IMPORTANT details but certainly not focusing on every detail) and by doing a good job of determining threats and weaknesses and weighing risk vs reward.

Yeah, now try to program a computer to do that. That's how a human plays chess, or any other TBS. Deep Blue won because it brute forced every possible outcome for 5 or 6 turns ahead, then picked the path that gave the best outcome. That option simply isn't available for a game of this scale.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 1:50:48 PM from Stardock Forums Stardock Forums

Good discussion.

I'd point out that another very important difference between chess and most modern video games is that in chess, there is no hidden information a.k.a. "fog of war".  Each player knows everything about the other player's moves.  This makes it far simpler to develop an algorithm for a computer to play well.

The thing I've never really gotten around in terms of designing how an AI should behave is this:  What's it's objective?  Is it trying to win?  If yes, then if the human player gets close to winning, competent AI players would unite to try to stop the human (assuming only one player can win).  That could make for a frustrating experience for the gamer.  But if the AI isn't trying to win, what is it trying to do?

I agree with ChongLi's suggestions, which lay out things AI's shouldn't do, but often will.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 2:55:45 PM from Elemental Forums Elemental Forums

At most 32 units moving inside a 64 tile gameboard. The number of permutations is indeed huge, but nothing compared to a game that might have 100 units occupying a single tile (of which there will be thousands) and constant new unit generation.

The problem with a set of possible options that huge is that AIs can easily be programmed to do the best option NOW, but can't easily look three turns ahead to see the trap the "best option" is leading them into. It is absurdly difficult to program a computer that isn't predictable without being random. AI doesn't think "outside the box" very well.

I want a good AI as much as anyone, I just don't want anyone to get their expectations too high. Better to expect a GalCiv level AI and maybe be pleasantly surprised than expect a human-level AI and certainly be disappointed. There is a reason multiplayer is being built in from the ground up.

You're over-complicating things. In chess, the relative positioning of every single piece on the game board is extremely critical. One piece can mean the difference between victory and defeat.

Computer TBS games are nowhere near as complicated as that - positioning is far less important. Far more important, in a game like MoM, is to level up your hero, expand and make sure you have adequate defenses. Proper use of combinations of spells and counters to those spell combos is also important, all of which can be stored in libraries for the AI to draw upon. It's really as simple as "if enemy has this unit, cast this spell, then this spell, else cast these spells".

Yeah, now try to program a computer to do that. That's how a human plays chess, or any other TBS. Deep Blue won because it brute forced every possible outcome for 5 or 6 turns ahead, then picked the path that gave the best outcome. That option simply isn't available for a game of this scale.

I don't think it's nearly as hard as making a better Go-playing AI. Especially if the AI is open to modding. When people discover new strategies or combos, they can add them to the AI so that they AI knows how to utilize and counter them.

Other things, like examining all of your units statistically and comparing them with its own algorithmically is very simple for a computer to do. They could easily simulate a combat 1000 times over, applying different strategies to both sides all in a fraction of a second before attacking. By doing this, the AI should know its probability of winning the battle well in advance and attempt to avoid the battle if its odds are too low.

The thing I've never really gotten around in terms of designing how an AI should behave is this:  What's it's objective?  Is it trying to win?  If yes, then if the human player gets close to winning, competent AI players would unite to try to stop the human (assuming only one player can win).  That could make for a frustrating experience for the gamer.  But if the AI isn't trying to win, what is it trying to do?

In MoM, whenever someone began casting the Spell of Mastery, all other AI players would declare war on him. It did not matter if it was the player or otherwise, the AI would not tolerate such powerful spells (they don't tolerate some of the other evil global enchantments as well like armageddon, meteor storms and death wish).

This is acceptable to me because it does not discriminate against a human player.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 4:07:03 PM from Elemental Forums Elemental Forums

Quoting ChongLi,
Have you ever played against the AI in a game like Warcraft 3? One thing that made me recognize the power of an AI in a computer game is the fact that it is capable of multitasking to an extreme degree.

If the hypothetical AI is just peacefully building away, then it is clearly designed improperly. The AI should be building, growing, amassing an army, exploring the world, levelling up its heroes, conquering nodes and amassing items all at the same time.

If you are amassing an army on its borders, it should already be aware of it before you do so. It should also know of weak points and attacking them to divert your buildup.

Multitasking is fantastic in an rts because there are time constraints. A human can't sit and plan nearly as thouroughly in an RTS as a TBS, so ofcource youll see the AI in Warcraft 3 be impressive. The issue is, in a game where time isn't an issue (a tbs) the human player is soo much better off. The human brain is a processor on a level no MODERN supercomputer can reach.

I ofcourse never intended my example to be taken litteraly. Obviusly you expect the AI to be doing all those things, I was just saying its hard to program it so that it can both defend itself in what appears to be a pre-invasion scenario AND continue the expansion of its empire reliably.

What is "amassing an army", by the way? Like I said in my first post, there is no way to tell whether the human is preparing an invasion or just gathering the troops. There is no "amass army" button to press that the AI can sense - its guessing, and guessing is hard for what is little more than some lines of code.

Quoting ChongLi,

The key thing about designing an AI is giving it a huge library of strategies that it can draw upon. This is how computers are able to dominate the game of chess. The AI being designed by scientists is a general-purpose AI, something far more difficult and complicated than a specialist video game AI.

chess AI? thats not anywhere near what this is about. The amount of variables that not only need to be considered but also need to be valued and arranged is soo much different. The AI can't just be told to "play well". It has to be explained to it in detail what "play well" means.

But, in the interest of not coming off as a total ***, I agree with you that it needs a massive number of strategies to succeed. However strategies for every situation can't be written, so don't think a human AI can exist just because it has options...

Quoting ChongLi,

The AI should have more than that for an agenda. It should be amassing huge amounts of data about its situation and drawing on its strategy library to determine what course of action to take. Perhaps it sees you as it its most immediate threat, perhaps not. It should have an overall agenda with respect to how it deals with all of its rivals, whether it attempts to form an alliance with them or betray them.

No, seriusly, the AI's agenda should be "survive". Isn't that our agenda? Then the AI should build off of that, much like we would. The agenda that you speak of smacks of foreward thinking, a concept that an AI really can't grasp. Perhaps to a limited extent... but don't get your hopes up.


Quoting ChongLi,
Perhaps the AI near you is planning to attack you, but for now it is friendly with you? Perhaps the strategy it has chosen from its library requires a certain spell combo and you have one of the spells it needs? It might attempt to acquire the spell from you and then turn around and use it against you.

Ok, thats still complex but its within reason. The funny thing is, when AI do that in most games your average player whines about the AI being "irrational" and "random". Why? Cause from our perspective its friendly then BAM! war... Part of what keeps AI's stupid is actually the fact that humans are pretty stupid, lol.



Quoting ChongLi,

What I meant by random variables is more akin to the AI in MoO2 randomly deciding to declare war on you or give you the tech you asked for. If the AI has a personality that is randomly generated at the beginning of the game, I am totally cool with that.

Look, I don't expect them to make a perfect AI. I just want to see one that doesn't fall into the same old mistakes.

But that MoO2 AI concept isn't bad! The AI at times needs to take you off guard, needs to refuse illogically, needs to break alliances and keep you on your toes. For now its the closest we really have to simulating our own irrationality.

You don't appear to realise that many of the old mistakes were there because the game had to have SOME AI. I actually expect SD to make a good AI for elemental, and while I agree what your saying is awesome, it would be more awesome if it was possible.

Like walking into a discussion on global warming and just announcing that the way to solve it is to have cars that run on dreams, the idea is awesome... but how?

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 5:20:48 PM from Elemental Forums Elemental Forums

You're over-complicating things. In chess, the relative positioning of every single piece on the game board is extremely critical. One piece can mean the difference between victory and defeat.

You are overcomplicating chess. The binary there/not there positions of pieces are far easier to program for compared to swarms of units that are diffuse in defense, but can concentrate for an attack in one turn.

Other things, like examining all of your units statistically and comparing them with its own algorithmically is very simple for a computer to do. They could easily simulate a combat 1000 times over, applying different strategies to both sides all in a fraction of a second before attacking. By doing this, the AI should know its probability of winning the battle well in advance and attempt to avoid the battle if its odds are too low.

Another thing an AI doesn't need to deal with in chess: unpredictable outcomes. Attacking a pawn with a knight will never result in the pawn defending itself.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 6:26:13 PM from Elemental Forums Elemental Forums

But, in the interest of not coming off as a total ***, I agree with you that it needs a massive number of strategies to succeed. However strategies for every situation can't be written, so don't think a human AI can exist just because it has options...

Most situations are similar. The AI needs a formula to allow it to compare the current situation and find the strategy that most closely approximates the current situation.

No, seriusly, the AI's agenda should be "survive". Isn't that our agenda? Then the AI should build off of that, much like we would. The agenda that you speak of smacks of foreward thinking, a concept that an AI really can't grasp. Perhaps to a limited extent... but don't get your hopes up.

You're thinking about the overall agenda. I'm talking about the many different steps and strategies you use to complete that agenda. An AI that is just sitting around waiting to react to the player is a bad one. It should be proactive, with a specific strategy that it works toward. If each AI is working toward a different strategy, it'll become very hard to counter them all.

You are overcomplicating chess. The binary there/not there positions of pieces are far easier to program for compared to swarms of units that are diffuse in defense, but can concentrate for an attack in one turn.

No, because the vast majority of positions/states in a computer TBS are roughly equivalent. You will never be able to establish a library of every possible game state, so the AI must be made to find the closest approximate to the current state and act appropriately.

Another thing an AI doesn't need to deal with in chess: unpredictable outcomes. Attacking a pawn with a knight will never result in the pawn defending itself.

This is an area where the AI has the advantage. It can simulate a battle between 2 stacks of units 1000 times over and determine a pretty good probability of success.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 10:02:59 PM from Elemental Forums Elemental Forums

Quoting ChongLi,

Most situations are similar. The AI needs a formula to allow it to compare the current situation and find the strategy that most closely approximates the current situation.

Ok, agreed. I think we disagree on the AI's ability to access the situation, not whether it should or not. You expect deep blue, im thinking more like Civ4 after some major modding.

Quoting ChongLi,
You're thinking about the overall agenda. I'm talking about the many different steps and strategies you use to complete that agenda. An AI that is just sitting around waiting to react to the player is a bad one. It should be proactive, with a specific strategy that it works toward. If each AI is working toward a different strategy, it'll become very hard to counter them all.

Again, I said it should be proactive too, my example is clearly throwing you off so forget it, ill try to simplify it. If the AI is threatened, but not yet under attack, how would you have it react? Should it go into police state mode for the rest of the game or blow it off (relatively, its still doing whatever it was doing before) and go on living under the assumption everythings dandy.

Quoting ChongLi,
No, because the vast majority of positions/states in a computer TBS are roughly equivalent. You will never be able to establish a library of every possible game state, so the AI must be made to find the closest approximate to the current state and act appropriately.

Yep. True dat. Now do you know how many different positions the AI can be in? An enemy with just one city and one basic army could still take 1000 courses of action. Immagine a multi-tiered empire, with magic in the mix, multiple armies, multiple nieghbors to consider, etc. Starting to see why a single batch of situational scripts doesn't do the trick all the time?

Quoting ChongLi,
This is an area where the AI has the advantage. It can simulate a battle between 2 stacks of units 1000 times over and determine a pretty good probability of success.

Yes it could. But the issue is two-fold:

1: That takes WAYYYYY longer than your giving it credit for. Youd see considerable lag for even a few dozen internal simulations. 1000? I guess I could end my turn when I leave for work and start it when I get home every day... the quick results of a battle you see in the TW series isn't a real battle, its a randomized algorithm working with a few base unit stats. A real battle isn't a few calculations...

2: The AI would be playing itself in this battle, and unless (here I go again...) we see SD develop true artificial intelligence and bring about the singularity, the AI in battle wont match a humans cleverness. The AI might think deploying its archers in the rear and using them as artillery is the only way a human could use them, but the human might be like "Nah, I've got plenty" and use them as a fodder like meatshield. Suddenly everything changes and the AI's calculations were a waste.

Reason for Karma (Optional)
Successfully updated karma reason!
August 8, 2009 10:27:22 PM from Elemental Forums Elemental Forums

Quoting endofdayz,


2: The AI would be playing itself in this battle, and unless (here I go again...) we see SD develop true artificial intelligence and bring about the singularity, the AI in battle wont match a humans cleverness. The AI might think deploying its archers in the rear and using them as artillery is the only way a human could use them, but the human might be like "Nah, I've got plenty" and use them as a fodder like meatshield. Suddenly everything changes and the AI's calculations were a waste.

The funniest thing about this statement is that the exact opposite is what happened when a man used a computer AI program to develop strategies for a naval wargame competition.

http://www.newyorker.com/reporting/2009/05/11/090511fa_fact_gladwell?currentPage=all

In 1981, a computer scientist from Stanford University named Doug Lenat entered the Traveller Trillion Credit Squadron tournament, in San Mateo, California. It was a war game. The contestants had been given several volumes of rules, well beforehand, and had been asked to design their own fleet of warships with a mythical budget of a trillion dollars. The fleets then squared off against one another in the course of a weekend. “Imagine this enormous auditorium area with tables, and at each table people are paired off,” Lenat said. “The winners go on and advance. The losers get eliminated, and the field gets smaller and smaller, and the audience gets larger and larger.”

Lenat had developed an artificial-intelligence program that he called Eurisko, and he decided to feed his program the rules of the tournament. Lenat did not give Eurisko any advice or steer the program in any particular strategic direction. He was not a war-gamer. He simply let Eurisko figure things out for itself. For about a month, for ten hours every night on a hundred computers at Xerox PARC, in Palo Alto, Eurisko ground away at the problem, until it came out with an answer. Most teams fielded some version of a traditional naval fleet—an array of ships of various sizes, each well defended against enemy attack. Eurisko thought differently. “The program came up with a strategy of spending the trillion on an astronomical number of small ships like P.T. boats, with powerful weapons but absolutely no defense and no mobility,” Lenat said. “They just sat there. Basically, if they were hit once they would sink. And what happened is that the enemy would take its shots, and every one of those shots would sink our ships. But it didn’t matter, because we had so many.” Lenat won the tournament in a runaway.

The next year, Lenat entered once more, only this time the rules had changed. Fleets could no longer just sit there. Now one of the criteria of success in battle was fleet “agility.” Eurisko went back to work. “What Eurisko did was say that if any of our ships got damaged it would sink itself—and that would raise fleet agility back up again,” Lenat said. Eurisko won again.

Eurisko was an underdog. The other gamers were people steeped in military strategy and history. They were the sort who could tell you how Wellington had outfoxed Napoleon at Waterloo, or what exactly happened at Antietam. They had been raised on Dungeons and Dragons. They were insiders. Eurisko, on the other hand, knew nothing but the rule book. It had no common sense. As Lenat points out, a human being understands the meaning of the sentences “Johnny robbed a bank. He is now serving twenty years in prison,” but Eurisko could not, because as a computer it was perfectly literal; it could not fill in the missing step—“Johnny was caught, tried, and convicted.” Eurisko was an outsider. But it was precisely that outsiderness that led to Eurisko’s victory: not knowing the conventions of the game turned out to be an advantage.

“Eurisko was exposing the fact that any finite set of rules is going to be a very incomplete approximation of reality,” Lenat explained. “What the other entrants were doing was filling in the holes in the rules with real-world, realistic answers. But Eurisko didn’t have that kind of preconception, partly because it didn’t know enough about the world.” So it found solutions that were, as Lenat freely admits, “socially horrifying”: send a thousand defenseless and immobile ships into battle; sink your own ships the moment they get damaged.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000922   Page Render Time: