[Freeciv-Dev] Re: [RFC] Embedding Python
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Oct 06, 2001 at 09:01:25PM +0200, Lino Mastrodomenico wrote:
> 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?
Just continue. This look very promising. Maybe I should quit my job as
a maintainer and work "full time" at the agents ;) j/k. You should
take care of designing a nice object model. This isn't difficult for
the data (just copy the c structs) but functions are spread all over
common/* and you may want to assign them to other classes.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"From what I am reading Win98 and NT5.0 will be getting rid of all that
crap anyway. Seems that Microsoft has invented something called TCP/IP and
another really revolutionary concept called DNS that eliminates the
netbios crap too. All that arping from browsers is going to go away.
I also hear rumors that they are on the verge of breakthrough discoveries
called NFS, and LPD too. Given enough time and money, they might
eventually invent Unix."
-- George Bonser in linux-kernel
|
|