DISABLE THIS AD



Reply
 
Thread Tools
Old January 17, 2000, 06:53   #1
jgr
Settler
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: Jan 2000
Posts: 7
General AI
Ayup. As the latest recruit I will be looking at coding and general AI work with Mark.

This thread is for the discussion around AI implementation and modelling. I expect a degree of crossover with the military model as this sets a lot of the context. I will do my best to keep the discussions separate!
jgr is offline   Reply With Quote
Old January 17, 2000, 07:38   #2
jgr
Settler
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: Jan 2000
Posts: 7
This is a summary of the thought processes in designing an engine to implement the AI for Clash.

High level military principles for the AI will be taken from the US military doctrine manuals and can be found summarised in
several games including M1 Tank Platoon II, F22 TAW and Eastern Front II. I believe that these principles are good for any historical period.

At its most simplistic, any plan must be:

(a) directed towards a specific goal
(b) achievable
(c) sensible, unnecessary risk should be avoided
(d) follow some basic rules

There are three levels of planning and action. A grand strategic level where policies are formed to achieve
long term plans (the 100 move plan). A strategic plan will set medium term goals (the 30 move plan) and the
third level deals with immediate tactical levels.

Each level is not followed sequentially, but should be thought of as providing environment in which each set
of rules is made. Each level above provides a default for the levels below.

At the top most level, the grand strategic plan must decide on how the country will develop. It must choose
between Expansionism or Neutrality. That Neutrality may be strictly neutral as Switzerland or it could be a
more defensive neutrality like Sweden. Expansionism is furthered by
Military, Economic or Political actions. Using one of these techniques does not exclude the use of the other
means.

If possible, the same techniques and basic algorithms will be applied to all three levels.

A key point about a genetic algorithm is that it requires enough data to be able to tell whether the solutions
that it is generating are converging to "good" solutions. This means we need to know what a good solution is
in the context of planning a grand strategy. This may be a problem. How can you tell whether your grand
strategy is a good one? It seems initially that the only way of defining the grand strategy is to use heuristics
and rules.

However it would be nice to perform some sensible analysis for all levels. A possible equation for expressing
the grand strategy is an optimisation of the following factors:

(M,E,P,I)

Where:

M = military
E = economic
P = political
I = strategic factors

For the strategic and tactical evaluation we can say that the military factors expand out into:

M = (U + S + T) +C

Where

M = all military units and support
U = unit
S = supply
T = transport
C = command


I is the "sum" of the factors that can be used to evaluate the "soft" components of a solution.

I = S + W + O + T

This is virtually identical to the standard SWOT analysis used in business. It looks at the strengths,
weaknesses, opportunities, and threats of a given situation. In political or military terms we still have to do the
same kind of analysis, not just for any economic planning. How far this can be taken remains to be seen, but it
seems a reasonable start point.

For our analysis the factors are:

S = strengths, apply greatest strength against biggest threat, or if no threat, then in a way giving best advantage
W = minimise our weaknesses when viewed against their strengths
O = what are the best opportunities to exploit assuming our success
T = minimise their opportunities to exploit assuming a failure

At the tactical level the expression is a purely military one and the economic and political factors disappear, so
we are left with trying to optimise:

(M,I)

The forces involved in any planning have to obey the following constraint:

Total forces = Home defence + Foreign assignments + Trade routes + Independent units

There is a slight problem with GA when trying to apply them to the problem of assessing military planning.
For a Genetic Algorithm based solution a framework needs to be in place that restricts the solution space to
one that can be analysed for "goodness" so that the algorithm knows when it converging on a solution. The
planning required for either the strategic or tactical levels tries to bring together a relatively large number of
factors, many of which are independent. This makes it difficult to perform meaningful analysis by looking at
all the facts as a group. However, the more simplistic nature of the military problem means that it may still be
possible to do analysis effectively.

There seem to be three ways of approaching the problem. (a) The component parts of the problem are
analysed and optimised separately. (b) A two stage operation for any military planning and action can be
implemented. A set of plans are created and then analysed as a group to find the "best". (c) Alternatively,
plans can be generated and analysed on the fly and the first plan passing acceptance criteria will be used.

I think this crosses over with some of the Miltary model thinking but I needed to create some background. After a few iterations it is still not clear about the best way of implementing an AI engine, so experiment is definitely in order in this area.

