Skip to main content
GameDev.net gamedev.net
🔒 Locked

interesting approach AI learning

Started by snak_attack Feb 18, 2003 at 4:22 PM 15 replies 2.2k views
Original Post
snak_attack
snak_attack
Check out this interview - it''s a game about to be released that takes an interesting approach to AI learning. The way I understand it at the conclusion of a game you can submit some summary of your game to a central server. Other players can somehow access these summaries and their ''local AI player'' can somehow analyze what the original player did and incorporate those strategies into it''s own planning. I''m sure this guy isn''t the first to think of this, but I''ve never seen this implemented in a commercial game before. http://www.strategyinformer.com/previews/galciv-interview.shtml
aleph
aleph
It doesn''t seem too impressive to me. The interview doesn''t really say how the AI training works, but it sounds like they just send a couple of simple parameters generated from your game to the server, and optimize the AI according to those. I suppose it could work rather well, but it''s not exactly high-tech.

Besides, statements like this make me quite sceptical:

"Galactic Civilizations'' AI may be amongst the best seen in strategy games. The reason for this is that our AI is multithreaded.
[...]
The goal isn''t just to make an AI that is challenging, but to make an AI that plays like real human beings. The best way to do that is to have the AI be able to come up with complex, logical strategies and by having the AI able to multitask within itself during your turns, the AI can generate those complex strategies."

What, is it intelligent because it is multithreaded??
fup
fup
oh com''on now... Everyone knows the more threads you have the more intelligent something is.

It works the same way the more knobs you have on your hifi, the better it sounds.

The more buttons on your remote... the better the picture quality of your TV.

The more controls on your gamepad the better a player you are are.

The bigger your exhaust, the bigger your air intakes and the longer your rear spoiler... the faster your car goes.

These are the simple facts of life. Everyone knows this.




ai-junkie.com
snak_attack
snak_attack
We all know the brain takes advantage of massive parallelization. This is the biological equivalent of multiple threads. Therefore the more threads you use, the closer you are to intelligence. (please don''t think I''m serious)


Ignoring the hype, I think the concept of analyzing the player community''s game histories to improve the AI players is pretty cool. It''s sort of irrelevant how high tech it is if the results are good. I''m guessing you could use the winning player''s spending patterns (guns vs. butter), what kinds of units they produce, and how they combine those units before action to give the AI a better idea of how to get the best bang for their buck. If there is a fixed set of maps, you can analyze what points the winner controlled, and consider those to have a slightly higher value in later games. All of these data elements seem fairly straightforward to extract and apply towards other games. If it works, it could greatly lengthen the time taken for players to learn the ins and outs of the AI, which is a good thing.
Timkin
Timkin
It''s not the quantity (of threads) that matters, its the quality (and what you do with them)!

Timkin
rmsgrey
rmsgrey
From my reading of the article, the main idea of multi-threading the AI is to have it running during the user''s turn rather than leaving idle cycles while the user thinks.

I seriously doubt this is a new idea though.
gpdev
gpdev
This is not just a simple space battle game.
GalCiv is a galactic domination game with a lot of emphasis on diplomacy, research and empire management.
So the AI needs to make a lot of complex decisions.

In most other games the player has to wait while the AI is thinking. and in order to make this waiting bearable for the player - it is quite short.

In GalCiv, on the other hand, the AI has more time to think because it constantly analyzes the situation and devises a strategy while the player can continue playing instead of waiting.
This is possible because GalCiv AI is multithreaded.

I think that is what the developer means when he says that the AI is good because it is multithreaded.





[edited by - gpdev on February 22, 2003 8:09:20 AM]
TerranFury
TerranFury
Now that actually does make sense! Unlike most turn-based games that have a long "AI turn," this one runs the AI in a seperate thread which analyzes the game state as you make changes to it during your turn, so it only needs a little computation time during it''s own turn? That is a rather original idea (or at least it''s the only time I''ve heard of it), so I''ll give it some respect!
Geta
Geta
quote:
Original post by TerranFury
Now that actually does make sense! Unlike most turn-based games that have a long "AI turn," this one runs the AI in a seperate thread which analyzes the game state as you make changes to it during your turn, so it only needs a little computation time during it''s own turn? That is a rather original idea (or at least it''s the only time I''ve heard of it), so I''ll give it some respect!


Actually, using threads for a computer game AI is not that new or original. The GalCiv AI designer/developer (Brad Wardell) previously used threads in his first version of GalCiv (for OS/2 which supported threads) in the mid 90s. In 1995, I used threads for each computer AI Player in Enemy Nations (for WinNT and Win95). And I used a thread again for the command level AI in Rebel Moon Revolution in 1998. While I can''t go into implementation details, I can confirm that threads were used for AI in Full Spectrum Command that I just finished work on in December 2002.

I suspect other commercial game AI programmers have also found the use of threads for AI to be successful in their games as well.

Eric
gpdev
gpdev
And what's more interesting is the approach GalCiv takes regarding AI improvement from player submitted games.
(which is, by the way, the topic of this thread)

When a player wins against the AI opponents - she can choose to submit the game to the GalCiv "Metaverse" site.
The developer can analyze the player's tactics
(what techs were researched and in what order, what projects were built, what ships were constructed, etc.)
And see with what strategy the player managed to win.
Then the AI opponents can be improved with a counter strategy.

That way they can keep releasing new, better AI that can win against
Human opponents, so the game is still challenging even for experienced players.

I really like this idea.



[edited by - gpdev on February 24, 2003 5:48:29 PM]
gpdev
gpdev
To anyone who''s interested in more info about the GalCiv AI -
Brad Wardell, GalCiv''s AI Programmer (that is one of his hats ),
Describes the gameplay epxerience on this page:


http://www.stardock.com/stardock/articles/galciv/gc_example1.html

A few excerpts:

"Most computer AIs in PC games are what we call "reactive". They look at the current game state and then make decisions based on that right then and there. In Galactic Civilizations, computer players come up with a strategy that may take many turns to bear out which can cause players who think they''re winning (ahem) to suddenly discover that a trap has been sprung."


"When I say that each AI player has its own AI engine, I mean each major race literally has its own C++ code behind it. We''re not talking some variables that are different, I mean we wrote the AI 6 times (5 for each major player and the minor races share a 6th)"


fup
fup
"When I say that each AI player has its own AI engine, I mean each major race literally has its own C++ code behind it. We''re not talking some variables that are different, I mean we wrote the AI 6 times (5 for each major player and the minor races share a 6th)"

I can only shake my head at that.




ai-junkie.com
gpdev
gpdev
Yeah, it doesn''t sound like a text-book approach

I don''t know the details of their AI implementation but say you have a base class:
AIBase
Which includes common code for all AI races.

Then you inherit new clasess from AIBase, one for each race
And implement race specific AI code inside its own class.

That way all AI opponents share a common AI engine (AIBase) but opponents from different races can still have some unique abilites.

I think this sounds better from an OOP standpoint.









snak_attack
snak_attack
wow this guys not getting much love around here.
TerranFury
TerranFury
I stand corrected. I didn''t realize many turn-based games did background processing. Anyway, from the other quotes that have been posted on this thread, it does seem pretty clear that the AI is no different from any other game''s, and that, unfortunately, this particular developer didn''t know the meaning of the term "code reuse." Seems pretty silly to me.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.