Using Python for Modular Artificial Intelligence code

Tim Auld astro at nospam.tne.net.au
Sun Apr 25 23:11:13 EDT 1999


Hi all,

I've been designing a large game project, and I want it to be easily
extensible.  It's a space combat/exploration/trade game, in the spirit of
the original Elite.  What I want to be able to do is add new units to the
game while the player is in the middle of a game that has lasted weeks (or
any arbitrary length of time) already.

I've started looking into Python as the AI scripting language for this
purpose, but I'm having trouble seeing exactly how I could do this.  I want
a message passing architecture - so one object in the game world sends a
message to another for interpretation (along with a Python tuple for the
parameters of the message perhaps).  This requires a two way interface
between my C++ code and the Python script loaded for the particular game
object.

My question is, how can I load the Python script, let my C++ object call
functions within the Python script, and provide a callback for the Python
script to call methods in the C++ object?

Thanks,
Tim

________________________
astro at tne.net.au
tim at ratbaggames.com







More information about the Python-list mailing list