Page 1 of 1

Choosing the correct wrapping method?

Posted: Wed Sep 13, 2006 11:28 pm
by cypher543
Ok, I'm working on a new Linux FPS, but my C++ skills aren't all that great. I love Python, though. But, I can't decide which path to take...

[1] Use SWIG to write Irrlicht code in Python
[2] Write the game in C++ and use SWIG to make Python the scripting language

Either way, I must have a scripting engine. [2] would be the easiest for this. But, like I said, my C++ skills are crap. [1] is the easiest for the actual game programming, but I would have to write my own interpreter and VM for the scripting (I'm assuming I can't use SWIG to expose Python functions to Ruby/Lua).

So, which path should I take? (please don't try and suggest any languages other than C++ or Python)

Posted: Thu Sep 14, 2006 11:46 am
by stodge
Use Lua. No just kidding!

The optimal solution would be to write the "main loop" in C++ for speed, and the game logic in Python. Writing Python bindings for Irrlicht is a lot of work, and is probably a waste of time. Create game related objects in C++ and write bindings for those. If you want to see how much work is involved in writing bindings for Irrlicht, look at PyOGRE, the Python bindings for OGRE3D. It's a lot of work....

Re: Choosing the correct wrapping method?

Posted: Fri Sep 15, 2006 6:59 am
by pinballwizard
cypher543 wrote:Ok, I'm working on a new Linux FPS, but my C++ skills aren't all that great. I love Python, though.
There is Venom, the Python "binding" for Irrlicht. It's actually not a 1-to-1 API binding but is instead a kind of higher-level C++ framework that exposes some functions to Python. It's not supported anymore, but it seemed to work well last time I looked. Search the forum for more info.

The other possibility is to use Jython, which is a Python interpreter written in Java, and make calls to Jirr, the Java binding for Irrlicht. I basically got this to work (except for some Jirr glitches on Linux), so it's doable, but it may be slow because of the 2 language layers involved (Jython-to-Java and Java-to-C++).