From: astro at nospam.tne.net.au (Tim Auld)
Date: Mon, 26 Apr 1999 12:41:13 +0930
Subject: Using Python for Modular Artificial Intelligence code
Message-ID: <newscache$bu0saf$a8n$1@news.tne.net.au>
Content-Length: 1064
X-UID: 708                                                  

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







