Frogboy Frogboy

More weekend AI musings

More weekend AI musings

I’ve been getting a lot of messages. Let me first say that I get between 20 to 30 a day (just messages, not counting my regular email) so I tend to be very very slow in getting back to them (I apologize in advance for this).

But the most common question I have been getting these past few days is “How will I know if the AI is “good enough”?

Now, I understand that people want the game to come out on August 24th (the scheduled release day). I very much want this too. But we’ve been working on this game for a long time and we want to get it right and the AI is a big part of that. If the AI isn’t ready, we’ll push it back to the next retail slot available to us (February 2011).

I am pretty confident that the AI will be ready.  So again, how will I know if it’s ready?

The basic answer is, if it can beat me on my test map, it’s probably ready to go.  The test map consists of a main continent and 4 islands.  Thus, the AI has to be able to handle everything from me simply walking to him and crushing him to taking care to not let me take over the islands and wipe him up with magical spells (the shards are on the islands). 

There’s lots of other strategies in between I’ll try out on it and have it learn.  But that’s the basic minimum I expect – be able to play a good game without having to cheat.

Today, I focused more on the nuts and bolts. Getting the AI to build a decent army and start carefully targeting cities and units that it thinks it can take.  One AI player ultimately beat out the other 3 and won the game (I wasn’t participating in this game).  It didn’t do it very well IMO. It was inefficient and sloppy but it did, after many new functions being added, eventually get its act together beat its AI competitors.

But it has a looong way to go.  The TACTICAL battle AI I won’t get to for another 2 weeks. That’s why we haven’t been showing it yet.  Then there’s the matter of it using magical well both tactically and strategically.

The part I’m really not looking forward to is dealing with islands and human cheese (build up via magic a wall of mountains or turn your area into an island).

I am happy to say that right now, the AI does do some critical (and difficult) things even now such as designing its own units (non trivial), intelligent building up a city under many different circumstances (again, non trivial, the GalCiv AI never built its planets well ). It can recruit NPCs. It can marry and have children.  It can gather together units and form a combined arms army. It can research technologies intelligently.

So even at this stage, other than the island hopping and the tactical battle AI (and having it cast spells) we could toss out a “challenging” AI if I let it cheat enough.  Of course, that’s not acceptable. The AI needs to play well without having to cheat.

I’m going to toss in a disclaimer here – EVERY AI I’ve ever written has guys who have just gotten incredibly good or found some loophole and said “The AI sux!11!”.  This will be the case here too.  I’ll be working on this AI for years to come.

If you have any questions on AI development, feel free to ask here.

 

p.s. Hello to my friends on CanardPC. :)

114,840 views 65 replies
Reply #26 Top

What do you use for the AI to have a grasp on the interconnection of different islands and closed mountain valleys?

A high level pathing that only considers zones and how you get from one to the other?

 

Btw, are there units that can get over mountains or is the only way to get to someone who cut himself off by high mountains to lower those mountains by magic?

Reply #27 Top

Quoting Scorpiana, reply 25
Just a little (maybe ) question, will we be able to just have a few AI's play against each other and see how / why they decide to do the things they do? That could make for an interesting new game, have people try to develop an AI that can beat the others, could even become a tournament, let the best AI win and become self aware... Ok, that last part may be a bit too much

yeah i second this.  i used to do this with supreme commanders AI.  i would download all the different AI mods and make them fight each other.

Reply #28 Top

in the final game, will there be something like AI Arena? So that those of us nerds could start an AI League?

"In the red corner, we have the Noob AI v1.5, weighth 250kb! And it the blue corner, the so far champion of the league AProI v2.1 weigth 400kb! Lets get ready to rumble!"

Would be awesome....

 

Edit1: PS: LOL, just noticed there are other posts suggesting this, i support!

Reply #29 Top

I bet in the year 2020 the millitery will be using a AI named "Stardock" for their robots because the millitery sucks ass when it comes to AI. Stardock is hacking the pentagon O.O then again who hasnt -_-