I hope what I am trying to do is clear, even if the text doesn't always make sense! I tried to relate general planning issues at all levels with how these may be evaluated using a GA based solution.
jgr is offline   Reply With Quote
Old January 17, 2000, 18:49   #3
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
Jgr:

An official welcome to the forums, and the project!

Thanks for moving the ball forward on this! We also need to get you an official title, and work up a web page for the clash site. Are you interested in working up something that combines the stuff you have here, and my old page on Hierarchical AI? Either a Word document or HTML should be fine. Let me know if you're interested in doing that...

I think we also need some more introduction to this thread. Although this thread is mostly for us to talk shop on AI issues, it would be good if people who are interested but don't know the background, had a way to get up to speed. For those of you who feel like you have just jumped into the deep end, the old Hierarchical AI page may help you get your bearings.

And now on to what you say in your post.

You say that you're not sure how to evaluate the success of a long-term strategy. I think really the only way to do it is like I suggested in my old Hierarchical AI post. Even though there are dangers to playing off a proposed strategy against a bunch of guesses of opponents strategies, I don't see that we have any other good alternative. I also personally think that we will be able to get away with it, although not without a lot of work and adaptation. But if we can get a good set of heuristics, and a good very simple world model in which to play out the long-term strategies, I think we can be fairly successful. This approach also has one huge advantage to what is conventionally done with simple rules for AI in games. It can take advantage of any amount of time the player gives it. Also we can avoid the problem of population lock-in to particular sets of strategies by starting several populations from scratch, and playing the winner of each "semifinal" against each other. When the AI players save their plans from a particular session for reference, we will need to be sure to weight the fitness of plans not only by their absolute fitness against other strategies, but by their diversity.

I would characterize the grand strategic choices as much larger than simply expansionism or neutrality. But I'm sure we can fill in the gaps on that one as soon as we start work.

On the pure military problems, again I don't think it's quite as tough as you painted it. At least until you get down to the essentially tactical level of which armies moving exactly where. At the "strategic" level of which forces to operate on which fronts, I think of very simple world picture where all the armies on each front are aggregated into a big stack of military power will be able to get approximate answers in a reasonable amount of time.

I agree with you that I think most of the problems are amenable to similar Sorts of solutions, although obviously the "cartoon" of the world they are dealing with it won't be the same in any way.
Mark_Everson is offline   Reply With Quote
Old January 18, 2000, 16:12   #4
jgr
Settler
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: Jan 2000
Posts: 7
I will revisit the Hierarchical AI and pull the suggestions in there into this thread.

I find am not completely clear on how the AI will be implemented in some areas. Some areas are more amenable to computerisation than others, for example, the military action control is more mechanistic than the grand strategic planning. The former is much more suited to rules and possibly some fuzzy stuff, whilst the latter is quite hard to evaluate using any technique. The main problem with grand strategy is that you have to do a lot of guessing. (More on this later)

I reckon that your comments about the grand strategy having to be simplified and subject to heuristics is about right.

Before I start work on the military action coding for the demo it would help me to have the big picture in my head. I will take the Hierarchical AI points and generate a list of typical AI requirements within the game and how they might be approached.

I still have a problem with how best to use the GA to evaluate plans. It looks like the middle tier of planning is the most appropriate place. There may have to be some bending or simplification as well.

The examples I have seen use very specific problems, often as an equation, where you use the GA to iteratively evaluate the factors of the equation. Because you know the "answer" to the equation, you can test each generation to see how well it is doing and therefore choose the best chromosomes to generate the next generation. For the military planning you can' reduce the problem to an equation (although I made a half-assed attempt to do so) but if you bend the thinking a little I feel there may be still scope for some kind of comparative assessment.

I am going to try and break comments into threads as there are several discussions here:

How to treat grand strategy, strategic planning and tactical planning. Reevaluating plans. Modifying plans. Then there is not just the problem of how to do it, but how to implement it. 8-)
jgr is offline   Reply With Quote
Old January 18, 2000, 19:06   #5
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
John:

Let me give you a very broad-brushstroke view of how I think virtually every level in the AI can work. I believe this approach can work for everything except the top few levels of very broad overall strategy. I have specific models in mind, and/or on paper for virtually all of them, but I don't think going through the specific ones would be of value here. Here's how each level of the AI works.

