.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
World Supremacy- Save $9.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old December 1st, 2006, 04:02 AM
Arralen's Avatar

Arralen Arralen is offline
Major General
 
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
Arralen is on a distinguished road
Default AI concept of the \'80ies ... why?

There's a fundamental flaw in all of todays strategy games, including Dominions (3) :

The games getting more and more complicated - several orders of magnitude, actually, if you want to put down the mechanics into formulas for an AI to use.
And we all want "smart" AIs, don't we? AIs which at least somewhat understand whats going on and can play the game on roughly even ground without cheating too much (able to see through for of war etc)

But does it get the 'power' to do so? Hardly.
Yes, o.c., CPU 'power' has grown enormously.
But power = work * time, or something like that, I was told.
And obviously, there's lots more time needed to reach to 'power levels' we want to see, resulting in long waits between turns.
Have seen those complaints about Dom3, SE5 and the Civ series lately

But there's an easy solution to this:
Atm, the AI programming is still following the concepts of the '80 .. but instead of giving the AI only some seconds to "think" between the player hitting the "end turn" button and him eagerly awaiting the results of his orders, the AI(s) should do its(their) turn(s) while the player does his.

That shouldn't be too hard to implement, with all those games being TCP/IP-enabled MP games .. just plug the AI(s) in like any other player in a MP game, and you wouldn't even need big changes to the game mechanics to make it work.

And with all those multi-thread, multi-core and multi-CPU equipped PCs out there, I doubt anyone could complain about the AI slowing down his PC or endless "end turn" waits ... .
__________________
As for AI the most effective work around to this problem so far is to simply use an American instead, they tend to put up a bit more of a fight than your average Artificial Idiot.
... James McGuigan on rec.games.computer.stars somewhen back in 1998 ...
Reply With Quote
  #2  
Old December 1st, 2006, 04:17 AM

Recruit Recruit is offline
Private
 
Join Date: Oct 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Recruit is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

Quote:
Arralen said:
That shouldn't be too hard to implement
I think you don't have an impression of how much is involved in writing a successful AI.

Read the wikipedia article on Deep Blue and see how much was involved in writing an AI that could play Chess well. (although this is a bit of an extreme example) And chess only has 32 pieces on a relatively tiny grid.
Reply With Quote
  #3  
Old December 1st, 2006, 04:47 AM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

Arralen didn't mean that kind of AI. He basically suggested giving AI more time to think.
Reply With Quote
  #4  
Old December 1st, 2006, 06:22 AM
Arralen's Avatar

Arralen Arralen is offline
Major General
 
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
Arralen is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

Quote:
Recruit said:
Quote:
Arralen said:
That shouldn't be too hard to implement
I think you don't have an impression of how much is involved in writing a successful AI.

I think I have.
You know, I have minor degree in programming. Ok, its only "for engineering purposes" .. but maybe they should let the engineers work on AI development, not the computer scientist, maybe we would have gotten somewhere by now
Anyhow, while its been quite some time since, and I'm only fiddling around with some script language for small tools now and then, I think I have a pretty solid grasp on how hard it is to do AI programming. Not on it itself, mind, but about the complexity involved.

Quote:
Read the wikipedia article on Deep Blue and see how much was involved in writing an AI that could play Chess well. (although this is a bit of an extreme example) And chess only has 32 pieces on a relatively tiny grid.
A Deep Blue - like AI wouldn't work for dominions IMHO, and -surprisingly- a game like Dominions might be easier to do AI-wise than chess!
Why? Because of the random element, and the high complexety!
Chess is over-analyzed and at the same time highly deterministic. If you want to do a good AI, you must factor everything in exactly, up to the quite complex moves and tactics the human mind can conceive - at least those which are commonly known, and those are quite a few with chess.

Dominions, on the other hand, is ever-changing and, to a degree, random. Arbitraty solutions will work ok, and might be the only one which make sense.
E.g.:
If Dom would be deterministic like chess, you could pre-calulate how many HI you would need to run down and slaughter a given bunch of shortbow archers on the battlefield. Every possible option and event would be known beforehand - but in Dom, you don't know how many arrows will really hit, if some adverse weather would give added encumbrance or restrict archery, or even where the pieces will be placed on the battlefield.
Like in chess, an AI would have to pre-calculate every possible move several turns into the future, weighthing the possibilities for each "branch". That's not only eating up computer ressources like crazy, it's also very prone to error if some detail is missing in formulas describing your "AI model" of the game. (e.g.: computer generated weather forecasts...)
A human player would draw from experience, and (as commonly in chess) known 'optimized' solutions he learned by heart.
They're doing the 2nd with Deep Blue (vast libraries), and don't have a clue how to do the 1st ...
That's what Deep Blue is: a programm the calculates every possible move serveral turns into the future and compares the result to some pre-made libraries which contain lots of possible positions and human-made estimates about their "worth". I wouldn't call that an AI, as it depends on human assessments on every move it makes.

