Hello Sveinung,

I do try at the moment to get a lua AI to work. It is not as easy as it may 
look. More information, especially about the different types of AIs you can 
find at the ticket: https://gna.org/patch/?2143

Some short comments from me:

> [...]
> 2) Access to records of played games where it can see all players at a
> level of detail that at least include the full game state and what
> actions a player does (but preferably also the time they did it). One
> way to get this is to connect in a way that will permit that
> information to be recorded. Another way to get it is to read existing
> records containing this information. (I noticed that modders using Lua
> is advised to use Freeciv's random number generator to make games
> repeatable. Does this mean that action level records exist?)

As Marko pointed out, the client interface gets to know only that a human 
player sees. Thus, all internal things are hidden. Even as observer the 
knowledge is limited. As the AI needs to know a lot of things to do the right 
thing (i.e. be a challenge for players), it needs a direct connection to the 
server.  Also, only there you can find the data you want to record.

> [...]
> Avoiding mixing C and Java could perhaps also be achieved for the AI
> interface by creating C code that connects to the Freeciv AI interface
> and then launches the Java AI and connects to it over a socket. But in
> that case the problem of what protocol to "talk" over the socket
> appears. Would it be much work (translation etc) to reuse the client
> protocol to get a hybrid solution of the client and the AI interface?
> Would the opposite hybrid, extending the client interface for AI's (so
> it at least will inform Freeciv that it is an AI), be more or less
> work than this?

You will need to define a new protocol as data structures have to be 
transferred which are not used in the communication with the client. Perhaps 
it can be an extension of the existing protocol between the server and the 

> [...]

Matthias (aka syntron)

Freeciv-dev mailing list

Reply via email to