1. Strategy to guide this level comes down from above
2. Rules are used to generate an alternative series of possible best ways to execute the strategy (the number tested depends on processing time). Alternative counter-strategies based on knowledge of the enemy are also formulated (we can cheat on this if absolutely necessary, although I would prefer not to)
3. As much as possible our alternative best strategies are tested against good enemy strategies. This is Not done as a simple mathematical equation, but is rather played out in a simplified world model that we think can capture is the Essence of what is important for this level. So it is through simulation, rather than calculation that I hope to capture the interaction of different strategies by competing civs.
4. At this point, if it's required that we stop, we just pick from the best indicated strategies. If there is extra time there is a large variety of things that can be done. The one that I think is most attractive, is to encode the strategies as as individuals in a population of a genetic algorithm approach. We then pursue more simulations as in 3, but while tweaking the strategies through mutation and crossover. If the rule-based approach can give us any hints as to which are the most productive things to change, the more the better. The chromosomes will not generally contain numbers at all, but contain strategic objects. "Take Berlin", "obtain alliance against the Greeks". A mutation in the strategy might be something like "it would be nice to get an alliance against the Greeks, but it isn't that essential", or "it's Imperative". I'm not sufficiently foolish to think that this approach will very frequently give an answer better than the rule-based approach. However, it has the potential to break the AI out of the rut of always doing "predictable" things.

The hierarchical AI is used to form a bucket brigade for the strategies being considered. The higher strategic thought pours down from "above" (that is the higher level models). We assume in each model that the level above knows what it's doing. Just like the Captain follows the Colonel's orders in an army. However, the Captain knows the situation on the ground, and will occasionally ring up the Colonel and ask them to reconsider if things seem especially ill-advised. When the Captain has done his calculations about how best to achieve the result assigned to him by the Colonel, he then passes his plan down to those below him in the chain of command.

I have to go in just a few minutes, so I'll just say a few other potentially useful things. There is a fairly large literature on co-evolving populations using genetic algorithms, similar to what happens in natural selection. That is the literature you need to look at, not the little toy problems were people use GAs to solve "known problems" with well-defined functional solutions.

Mark_Everson is offline   Reply With Quote
Old January 19, 2000, 15:28   #6
Kull
lifer
King
 
Local Time: 05:31
Local Date: November 21, 2009
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
jgr: We've added an "AI Model" page to the Web Site. You too now have a "home"
Kull is offline   Reply With Quote
Old January 19, 2000, 18:22   #7
jgr
Settler
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: Jan 2000
Posts: 7
Thanks, Kull, its good to have a home. 8-)

Mark, I hear what you are saying, and I agree with some of it(!)

I don't agree that any equation would be simple. It may be a simple expression, but each term could expand to be a more complicated term in its own right. I missed out a lot of summation symbols, for example!

I do agree that the hierarchy is very desirable, so that it would model a realistic chain of command. I also think that each unit should have a degree of autonomy, as well as fitting in to that chain of command.

One of the things that you do as a human player when evaluating a situation is to make plans using basic rules and Intelligence about the opposition's possible moves. These are then analysed and a "best" plan selected. This "best" plan is the one we feel is the strongest in terms of achieving the current goal, usually with the least risk. We often bring an element of our own personalities to this plan. Some prefer to take risks, others are more innovative but not risky, yet others are more predictable, etc. This is played through until it is shown to be wrong, with a capital "W", or it is successful. When simulating this behaviour with the AI, the rules bit is OK, and so is the guessing of the opposition position, because we are just applying the same rules with the enemy point of view.

The part that is more grey is how best to apply the GA approach. This seems to be best applied when carrying out the plan analysis. I originally thought that this could be achieved by ANNs but I reckon that these are too CPU intensive and they need to be trained. I feel that this poses problems for non-deterministic situations when you are trying to provide a real-time analysis.

Do you have a site reference for the GA material you are suggesting? I have only found sites which contain what I thought were fairly limited examples, so my understanding may be incomplete. From the data I have it seems to be a fact that you need to have a fairly constrained problem to solve before it works. This is patently not true when you are trying to analyse strategic problems, where you have a large number of degrees of freedom and the relationship between the different factors is loose or non-existant.


jgr is offline   Reply With Quote
Old January 20, 2000, 08:48   #8
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
Kull & Dominic:

Thanks Much!

Jgr:

