Using Python for Modular Artificial Intelligence code

Tim Auld astro at nospam.tne.net.au
Fri Apr 30 09:37:45 EDT 1999


>>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.
>Wouldn't you be better of using a network or distributed architecture. Use
>Corba or TCP/IP protocol to let your objects interact. Saves you the
trouble
>of language-interoperatablility and provides possibilities for multi-user
>(You're doing a LARGE game project, not?)
>
>Where do you use C++ for anyway? GUI's? Build them in Python, forget C++
>until you are done and than use C++ to speed up critical sections
>
>Ilja


This is an interesting idea, using sockets to communicate with the AI
modules, which would have
to be run in separate threads (but perhaps blocking on socket I/O to save
cycles).  I was naturally going to use sockets for multiplayer, and having
socket connections to AI modules may even generalise (and simplify) the
system further.  The reason I'm using C++ is mainly because I'm familiar
with it, and because of speed.  I'm aware that Python is relatively slow, so
I would rather use C++ as a base from the start, and save myself the trouble
of rewriting it all later.

Thanks for your help :)

Tim






More information about the Python-list mailing list