Reply #30 Top

Quoting Blazerules, reply 29
I bet in the year 2020 the millitery will be using a AI named "Stardock" for their robots because the millitery sucks ass when it comes to AI. Stardock is hacking the pentagon then again who hasnt

I doubt that. :)

AI in computer games tends to be pretty awful.

Here's how I grade my own work over the years where 1=AI is completely useless to 10=AI is insanely good.

1. Galactic Civilizations for OS/2: 6

2. Entrepreneur/The Corporate Machine: 7

3. Galactic Civilizations for Windows: 5

4. Galactic Civilizations II for Windows (initial release): 4

5. Galactic Civilizations II: Twilight of the Arnor: 5

6. The Political Machine 2008: 5.

7. Elemental - Beta 2: 2

 

 

Reply #31 Top

Why did GalCiv for Windows have worse AI than for OS/2?

Reply #32 Top

Quoting _PawelS_, reply 31
Why did GalCiv for Windows have worse AI than for OS/2?

Because of Microsoft! [Sorry couldn't resist..] :w00t:

Reply #33 Top

It's probably because GC OS/2 was a simpler game than GC Win. The original didn't have starbases I don't think, and the inclusion of those would definitely have thrown the AI a curveball.

Reply #34 Top

What is your (practical) target for Elemental?  7?  Going to hit an 8 before you're happy to release it to the wild?  A 10 is probably unreasonable for any game of course, but I'm curious with your "scores" being so low (and thus you being probably overly hard on yourself) what you wanted to achieve here.

Reply #36 Top

All your AIs?  Even the one for Corporate Machine?

Reply #37 Top

 

Quoting zalesak, reply 28
in the final game, will there be something like AI Arena? So that those of us nerds could start an AI League?

"In the red corner, we have the Noob AI v1.5, weighth 250kb! And it the blue corner, the so far champion of the league AProI v2.1 weigth 400kb! Lets get ready to rumble!"

Would be awesome....

Edit1: PS: LOL, just noticed there are other posts suggesting this, i support!

To quote myself from the Data Driving the AI thread:

"For years I've awaited a stand-alone AI that we can buy and tweak, use in different games (it would plug into games, of any genre), and have it learn as it's used (and as we tweak it).  Players would compete by running their AIs against each other in games -- it'd be the cyber version of hot-rod drag racing.  The AI would assist/augment our skills, or just go without our participation.

Someday..."

I figure I've got maybe another 30 years before I check out, and hopefully that'll be long enough :beer:

 

Reply #38 Top

I still can't believe you had guys who could curbstomp the TCM AI.  I remember a post years ago where you revealed the thinking behind economic centres, and one of the top players mentioned how similar it was to his own reasoning.

Reply #39 Top

Quoting Frogboy, reply 30



Quoting Blazerules,
reply 29
I bet in the year 2020 the millitery will be using a AI named "Stardock" for their robots because the millitery sucks ass when it comes to AI. Stardock is hacking the pentagon then again who hasnt


I doubt that.

AI in computer games tends to be pretty awful.

Here's how I grade my own work over the years where 1=AI is completely useless to 10=AI is insanely good.

1. Galactic Civilizations for OS/2: 6

2. Entrepreneur/The Corporate Machine: 7

3. Galactic Civilizations for Windows: 5

4. Galactic Civilizations II for Windows (initial release): 4

5. Galactic Civilizations II: Twilight of the Arnor: 5

6. The Political Machine 2008: 5.

7. Elemental - Beta 2: 2

 

 

Have you ever played DroidBattles? It's a neat little game where you put bots together and program them with an in-game language that's very similar to x86 assembly. Then you watch them fight!

Reply #40 Top

Quoting Nick-Danger, reply 37
 


Quoting zalesak, reply 28in the final game, will there be something like AI Arena? So that those of us nerds could start an AI League?

"In the red corner, we have the Noob AI v1.5, weighth 250kb! And it the blue corner, the so far champion of the league AProI v2.1 weigth 400kb! Lets get ready to rumble!"

Would be awesome....

Edit1: PS: LOL, just noticed there are other posts suggesting this, i support!
To quote myself from the Data Driving the AI thread:

"For years I've awaited a stand-alone AI that we can buy and tweak, use in different games (it would plug into games, of any genre), and have it learn as it's used (and as we tweak it).  Players would compete by running their AIs against each other in games -- it'd be the cyber version of hot-rod drag racing.  The AI would assist/augment our skills, or just go without our participation.

Someday..."

I figure I've got maybe another 30 years before I check out, and hopefully that'll be long enough

 

 

I used to run Titan difficulty Aggressive personality against each other in Age of Mythology: Titans. It was actually pretty amusing to watch two horrendously cheating AI go at it.

Reply #41 Top

General AI question : Will there be any option for *really fast* AI vs AI matches? By fast I mean without spending time on visuals/animations/artificial delays. I guess the cloth map could enable a fast game, but then again on the cloth map you don't have tactical battles. Or I'm just missing something & I'm talking garbage.

 

Reply #42 Top

Quoting esrever2357, reply 41

General AI question : Will there be any option for *really fast* AI vs AI matches? By fast I mean without spending time on visuals/animations/artificial delays. I guess the cloth map could enable a fast game, but then again on the cloth map you don't have tactical battles. Or I'm just missing something & I'm talking garbage.

So in other words, you want the AI to play at the speed of the War Games AI playing Global Thermonuclear against itself.

First of all, they would likely still go kinda slow since really good AI usually take a decent amount of time to think, especially for turn based games where they are essentially told they have as much computing power as they want. Removing visuals and such would take a lot of code changes, to the point where they may even need a separate game engine. So no, while cool, it would take a lot of work for nothing and as such would not be implemented.

Reply #43 Top

Well, I think what I want from an AI is different than what FrogBoy wants to make.

I want an AI that simulates a person. An AI that can make mistakes. An AI that behaves in sometimes illogical (i.e. emotional) ways. An AI that will bear a grudge.

Take me for example. Most of the time I play pretty straightforward in multiplayer games, respect my treaties and do not go for the backstab. Most of the time. But if someone betrays an alliance on me, I will completely destroy myself to make sure they go down with me.

Of course, having an AI that can win without cheating is going to be a nice change too. I thought the AI in GC2:TWOTA was really quite good, and I definitely saw the improvements between TWOTA and initial GC2. Although if I were rating I would give vanilla GC2 a 6 and TWOTA a 9. I did feel that TWOTA was a tad too tough at normal difficulty. I am used to being able to win at normal on most games after I ahve a few games under my belt. I don;t look for ways to cheat the AI though, I am sure a lot of people can destroy TWOTA at normal. It still gives me a good game at normal difficulty.

Reply #44 Top

Quoting alway, reply 42

So in other words, you want the AI to play at the speed of the War Games AI playing Global Thermonuclear against itself.

Not want, just wondering. The motive is : faster AI play speed == more AI testing in a given time.

Quoting alway, reply 42
 First of all, they would likely still go kinda slow since really good AI usually take a decent amount of time to think, especially for turn based games where they are essentially told they have as much computing power as they want.

Yes indeed, the AI could take a bit of time by itself, but the more time saved the better.

Quoting alway, reply 42
Removing visuals and such would take a lot of code changes, to the point where they may even need a separate game engine. So no, while cool, it would take a lot of work for nothing and as such would not be implemented.

You sound a bit absolute.Not sure how you got this idea, it's not *that* extreme & engine-changing to conditionally show a static screen instead of the regular game. Keep in mind that some times this is possible with the addition of just *a few characters* in the code..

 

Reply #45 Top

Quoting Scorpiana, reply 25
Just a little (maybe ) question, will we be able to just have a few AI's play against each other and see how / why they decide to do the things they do? That could make for an interesting new game, have people try to develop an AI that can beat the others, could even become a tournament, let the best AI win and become self aware... Ok, that last part may be a bit too much

That could actually be a Really Cool Idea for a Elemental Demo Mod. Maybe call it, Elemental: Watch The Magic!!! Sounds like some pretty good PR and marketing to me :)

