Python suitable for a game engine?

Nick Nick at p98.f112.n480.z2.fidonet.org
Thu Jul 1 17:28:32 EDT 1999


From: "Nick" <nick at NOSPAMvideosystem.co.uk>

Don't want to put the cat amongst the pigeons but Lua
(http://www.tecgraf.puc-rio.br/lua/), is a language specifically designed to
be embedded and it runs about 50-100% faster than Python and is a lot more
compact (30k or something). It has a lot of similarities syntactically as
far as I can see.

 If I was to use an embedded scripting language in a game I would use Lua
not Python. If I was to write tools for the game I would use Python.

Cheers,
Nick.



Alex Maranda <amaranda at nospam.com> wrote in message
news:377B7E17.5BD7 at nospam.com...
>> their leader is killed, etc. The events would be things such as
>> "create", "monster sees player", "clock tick", etc. All the functions
>> in the script would be callbacks written in C++, to manipulate the
>> monster to do things such as "patrol area", "play an animation",
>> "sleep for X seconds", etc. In other words, the scripts would be glue,
>> not the main thread of execution.
>you use confusing terms; I understand what you're saying, but you
>shouldn't use the word 'thread' for anything else than its OS meaning.
>You could say the 'the bulk of processing'. You might very well end up
>using real Python threads; don't forget in this case to release/reaquire
>the global interpreter lock in your C++ callbacks, if you make blocking
>syscalls (unlikely in a game).
>
>>
>> I'm been using Python for a couple of years now, and it is my favorite
>> scripting language. But, I don't have much experience with embedding
>> it in a another program, and I don't know enough about the speed
>> issues. So, my questions are...
>>
>> - Will Python be fast enough? Even with possibly 100 or 200 active
>>   items on a level?
>Unlikely. You won't know until you try. To my knowledge UnrealScript is
>eventually translated to C++.
>
>> - Especially when all of the scripts will be live, and usually in the
>>   middle of a callback?
>> - Should I use the interpreter in the library, or should I take an
>>   approach of crunching the byte-codes myself?
>??
>
>Cheers,
>--
>Alex Maranda         mailto: amaranda at spider dot com
>Spider Software Ltd. Tel: +44 (0)131 4757036
>Edinburgh, UK        http://members.xoom.com/Alex_Maranda
>STREAMS based communications protocols for embedded systems





More information about the Python-list mailing list