But dominions doesn't work that way: a player would make a guess (from experience), and bring some more just to be sure. And he might end up wrong because of something that he didn't figure in or didn't know beforehand.
The AI could do very much the same: Do a quick guess (easy calc), bring some more, hope for the best - and it would behave pretty much human-like and play equally strong.


Quote:
Endoperez said:
Arralen didn't mean that kind of AI. He basically suggested giving AI more time to think.
Actually, I meant something more like an AI then a turn-precalculator ;-)
But you're right about the 'thinking time'. With moving the AI turn processing from between-the-turns to during-the-turn, the standard Dom AI wouldn't benefit, unless the devs add some more sophisticated routines. But the player wouldn't have to wait that long for the turn to finish.
And there would be the option to add some more advanced AI which would result in prohibitive turn calculation time with the current setup .. .
__________________
As for AI the most effective work around to this problem so far is to simply use an American instead, they tend to put up a bit more of a fight than your average Artificial Idiot.
... James McGuigan on rec.games.computer.stars somewhen back in 1998 ...
Reply With Quote
  #5  
Old December 1st, 2006, 07:06 AM
HoneyBadger's Avatar

HoneyBadger HoneyBadger is offline
General
 
Join Date: Oct 2006
Posts: 3,445
Thanks: 85
Thanked 79 Times in 51 Posts
HoneyBadger is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

I don't understand AIs very well, atleast the kinds of AI that manage computer games, but I can vouch for what Arralen is saying about the use of arbitrary moves. What you don't want is the AI doing something stupid, atleast from the viewpoint of the AI (and for this purpose, you want an AI strong enough to see what the "average" person is going to see, atleast at a glance). So, if you create an AI that can eliminate the obviously stupid moves, and then narrow down the possible remaining moves to the point where whatever it does isn't going to be hideously disastrous, then a nice random choice isn't too bad. Then you start feeding it basic, general strategies that it can follow with it's simple, simple computer mind, and reference against what the player is doing, and then you leave it alone. It doesn't require a mainframe, because all you're asking from it is to put limited options into limited categories and then flip a coin. The computer doesn't bother looking at every move to the 10th place, it just looks at what's apparently bad and apparently better, and compares that to what you're doing, what the other players and AIs are doing, and makes a solid decision. People and animals operate in somewhat similar ways, which is why we call AI AI. Knowing that the world is too complex of a place to know every detail of what's going on, what's happened in the past, and what the consequences are for every action, sometimes you just have to do what you think is best, while trying to avoid hideous disasters.
__________________
You've sailed off the edge of the map--here there be badgers!
Reply With Quote
  #6  
Old December 1st, 2006, 10:44 AM

thejeff thejeff is offline
General
 
Join Date: Apr 2005
Posts: 3,327
Thanks: 4
Thanked 133 Times in 117 Posts
thejeff is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

Note that almost all the current turn processing time is battle calculation. Very little is spent on generating the AI orders. Maybe 10%?

I suspect most of the AI improvements fall more into the category of lots of programming time, rather than calculation time.