Reply #46 Top

I doubt that.

AI in computer games tends to be pretty awful.

Here's how I grade my own work over the years where 1=AI is completely useless to 10=AI is insanely good.

1. Galactic Civilizations for OS/2: 6

2. Entrepreneur/The Corporate Machine: 7

3. Galactic Civilizations for Windows: 5

4. Galactic Civilizations II for Windows (initial release): 4

5. Galactic Civilizations II: Twilight of the Arnor: 5

6. The Political Machine 2008: 5.

7. Elemental - Beta 2: 2

 

Well, considering the games were getting considerably more complex, the more recent AI's you have made were probably much better than your early AI's.  Besides, you want to be able to let an AI cheat a little bit so the end user can tailor it to his challenge level. 

 

I thought the GalCiv II AI's struck a pretty good balance.  Sometimes the "Best" AI isn't the most difficult one, it is the one that gives the best challenge to the "average" player -- then you add the ability to customize it or let it cheat a bit so players can tailor it for their own experience.  I usually played Civ IV on Monarch or Emperor, but when I looked on the forums some guys say they couldn't win on Warlord while some other guy would be trying to convince everyone that Deity was too easy.

Reply #47 Top



The part I’m really not looking forward to is dealing with islands and human cheese (build up via magic a wall of mountains or turn your area into an island).

 

