Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: AI Generally
Home

[Freeciv-Dev] Re: AI Generally

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: AI Generally
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Fri, 2 Jun 2000 11:57:57 +0200

On Fri, 02 Jun 2000, Massimo Campostrini wrote:
> "Sam BC" <sambc@xxxxxxxxxxxxxxxxxxx> writes:
> 
> > Correct me if I'm wrong, but the current code is pretty much opaque (or at
> > least only translucent) and hard to build on. Maybe after the next version
> > release it might be worth thinking about completely re-coding the AI in an
> > experimental version, even including both in source with a compile-time (or
> > run-time but the executables will be big) option.
> 
> The current AI code looked completely opaque to me as well. :-( 
> If you plan re-coding the AI, consider writing it as a client-side
> AI.  Then we can have AI tournaments!  The main (dis)advantage is
> that it can't cheat.
> 
> I don't know if anything is missing from the server to support
> client-side AIs.  As a minimum, a command to launch one or more
> client-side AIs on the server's host would be nice; maybe just
> modify "create" to accept a second optional argument:
> 
> create <player-name> <external-AI-program>
> 
> Regards,
>       Massimo Campostrini

I too agree that the AI code is opaque, though some of it work quite
well, that doesn't help if it is impossible to modify. Though I did
already "save" parts of ugly AI-related opaque code in
handle_unit_move_request() and the goto. (not accidentally the parts
needed in any case)

I also think the right war to code a new ai is to make it client side.
That would accomplish:
1) You very easily get clear of the ugly legacy AI code
2) The AI will have it's own thead, making it possible to make it use
much more CPU without completely stalling the player (the server will
currently not take new input while the AI is running). For single player
games you could just disallow the human player to move units until the AI
had finished, but he could still look around and manage cities in the mean
time.

-Thue



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