A lot of simple things could improve the AI difficulty drastically. Better pretender design being high on the list. Better use of sacred troops. (Buys expensive sacred troops, even when the pretender has no bless. Takes a bless not suited to the units. Gets a good bless and then doesn't send a priest into battle to bless the troops.) Some ability to make basic SCs.
I doubt fixing any of that would require much calculation time, just better design.
Reply With Quote
  #7  
Old December 1st, 2006, 11:26 AM

Hullu Hullu is offline
Corporal
 
Join Date: Nov 2006
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Hullu is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

The problem with AI is definitely design, not calculating time.

If time was the problem they would use multithreaded approach, I'm pretty certain of it.

You have a pretty good idea how AI works, in theory. Putting what is said in this thread into reality is EXTREMELY DIFFICULT. Creating even a semi-intelligent AI for a strategy game with any complexity is _EXTREMELY_ hard. Or, why do you think no one has yet succeeded? I can't think of a single game, no matter the budget(Civ4 had a huge one) that would be the least bit smart.

It's VERY hard to code intuition and judgement for computers, and that's what you need for strategy games. Also learning is very hard to do. It's easy to tell the computer what YOU have already learnt, but it's hard to make the computer learn from it's own experiences.

It's just, hard.
Reply With Quote
  #8  
Old December 1st, 2006, 11:28 AM
Uh-Nu-Buh's Avatar

Uh-Nu-Buh Uh-Nu-Buh is offline
Sergeant
 
Join Date: Jan 2004
Location: athens, georgia
Posts: 274
Thanks: 0
Thanked 1 Time in 1 Post
Uh-Nu-Buh is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

thejeff makes a lot of sense. Some basic decision trees need to be created, added to, and pruned based on the pretender chosen, then the race, then the enemy being attacked. It would be cool if there were some fundamental personalities as well: turtle, aggressor, 10-turn turtle then 10-turn aggressor, etc.

E.g. First decision: have 30 pre-made, effective pretenders to choose from. Second decision: based on the pretender, choose one of 5 appropriate races. Third decision: choose basic AI personality based on Pretender and race. Then move on from there.... This is drastic oversimplification, I know, but this is where it starts.

Just to throw this in the mix, OS/2 WARP was a fully multi-threaded operating system back in the dawn of time. A little game called Galactic Civilizations came out that took advantage of that multi-threading to think while the player did his turn. Award winning AI, not because it was so much more clever, but because it was so much better at brute forcing. Now, with the multi-core CPUs we have, the fully threaded OSes we have, and the librairies available, it should be easy(ier) to implement....

Finally, my own wish: I wish games would come out with a common API that allowed swappable AI modules. This would allow people to develop their own AI libraries for their favorite programming languages (perl, python, lisp, c++, forth, smalltalk, ruby, etc.), swap them with eachother, and compare code. I think this would produce a rennaissance in AI. Imagine what would happen if you didn't have to re-program path-finding for every new game. That one simple thing would speed up game development significantly. Imagine taking the AI module from your blackjack game and putting it into your chess game just to see how well it would do--the SYNERGY of LEVERAGING your Existing Infrastructure could REVOLUTIONIZE the future. But seriously, it would rock if we could do it. Instead of reinventing AI anew for every game you could mix and match. Probably the better AIs would have self-learning routines. I know I would have a lot of fun swapping an ai in and out of different games.... And messing around with basic routines in the AI modules would be cool.

Yes, I did some ai programming for a comercial game back in the 90's. It was tedious and frustrating, and I came up with a wishlist at that time that goes on and on and on....
__________________
--Uh-Nu-Buh, Fire/Death
Reply With Quote
  #9  
Old December 1st, 2006, 01:20 PM

PrinzMegaherz PrinzMegaherz is offline
Sergeant
 
Join Date: Dec 2003
Location: Würzbueg, Germany
Posts: 397
Thanks: 0
Thanked 0 Times in 0 Posts
PrinzMegaherz is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

Quote:
Arralen said:
But there's an easy solution to this:
Atm, the AI programming is still following the concepts of the '80 .. but instead of giving the AI only some seconds to "think" between the player hitting the "end turn" button and him eagerly awaiting the results of his orders, the AI(s) should do its(their) turn(s) while the player does his.

So, what if more than one player is participating in the game? The AI needs all turn files in order to calculate battles. Your idea would work for a" One player VS AI game", but not for multiplayer, which Dominions mainly is about
Reply With Quote
  #10  
Old December 1st, 2006, 04:21 PM
Arralen's Avatar

Arralen Arralen is offline
Major General
 
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
Arralen is on a distinguished road
Default Re: AI concept of the \'80ies ... why?

Quote:
PrinzMegaherz said:
So, what if more than one player is participating in the game? The AI needs all turn files in order to calculate battles. Your idea would work for a" One player VS AI game", but not for multiplayer, which Dominions mainly is about
Pardon? Where's the difference between a human and an AI player, if both do their turn at the same time?
Actually, the kind of AI I described is easier to do in Dominions than Civ or Space Empires (but IIRC both have a 'simultanious' mode now, too) - exactly because the AI does not need any player file to do it's turn.

Think you're confusing the game server (who executes the orders and computes the results) or maybe the tactical (battle) AI with the "artifical players", which I'm talking about.

And, Gandalf, if done multi-threaded those AI players wouldn't take away anything from your computers usability, because the AI threads would run with low priority (even Windoze can do that ) and would use only those CPU cycles which are not needed elsewhere.

And if you're concerned that you won't get anything done anymore - just set the calculation time for the AI higher, and it won't have its turn finished before you. And don't forget, there are still the end-of-turn calculations to do, which will take some time, too.
__________________
As for AI the most effective work around to this problem so far is to simply use an American instead, they tend to put up a bit more of a fight than your average Artificial Idiot.
... James McGuigan on rec.games.computer.stars somewhen back in 1998 ...
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 03:50 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.