I looked around a little in my bookmarks, and didn't find anything Really useful in terms of co-evolving genetic algorithm systems. I'll try and look around some more today. However, you can probably get a ways if you just do searches including coevol* and the hyphenated version. Another approach is to start at the "genetic algorithms archive" on the Web, and just look at say the descriptions that the groups use of themselves. After a little poking around I'm sure you will be able to find something.

I basically agree with everything else you said. I do want to stress that although humans may tend to appraise their strategy at relatively sparse intervals, I think we need to try and do it a little more frequently with the AI strategies. That's just because the human ones have a lot more thought in them than the AI ones will, and are less likely to be moderately disastrous IMO

[This message has been edited by Mark_Everson (edited January 20, 2000).]
Mark_Everson is offline   Reply With Quote
Old January 20, 2000, 19:28   #9
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
Here's some stuff that may be of use...
http://www.natural-selection.com/has has some relevant publications on military
strategy that can be requested by email. Follow the links to publications.
The specific papers I haven't mind are "Evolution of Intelligently
Interactive Behaviors for Simulated Forces" and Evolving Integrated
Low-Level Behaviors into Intelligently Interactive Simulated Forces".
http://www.santafe.edu/sfi/publicati...ng-papers.html has a list of a
huge number of papers published by the Santa Fe Institute.I haven't had a
chance to go through all of these, but you might look through them for
attractive appearing titles. I think all the papers are available for
download in one format or another.
http://www.cs.cmu.edu/Groups/AI/html...netic/top.html is the genetic
algorithm FAQ I was talking about before.
http://gal4.ge.uiuc.edu/cgi-bin/orde....html&cart_id= appears to have some useful stuff on parallel genetic algorithms.

[This message has been edited by Mark_Everson (edited January 20, 2000).]
Mark_Everson is offline   Reply With Quote
Old January 22, 2000, 09:37   #10
jgr
Settler
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: Jan 2000
Posts: 7
Thanks for the references Mark.

I did some digging myself and found some good, well documented, libraries at MIT and Michigan State. I am now studying the material.

jgr is offline   Reply With Quote
Old January 22, 2000, 10:25   #11
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
jgr:

Great! Sorry the stuff I came up with was of limited use . Can you keep track of some of the better links, so that they can be put on the AI page?

By the way, you may not have seen the Demo 5 call to arms. Basically I need your best guess as to what you might be able to work up within the next month that we could include. Please let me know what you think after you had a chance to reflect on it. Just look for the thread that starts with "Demo 5 Attn".
Mark_Everson is offline   Reply With Quote
Old January 22, 2000, 20:57   #12
Kull
lifer
King
 
Local Time: 05:31
Local Date: November 21, 2009
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
jgr: By all means, send me the links so I can add them to your Model page!
Kull is offline   Reply With Quote
Old June 25, 2000, 16:56   #13
TheLimey
Prince
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: May 2000
Posts: 384
I posted this in the CtP2 Suggestions forum, but I believe it might have some value here... although certain concepts are applicable, since the game is partially strategic and partially tactical.

I do hope you look to go with a fuzzy logic scripting system, interpreted as hints by the actual AI code. It worked very well in CtP1, although they didn't go far enough.

===

While I do understand some of the underlying principals of AI design, I guess what I know in a total way is very minimal indeed. I have nothing but respect for a good AI, and its programmer, for this reason.

As far as I tell, the CtP1 AI was a form of list processing. The AIP and FLI files were the parsed files that were conditionally processed, producing weighted answers as to what should happen. The results were
‘hints’ to the games AI dll, as to what should be done.

There are two main challenges that the new AI has to meet.

First is its obligation to pose as an effective threat to the player, by doing three things militarily; first building good stacks, second put those stacks on transport, or many transports (and reconstitute the stack at the other end) and lastly attack with those stacks. The only way that the AI was TRULY effective (at least overseas) was as a nuisance, by employing special unit attacks. The reason for this, is that one special unit can be effective. However, grouping was never a thing it did very well at.

Secondly, newly created units (created by scenario designers) might have a very tough time, since they, unless some thought is put into AI behavior, will be unused by the computer. This ultimately means that certain scenario units could be unnecessarily unbalancing. The way to solve this, of course, is to have enough groupings of behavior where the new units could fit in. Behavior can generally be defined as movement and attack, since you can ‘preempt’ combat and do something ‘clever’ in SLIC or do something during or after movement.

