Embedding Python into game engines.
Members - Reputation: 130
Posted 21 January 2002 - 02:40 PM
2) Crystal Space game engine has a Python scripting component, as does the Nebula Device game engine.
3) Disney''s new MMORPG ToonTown uses Python for scripting.
4) Ultima Online II was using Python as its scripting language, though the entire project has since been canned.
5) Blade of Darkness did scripting in Python
6) I''m sure there are more gaming projects, including pro projects, which use Python, but I don''t know them off hand.
7) Nobody is going to write low-level graphics routines in Python, or any other scripting language for that matter. It would be used to do game-logic, AI, that sort of thing. It can easily be made to have access to graphic objects (meshes, etc) at a high-level, move them, rotate them, etc, via calling methods, but all the heavy-lifting would be done underneath the full engine in C/C++ if you''re sane. Python is plenty fast for this type of higher-level scripting.
8) Given #7, if you don''t see how Python could be used to control graphics without having the low level graphics code itself written in Python (this means you Andrew), please stick to the beginners boards only.
9) Andrew Nguyen is an idiot. Is there any way to killfile people on this message board? If not, could it be added? I don''t fault people for ignorance, we are all ignorant on every subject until we take the time to learn it; but to be ignorant and annoying and to think you know what you''re talking about when you don''t just makes you look like a complete tool.
Posted 21 January 2002 - 04:38 PM
Original post by Andrew Nguyen
That''s C->Python, now show me Python->C for GOD''S SAKE!
Why don''t you try reading other people''s posts before posting again? Someone has already posted an example of Python calling C above:
Wrong again. You call the C functions simply by importing the extension module. For example, say I made a Python module called GSDK to provide access to the graphics engine SDK from Python. To use it in Python, I''d simply do the following:
GSDK.DrawText("This is NOT hard!"
Now shut up with your Python->C whining already.
Members - Reputation: 1110
Posted 21 January 2002 - 05:22 PM
PyObject* py; // irc connection object
PyObject* obj; // my existing python object, say an event handler
PyObject* res = PyObject_CallMethod(obj, "OnJoin", "Oss", py, sPrefix, sChans);
Members - Reputation: 150
Posted 22 January 2002 - 03:48 AM
> Hello Guido, how exactly do I call Python functions from C/C++?
One way is to pass a Python expression or statement to one of the
functions documented here:
Note that you can''t in general get a result back with these APIs.
You can also use the PyObject_Call* functions from this page:
--Guido van Rossum (home page: http://www.python.org/~guido/)