Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2001:
[Freeciv-Dev] Re: Client AI development
Home

[Freeciv-Dev] Re: Client AI development

[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] Re: Client AI development
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 21 Apr 2001 16:21:42 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Thu, Apr 19, 2001 at 01:02:22PM +0200, Raimar Falke wrote:
> 
> 
> Cell based client structure
> ===========================

First I have to thank for all the responses.

I started implementing the stack. A basic stack consisting of a
TopCell, HistoryCell, NetworkCell and a BottomTerminator is working so
far. Working means the TopCell issues a "connect" message and sends a
"turn_done" messages for every "game_state" packet. All connectors and
every cell runs in a separate process. The communication is realized
by sockets.

There are methods implemented which transform python objects
(consisting of numbers, strings, lists, mappings and nestings thereof)
into XML and back. This round-trip transformation is loss less. Also
the pickle module (something like Java's serialization and implemented
in C) can be used interchangeable with XML. Pickle's read performance
is better by a factor of 10.

My next step is to somehow use the already written city management
agent (CMA). The CMA is written in C. The CMA by itself only loosely
depends on other freeciv code. However the method
generic_city_refresh() which the CMA uses heavily uses almost
everything (map, governments, units,...) so I don't think the CMA can
be somehow extracted and run separately. It is also not possible to
create an easy re-implementation of generic_city_refresh() because the
calculation must return the same result as the server. This leads the
an updated design (cell2.png).

There is a (only slightly modified, besides the addition of an XML
parser) freeciv client which got connected through a Splitter (both
chains can send packets to the server; the data from the server is
copied into both upwards chains). So the freeciv client is always up
to date. Advantage: you get graphical feedback for free. The
ClientCell only has to have an upward connection.

The leads to two kind of agents:

 1) - separate cell
    - probably written in a scripting language
 
 2) - included in the freeciv client
    - written in C
    - used if some kind of compliance is necessary
    - used if speed is an issue

Comments?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "When C++ is your hammer, everything looks like a thumb."
    -- Steven M. Haflich



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