There was the concept of grouping units by type and them having behaviors, in CtP1.

The problem is… that there were not enough groupings for customizing, and the way the units were described was by static tokens… yes?

The archetypal new custom unit in CtP1, which was employable by the user, but not the AI was the cruise missile. It was one shot, offensive… preferably against towns… or carriers, so it should be grouped for best effect, unlike a nuke. Perhaps carried by subs or ships…(not carriers), and not travelling on its own, except to get into position.

The defensive version of this, which I would like to have seen, though for technical reasons (lack of size classes,) it was impossible, is the Anti Aircraft Missile. A one-shot ship or land-carried unit, that would be used in response to threats within its range radius. Of course, certain people might say… this is too specific. Civ is all about abstraction. However, scenario designers should be given freedom to express their ideas in a flexible product. That is ultimately what the culmination of “Civ” should be.

These are two examples, but I can imagine another… a non-attacking, non-settling unit; one that either explores new sea or land territory, or wanders already discovered land or sea, in settled or unsettled regions. With SLIC, these movement patterns could be put to use, in ways that we don’t know now, but I’m certain will have great use later.

The extra or replacement AI unit classes that I am suggesting are:

SINGLE_SHOT_LAND_OFF
SINGLE_SHOT_SEA_OFF
SINGLE_SHOT_AIR_OFF
SINGLE_SHOT_TERROR (nuke)
SINGLE_SHOT_LAND_DEF
SINGLE_SHOT_SEA_DEF
SINGLE_SHOT_AIR_DEF
POWER_PROJECTION_SEA (the carrier, and sub?)
POWER_PROJECTION_AIR (nuclear strike aircraft)
POWER_PROJECTION_LAND (for completeness?)
WANDERER_LAND_EXPLORED_SETTLED
WANDERER_LAND_EXPLORED_UNSETTLED
WANDERER_SEA_EXPLORED_SETTLED
WANDERER_SEA_EXPLORED_UNSETTLED
WANDERER_AIR_EXPLORED_SETTLED
WANDERER_AIR_EXPLORED_UNSETTLED
WANDERER_LAND_UNEXPLORED
WANDERER_SEA_UNEXPLORED
WANDERER_AIR_UNEXPLORED

The problem of the static tokens in the AI file has to be remedied by moving their specification to where the units are defined; units.txt. I understand this is yet another line and flag to be added, and parsed. You could do vertical partitioning of the data, and split the property into another file… something like unitAIdef.txt or whatever. However, its important that if you want to have a customizable game, that you allow specification of a unit as within an AI behavior group.

The next thing to consider is how you want to define the organization of these units. Ultimately what you want to achieve is , say, a number of stacks; some bombard stacks with, for instance, a couple of attackers, and ranged units, and 5 bombard units (this stack would soften up targets for the assault) and some general purpose stacks with 4 strong and resilient attackers and 5 ranged attackers, to attack or perform defense within the empire, and some appropriate defensive stacks for cities. Sea stacks, air stacks and wanderer escort stacks would be yet another case.

You could define the proportions that you would like to see for each AI behavior pattern (aggressive, defensive etc.) and those would be scaled up or down as resources permitted into ‘build plans’ which the AI could carry out, still taking into effect ‘social’ building.

You might set up a text file that was parsed, with ‘descriptions’ of stacks… with incremental sizes and priorities… I.E.

Stack Defensive_Cities 255(all cities… not literatally 255) 10000 (priority)
{
Defensive_Land 1
Ranged_Land 1
}

Stack Offensive_Land_Stack 1 (a single stack to attack is the second priority) 5000 (priority)
{
Offensive_Land 1
Ranged_Land 1
}

Stack Defensive_Cities 255 1000 (third priority is a larger defensive force)
{
Defensive_Land 2
Ranged_Land 2
}

Stack Offensive_Land_Stack 1 (still single stack) 500
{
Offensive_Land 2
Ranged_Land 3
Slaver_Special 1
}

Stack Bombard_Land_Stack 1 450
{
Offensive_Land 2
Bombard_Land 2
}

AND SO ON, AND SO FORTH…


When a priority is met, you can move down the list

