Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [RFC] Embedding Python
Home

[Freeciv-Dev] Re: [RFC] Embedding Python

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-dev ML <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC] Embedding Python
From: Lino Mastrodomenico <mastro@xxxxxxxxxx>
Date: Sat, 6 Oct 2001 21:01:25 +0200

Raimar Falke wrote:
[...]
> Very nice. My main problem is that it runs at the server which is IMHO
> only needed for dynamic scenarios. Running user AIs or user agents
> in/at the server should be done in a seperate process at the
> server. This gives the same interface for the ai/agents and disallow
> cheating.
>
> Another point is that the number of things which are accessible from
> the python side is just to small ;)
>
> What is your plan? What are your next steps?

I have moved script.c from server/ to common/ and embedded the python in both 
server & client.

A snapshot of my tree is attached (after applying the patch remember to run:
automake && autoheader && autoconf && ./configure --with-python).

Now I'll add:

  * support for server commands;
    e.g.:
      game.xsize = 40 # from the client this will send a "/set xsize 40"
      game.start()

  * mirror more things from c;
    e.g.:
      for player in game.players:
          print player.name
      for unit in game.player_ptr.units:
          if unit.moves_left:
              unit.move(NORTH)

  * more callbacks.

In the medium term a client without gui can be useful for running client AIs, 
but the code can already run separate python threads in the server (or in the 
standard clients).

I'll probably try to add support for tcl (because it's simple to embed) and 
happily accept patches for perl, java, guile (because they are populars ;-)).
Probably it will be possible to freely mix modules in different languages.

Comments?

ciao

-- 
Lino Mastrodomenico
E-mail: mastro@xxxxxxxxxx

Attachment: script-v2.diff.gz
Description: GNU Zip compressed data


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