Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1998:
[Freeciv-Dev] External AI client
Home

[Freeciv-Dev] External AI client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: FreeCiv Development List <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] External AI client
From: David J Porter <porterd@xxxxxxxxxxxxxxx>
Date: Tue, 03 Nov 1998 14:21:20 +1300
Reply-to: Porterd@xxxxxxxxxxxxxxx

[What follows is a stream-of-conciousness', but it still seems to make as much
sense as it did at 2am this morning ;-).  Anyway, its simply designed to inform
you all what I'm doing and hopefully get some feedback to prod me in the right
direction.  All comments, flames, cash gifts welcome.]

There's been a lot of talk about the 'strength' of the current AI during the
last while, and I've been thinking about it quite a bit lately myself although
my approach is a bit different to the existing code.

I've begun work on an _external_ AI client, well I've at least hacked out a
framework to support it based on the existing client code.  At present the 'AI'
in the AI client consists of pressing the 'Turn Done' button.  But at least it
connects to the server and behaves itself properly.

Having an external AI client brings with it a host of problems that are not
present with the current arrangement.  None of these are unsurmountable IMHO,
and there are a few nice benefits gained.  It also allows me to play with the AI
without having to have too deep an understanding of the server.  All I have to
be is ensure that messages from the server are handled correctly, and that I
produce only well formed messages in return.  Most of the hard work is already
done in the existing client.  (As a side issue, a standardised AI Programming
Interface [AIPI?] could be a handy spin-off!)

Also, I'm looking to implement a system of 'personality' defined on a per-client
basis for the AI.  This would take the form of simple attribute/value pairs
passed to the AI client when it is started.  If anyone remembers the game
'Nations at War II', then you'll have some idea of how I envision this working. 
Since this personality system would be so integral to the whole AI, if I'm going
to use it it would need to be defined early in the development process and as
fully as possible.

Each attribute would take on a value between arbitrary limits (say, -100 thru
100 [that's interger values not reals]) that are used as a weighting to AI's
decision making process.  Zero (0) would denote the neutral or balance point.

I'm aiming for a system where all attributes set to zero would duplicate the
behaviour of the 'normal' AI as it is currently implemented, although I don't at
present know if this is achieveable or even desirable.

For an attribute of 'expansionism' for example, a value of 0 would mean that the
empire would expand (i.e. found new cities) if there is uncontended land
available and there are no more pressing problems.  If the value were 100, then
cities would be founded at any cost.  A value of -100 would see cities founded
only as a lowest priority.  (Note: this example is contrived and it is nearly
impossible to describe the action of a single attribute without regard to other
attributes.  Since I'm not sure what attributes to use, or indeed, how many
attributes should be used I'm not even sure what interactions there will/should
be.)

QUESTIONS:

1] Does there need to be a protocol whereby an AI client needs to declare 
   itself to the server and through it to the human players in a particular 
   game?

2] Should all AI clients be run on the same machine as the server? (Or at least 
   restricted to some known server machine?)

3] Should human players be allowed to spawn AI clients, or soley connect an AI 
   client?  (The latter may be useful for developing the AI algorithms, or even 
   in the case where games are run solely for the purpose of AI versus AI 
   battles in the FreeCiv 'arena'.)

4] Would/Should it be possible for the server to spawn AI clients on a players 
   machine?  On willing players machines?

5] What attributes should be definable, and what would their semantics be?
   (Expansionism, Military Posture, Diplomatic Posture, etc.)

6] Am I overlooking any obvious problems with having external clients for the 
   AI?  (AFAIK the only difference will be that the AI code will be executing 
   at the same time as the server and while the player is making there moves.  
   This may hit the CPU a bit harder than at present, but 'end of turn' 
   processing should be a bit quicker.)

-- 
Mathematics is the only science where one never knows what 
one is talking about nor whether what is said is true.
                                       -- Bertrand Russell



[Prev in Thread] Current Thread [Next in Thread]