Lastly, stacks need to be treated as homogeneous entities in their own right, by the AI; they need to be regrouped after being split up to move past a city or across an ocean in small boats, and re-supplied with reinforcements after being damaged in battle. As new cities are added… perhaps parts of the attacking stack should be split off to constitute a new garrison.

TheLimey is offline   Reply With Quote
Old June 25, 2000, 19:16   #14
roquijad
Prince
 
Local Time: 12:31
Local Date: November 21, 2009
Join Date: Nov 1999
Location: Santiago
Posts: 383
Hi TheLimey,

I only want you to know Mark will be on vacations (and out of the forums) for the next two weeks, so maybe you won't find a reply to your post until then...

Rodrigo
roquijad is offline   Reply With Quote
Old July 6, 2000, 14:37   #15
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
TheLimey:

I think some of these suggestions are certainly appropriate to Clash. Currenly we're far from this level of detail, but the ideas should be here when we get down to active work on the AI and Macro/Scripting language stuff.

Any comments on the specific models? Military, Econ, etc.? External feedback is useful since we're sometimes a fairly small group discussing each area . If you're interested the web site is the best place to start.
Mark_Everson is offline   Reply With Quote
Old September 9, 2000, 23:18   #16
Richard Bruns
King
 
Local Time: 13:31
Local Date: November 21, 2009
Join Date: Nov 1999
Location: NC, USA
Posts: 1,579
I had an interesting idea for the AI. Obviously I don't know about the programming side, but I am intrigued by the concept so I thought I'd put it out for comments.

Humans learn and adapt. They develop new strategies and figure out how to use old ones in a more effective manner. This means that any ststic AI we build will seem more and more incompetent over time, as the humans get better.

I read in the old AI threads that the tactical and operational AI's were coming along fairly well, but that there were no good plans for the grand strategy AI. It seems that we will have to use heuristics for that section, which means the strategy could easily go obsolete.

In the past, many attempts have been made to make an AI that reacts to the human strategy. They usually don't work, because the human mind is far better at innovation and grand strategy.

Could we make an AI that simply copied the player's strategy if it saw that the that strategy was more effective than anything in its toolbox? That way, a brilliant and super-effective new plan discivered by the player would also be used by the AI, so the AI wouldn't be helpless against that plan in the future. This copycat AI would basically let the human do the thinking for it.

If the player then developed a strategy that killed the new system the AI was using, then the AI could just start using that. Eventually, the AI could start building up a memory that told it which strategy worked best against the other strategies.

Now, this by itself is pretty boring. My big idea was this: Have the AI's share memory files with all of the other AI's whenever the computers are linked to form a multiplayer game. There should be plenty of free time when the players are planning their moves.

This way, the AI learns the best strategies used by anyone connected to the game. It also has the files from anyone who has played a game with any of those people, and anyone who has played with those people, et cetera. If there is enough file sharing, the AI would have access to all of the best strategies used by the best human players on the web.

And if we do a good job, the AI will know exactly when to use the strategies. It would simply memorize the situations that the humans use the strategies in. It would build a decision grid, so if it sensed that the human was using a certain strategy it would search its ever-growing library of strategies and pick the one best able to counter the human.

It seems to me that most of this could be done using simple if-then-else commands. The hardest part would be analyzing which strategy the human was using, but it should just be a matter of recording what the player is doing and matching that with attributes of strategies it has memorized. And if the human's actions do not match any prerecorded strategies, it knows that the human is doing something new enough to be recorded as a seperate strategy.

If this system works, it will produce an AI that is always able to match or even exceed the strategic abilities of human players. And the best part is that we shouldn't have to code any strategies. The AI should learn the basics from our playtesting.

Then there is the issue of the AI in scenarios. In most games, the AI in heavily modified scenarios is worse than the general game AI because it didn't have any rules for dealing with the new situations. But this system would let the AI learn how to deal with any scenario, no matter how weird it was. It would simply see how the human solved the problems. The scenario designer would get a few people to play every side in the scenario, and by the time they were done playtesting the AI would be as competent as the humans.

It seems to me that effort spent making the "copycat and communicate" system work will give better results than eforts spent teaching it a certain strategy. Teaching something how to learn gives better results than teching it a certain thing.

Is there a chance that this will work, or is it just a silly dream?
Richard Bruns is offline   Reply With Quote
Old September 9, 2000, 23:36   #17
Lord God Jinnai
King
 
Lord God Jinnai's Avatar
 