Remember to record the human cheese! Human cheese makes for beautiful packaged AI strategies! Imagine the look on the journalists faces when you tell them that the AI will do stuff like sink part of a continent so they can hide on it and develop their empire and not get attacked. (that's something you can list in the XML for the AI personalities) like this:

 

Code: xml
  1. <AIFavouredStrategies>
  2.  <AIEssenceStrategy Game="EarlyGame">
  3.   <!-- AI will pick one of these "overarching" strategies for essence, check requirements and perform it. -->
  4.   <Strategem Name="HiddenIsland">
  5.    <!-- Give this strategy to AIs with water spells -->
  6.    <EssenceCost>5</Cost>
  7.    <!-- Requirements to meet before executing -->
  8.    <Requirement>Lower Land</Requirement>
  9.    <Requirement>Water Node</Requirement>
  10.    <Requirement>Water Node</Requirement>
  11.    <Requirement>Farm</Requirement>
  12.   </Strategem>
  13.   <Strategem Name="HiddenFortress">
  14.    <Requirement>Toshirô Mifune</Requirement>
  15.  ... > : O
  16.  </AIEssenceStrategy>
  17. </AIFavouredStrategies>

Reply #48 Top

Quoting Denryu, reply 43

Of course, having an AI that can win without cheating is going to be a nice change too.

Hopefully the AI will be decent enough...however I don't think that it's possible to create an AI, which is able to beat a good player. We shall see.

Reply #49 Top

Quoting Tormy-, reply 48

Quoting Denryu, reply 43
Of course, having an AI that can win without cheating is going to be a nice change too.
Hopefully the AI will be decent enough...however I don't think that it's possible to create an AI, which is able to beat a good player. We shall see.

Depends on the amount of work you invest. I'd say it is possible although not likely within the constraints of the Elemental project. Maybe some community work will bring it closer to that point after release.

Reply #50 Top

Quoting TCores, reply 47

Remember to record the human cheese! Human cheese makes for beautiful packaged AI strategies! Imagine the look on the journalists faces when you tell them that the AI will do stuff like sink part of a continent so they can hide on it and develop their empire and not get attacked. (that's something you can list in the XML for the AI personalities) like this:
I think the idea behind Human Cheese is that it's really easy for a human player to get around, but not so much for AI.  You'd need a lot of magical surpremacy to stop that being a waste of resources against a human.