Those Wacky AIs

A moderate amusing story, gamers will enjoy it as it a quick peek into the making of a game.

Today, I turned on the dimplomacy part of the game. The computer, and human players, can now forge alliances, make trade agreements, have peace treaties, declare war and all sorts of other goodies.

So, I turn on the every man for himself 6 computer players (no human players) and watch the computer go at it.

Right away, the AI starts making alliances and then almost immediately breaks it and makes a new alliance with somebody else.

Because of the diplomacy penalty for breaking an alliance pretty soon everybody is really angry at everybody else. But since they are all roughly equal, nobody dares to declare war without … you guessed it … making an alliance. So, the AIs make alliances so they can go to war, but because of the bug (and maybe because they hate it each other), the alliance breaks.

It was very funny to watch.

There ended up being a few bugs, but the main one was that the AI would reevaluate the military power of everybody each round and determine who they would like to be friends with. Since, everybody was roughly equal everybody looked equally appealing. However, there is a “semi”-random factor accounting for the level of military intelligence each AI has. So depending on how good their spying was going would determine who they wanted to be allied with.

Which game is this?

I sometimes find it entertaining to let my Civ II game play itself (go to the cheat menu, and select “No Human Player”). Since I had to hit enter every few seconds to get the turns moving, I jury-rigged a spoon with a bowl in such a way to hold the key down. I often found that the game stalemated instantly, and the AI would build up the military of each country, even though I had turned off the military building in each city. Even if there was only one civilization left, it would move the pieces around seemingly randomly, sometimes upsetting citizens because the military pieces had move beyond the perimeter of the city. The pieces often got stuck into a loop of sorts, and would move back and forth between two spots (never losing any turns, because they were moving on railroad) until a dialog box would come up, saying “Continue long piece move?” or something like that. Not a very intelligent AI, that one. At least not when it’s playing itself.


SanibelMan - My Homepage
“Hey, you sass that hoopy Ford Prefect? There’s a frood who really knows where his towel is.”

SanibelMan wrote:

I believe Glitch is a game programmer by trade (like me!). Here, he’s probably talking about a game he himself is developing. Am I right?

The AI in this game sounds an awful lot like Alpha Centauri’s.

AI: Only reparations of 15 kazillion credits will stop this war!

Me: Oh, go to hell.

AI: We give up! We’ll give you all our tech and energy credits! Just don’t kill us!


TMR

‘Human idiom: dumb as a box of rocks.’

Sorry I didn’t see your reply SanbielMan.

Yes, it is a game I am working on currently unnamed, but internally we are calling it “Conquerer”.

The diplomacy AI in Alpha Centauri was a bit odd, but it was somewhat better than it predecessor Civ 2 (and Civ 1). The problem I think with SMAC’s AI was that it broke down diplomacy into individual steps rather than a big picture approach (like that in Conquerer). It couples it’s long term strategic goals with short term (and even long term diplomacy).

I mean, Conquerer couples strategic planning with its diplomacy.

For example, yesterday, the AI recognized that a mountain pass was the best strategic way to attack. It established a trade agreement with the owner of the mountain pass. Then it issued an ongoing request to a short term military alliance (i.e. let me pass through your land). As they became more friendly the owner eventually gave permission and the army passed through to attack.

In other words, Conquerer views diplomacy as a means to achieve goals that it sets for itself.

Maybe the AI isn’t a glitch…seems to be how the world works. I used to sport a pretty heavy Civ I addiction, I had gotten an easter egg from a friend on how to view the whole map at any point in the game.


Habit rules the unreflecting herd. - Wordsworth

Here’s my take on game AIs, as someone who’s been playing computer strategy games for…well, 15 years, more or less since they’ve been around.

The only way an AI will ever beat a human opponent is simply by being faster – bringing more brute-force problem solving ability to the table. Look at any of the popular real-time games out there; the only time the computer wins is when it can build up an army before the human player can. If the human player survives the first onslaught, s/he will win every time.

In military terms, I’ve never seen a good defensive AI. Offensively, Age of Empires II and Starcraft aren’t too bad, but they’re predictable.

Glitch, AuraSeer, are you ready for a little feedback from your customers? Make the AIs unpredictable. Keep the speed in there, but occasionally have them do something not-completely-logical. Not something dumb, exactly, but just something little, like bunching up their gaurd towers in one area, exposing another, or building up troops a little longer than normal, or sending troops to attack without knowing what the enemy has. Also, one big problem I’ve seen with just about every single game is threat recognition. AIs seem to be always really bad about changing targets and recognizing which of my units or buildings pose the greatest threat to him.

Just a thought, hope it helps.

AuraSeer said:

Whoa, cool. :slight_smile: The closest I’ve come to that kind of thing is futzing around with making Unreal/Unreal Tournament maps.

To add to what sixseatport said, I’d like to see AI that uses better attack tactics, like using feints, varying attack routes, opening up multiple fronts of attack, etc.


TMR

‘DM-CubeWithALightInIt, anyone?’

Sounds like you guys are talking about RTS games. “Conquerer” is a turn based game strategy game (TBS). Not sure what AuraSeer is working on.

In any event, if you want to see some clever AI wait for the demo. It can be pretty darn devious sometimes and is very good at recognizing multiple methods to acheiving its goals. Currently, the personality of the AI is turned off, because I want to make sure it properly recognizes the best solution, once the personality is in place it will be much more unpredictable as the AI resolves best solutions in the context of what the ruler “feels”. For example, an “honorable warrior ruler” may very well ignore an ambushing strategy even if it is best. I am making it seem rather simple, because the personality is much more than just a simple one or two word description, but still this suffices as an example.

Not quite AI, but on the way there.

I wrote a DOS Blackjack program for my home computer when it was a 486 4M with major bugs in the Windows 3.1.

I designed it with 4 modes: [list=1][li]Regular human play[]Automatic play (where the computer would use statistical tables to make choices)[]Cheat mode, where the player would see the next 15 cards in the shoeAutomatic Cheat, where if the computer was directed to hit by the tables from #2 above but that hit would make it go bust, it’d stay instead[/list=1][/li]
Of course, the latter ended up making the most money, and quickly too. But that mode runs so quick that it’s impossible to see how things play. So I put a pause in it so that if the computer split a hand, it’d stop and let me see how it played. The very first split I saw revealed a bug I still had. The computer split a pair of eights, but then didn’t take a second card for one of the hands. (Reminded me of the Bugs Bunny cartoon when Bugs only took 1 card in a blackjack game, but won when it was the 21 of hearts. :))

Even with that bug, the computer won about half of the single-card hands.


What would Brian Boitano do / If he was here right now /
He’d make a plan and he’d follow through / That’s what Brian Boitano would do.

I was playing a turn-based strategy game (Age of Wonders) not too long ago when I noticed something rather interesting. There was a “mana node” on the border between two computer nations, and each nation had only one unit in the area. Every turn, one side would occupy the node and then move back towards a safer position. The opposing side would then do the exact same thing! This went on God knows how long. . . well, until my forces crushed them both.

:insert evil grin smiley here:

I really enjoy turn-based strategy games. One of my favorite tactics is to make peace with every computer player and let them beat the snot out of each other while I sneak in and occupy the land they’re fighting over. Either that or I wait for one nation to destroy another and promptly occupy all the newly independent cities. . .

Hey, I’m evil. :slight_smile:
– Sylence


If a bird doesn’t sing, I’ll wait until it sings.

  • Tokugawa Ieyasu