Local Time: 06:31
Local Date: November 21, 2009
Join Date: Sep 1999
Location: St. Louis
Posts: 1,012
I don't know if its possible, but if it is, it should be stored on the HD, but it could get quite large after a while. It would need to be stored there for future use, just like a human remembers past stategies that worked and didn't.
Lord God Jinnai is offline   Reply With Quote
Old September 9, 2000, 23:45   #18
Richard Bruns
King
 
Local Time: 13:31
Local Date: November 21, 2009
Join Date: Nov 1999
Location: NC, USA
Posts: 1,579
Yes, it would be put on the hard drive and saved permanently. If search times or disk space became a problem for some reason, the computer could delete the worst strategies.

I forgot to say that the entire file wouldn't have to be transferred. Each strategy and its associated use guidelines could be marked with a tag. The computers would compare their tag lists and only swap strategies the other computer didn't already have.

Richard Bruns is offline   Reply With Quote
Old September 11, 2000, 22:37   #19
Mark_Everson
 
Mark_Everson's Avatar
 
Local Time: 08:31
Local Date: November 21, 2009
Join Date: Dec 1969
Location: Canton, MI
Posts: 3,442
Hi Richard:

You're completely correct about the defects of a static AI. Even the idea that you say is "pretty boring" on having the AI adapt to use the player's strategy is cutting-edge AI! I have some ideas for how to do something like this, but only at a kludgy level. What you have in mind is Extremely difficult to do since the AI has to be smart enough to realize what the critical different things that the player is doing that result in them winning. This is like finding a needle in haystack, an exponentially large haystack. Just think a little bit about the complexity of knowing what the critical strategy is, and the situations in which it should be used, and I think you can see why even current processing power is not up to it. When we get to the year 2030 or so and computers are as complex as the human brain (providing Moore's Law keeps going) then there would be some hope of achieving what you are shooting for. If we figure out how to do even the "pretty boring" part the game will be Vastly better than everything on the market. So I will defer worrying about how to hook up different AIs so they can collaborate and swap "war stories" until we get somewhere near that point.

Gaming AI is a really fun topic, and if you are interested in that I encourage you to poke around the Web reading about it.
Mark_Everson is offline   Reply With Quote
Old September 11, 2000, 23:05   #20
Richard Bruns
King
 
Local Time: 13:31
Local Date: November 21, 2009
Join Date: Nov 1999
Location: NC, USA
Posts: 1,579
It seems to me that some things would be obvious enough for the AI to grasp. For example, consider the Infinite City Sleaze tactic in Civ 2. How much analysis does it take for the AI to see that the player is building lots of little cities, putting no improvements in them, keeping them at size 2 by building settlers, and using those settlers to expand more? It is a very simple heuristic plan that the designers could have put in the AI if they had thought about it.

An analysis of game logs would quickly show the pattern. The AI could see the build order in each city and the actions of the settlers. It would realize that it got beat, so next game it would copy that build order. No real analysis is required; it simply apes a superior. Even a poorly implemented and misguided ICS attempt by the AI would probably give better results than what the AI currently does.

Of course, it could be that Clash will be too complex for that sort of analysis. Still, the difference between total war and perfectionist buildup should be obvious. I am assuming that the AI knows the difference between the grand strategy, tactical and mid-level decision processes. I thought it was able to ignore decisions made at lower levels, and analyze the player's decisions as follows:

1) Player aggressively expands civ.
2) Player invests mostly in infrastructure.
3) Player switches to free market, resulting in fast tech growth.
4) After discovering gunpowder, player immediately switches to command economy and begins total war.

Basically, I thought the AI could ignore administrative details and figure out the basic player grand strategy. If it can't do this, then of course my ideas won't work at all.
Richard Bruns is offline   Reply With Quote
Old September 12, 2000, 08:49   #21
Lord God Jinnai
King
 
Lord God Jinnai's Avatar
 
Local Time: 06:31
Local Date: November 21, 2009
Join Date: Sep 1999
Location: St. Louis
Posts: 1,012
Although important, I think we should wait on worrying what to do with the AI for the most part (mainly what Mark doesn't know since he seems to be the only one here who understands how it works well) and perhaps post an advertisement for knowledgeable AI programers and/or resources.
Lord God Jinnai is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

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 08:31.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © Robert Plomp and Jeroen Schweitzer