Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Re: interested in building a new client-side AI
Home

[freeciv-ai] Re: interested in building a new client-side AI

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Chen <cooldc@xxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: interested in building a new client-side AI
From: Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Apr 2003 13:24:42 -0500

On Mon, Apr 21, 2003 at 05:47:34PM +0000, David Chen wrote:
> hi,
>   I am a Berkeley student working with my professor on implementing an AI 
> for freeciv.  We are interested in building a completely new AI agent that 
> knows only as much as the human player.  As I understand, the current AI 
> code is a bit messy and is attached to the server side.  Moreover, one of 
> the current goals being worked on is building a client side AI.  So I was 
> wondering how difficult it would be to build an interface for a client side 
> agent.  Since we require no omniscience, it wouldn't need any hack on the 
> server code.  If anyone can point me to the files that I need to read to 
> build a clean interface, that would be greatly appreciated.

First start from a recent CVS copy rather than 1.14.0 A _lot_ has changed
since then.

In terms of the raw interface, I suggest first looking at
common/packets.[ch] since you'd be using packets to communicate with the
server.

After that take a look at client/clinet.c to see how a client connects to
the server. Then glance at client/packhand.c to see how a client updates
it's data structures from the server.

In terms of simple automated requests from a client to server, look at
client/agents/cma_core.c:apply_result_on_server(), (Note I do not suggest
this as the sort of model you should actually use!)

For code reuse, I would look at the code in common/aicore. These are meant
to be used as basic algorithms in both the server and client. Currently
path-finding and single-city worker management are the only things there,
but perhaps we can put some more stuff in there as things become more
modularized in the server-side AI.

And please, if you're really serious about this sort of project, don't be a
stranger to the list. Many [most] of the same problems facing a client-side 
ai also face a server-ai (and vice-versa).

If you're having any problems, don't hesitate to ask. 

-mike


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