Re:I Am Worried About The Future Of Python
by saucetenuto on Monday September 24, 2012 @10:24AM
(#4564812)
You can, but I've been told that integrating Python is a lot more involved than integrating Lua. People who've done it mostly seem to complain about (a) the relative complexity of Python's object model, and (b) how obnoxious it is to maintain reference counts efficiently.
I've done both, and neither seemed all that difficult, but then again our scripting requirements were pretty primitive.
> is it not possible to just have a python interpreter running in your game engine and only running vanilla Python code?
Sure, but it means much bigger swaths of C/C++ code and your game app is no longer a python program that imports some extension modules for performance critical tasks or third party lib bindings.
That's how we've done it before with LUA and other scripting languages in game dev. You don't expose anything low level to the gameplay scripting beyond simple primitives. You certainly don't touch anything to do with OpenGL - even the C++ game code rarely goes that deep.