Blender Game Engine, Python and C/C++

For starters, I admit I don’t know much about the BGE (nor have I extensively learned python), beyond the very, very basics, but I am curious of one thing. Is it possible to leverage the BGE but largely code in C/C++? In other words, take SDL, OpenGL, Ogre 3D, etc… everything can be coded in C/C++, static and shared libraries can be leverged (from other open source projects such as Assimp, CEGUI, Agar, etc…). To add to that a native compile to binary gets the “optimal” execution performance.

BGE then uses python of course, which is every bit as capable of course. I’m also sure it can “wrapper” native libraries and such, but with what consequence I wonder? I can’t imagine leveraging CEGUI for example in the BGE, could it be possible? Does anyone do anything sort of / kind of like this already? If so how has the experience been?

Python interfaces very well with C and C++. You could write a C/C++ library that you compile into a Python C Extension module. The library could have some main() function as the entry point into the whole thing. Then you just create a quick script that the BGE can run and that call’s your main() function. If you want to go this route, look at the Python C API.

If you want to do hardcore coding you can do what Moguri suggested.
But that means that you need to extent the BGE code.

As the BGE is the platform for your game it is not supposed to contain any game specific code. This layer of abstraction are the logic bricks. It is the “behaviour” layer if you want to call it like that. You add the behaviour of your game here, using the API to the platform (BGE) layer.


so gamekit is what you are looking for?

it parses blend files, and supports some features ( logic bricks), though uses not python, but lua.
I think the choice was due to lua is somewhat faster, than python, but maybe they will switch to pypy once it has better C bindings ( this summer )