Embedding Python into game engines.
Hi,
Has anyone tried embedding (maybe I''m using the wrong word) python into their game? What I mean is a fully functional Python interpreter within the engine eg. you can bring down the console and start writing some Python code and it will work as though on commandline.
Anyone think of any uses of such an implementation (beside the one I mention later)?
I just saw this being done recently and the guy said something about it speeding up development time, and I''ve been wondering since, how? It was kinda cool. He just typed some stuff in the console and he added weapons and such to a character''s left/right hand.
I don''t how you could implement this or WHY you would, (If it required gfx) do so... I would spend more time on a scripting lib instead since people could _easially_ modify you''re code.
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
I''ve haven''t done it, but I''ve thought about it, and briefly looked into ways to do it easily.
There''s a set of COM interfaces for implementing and running scripts, and there''s a port/implementation/binding for Python. If you provide a COMpliant set of objects to manipulate you''re game, then the user/scriptor has free rain of languages to use - VB Script, JScript, Python, and others... (including C/C++ and VB or even Delphi).
There''s a set of COM interfaces for implementing and running scripts, and there''s a port/implementation/binding for Python. If you provide a COMpliant set of objects to manipulate you''re game, then the user/scriptor has free rain of languages to use - VB Script, JScript, Python, and others... (including C/C++ and VB or even Delphi).
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
The Boost project has a C++/Python interoperability library.
Once there was a time when all people believed in God and the church ruled. This time is called the Dark Ages.
Once there was a time when all people believed in God and the church ruled. This time is called the Dark Ages.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote: Original post by Andrew Nguyen
I don''t how you could implement this or WHY you would, (If it required gfx) do so... I would spend more time on a scripting lib instead since people could _easially_ modify you''re code.
He''s writing an Engine... meaning the code is supposed to be modifiable. If it''s good enough for Unreal, it''s good enough for ''-=Code=-''.
I totally realize that. My only thing is WHY he would want to use Python? Mabye a modified version, but just wadding the console isn''t a good idea since Python in my opinion wouldn''t make a good scripter for games. Mabye it COULD, but remember, the only way to do so would be for PYTHON to run the game and that makes execution VERY slow (especiaally for 3d gfx).
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
A small comment:
I KNOW PYTHON BETTER THAN THE BACK OF MY HAND!
I KNOW PYTHON BETTER THAN THE BACK OF MY HAND!
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
/me has serious doubts regarding Andrew''s knowledge of any parts of his body
Once there was a time when all people believed in God and the church ruled. This time is called the Dark Ages.
Once there was a time when all people believed in God and the church ruled. This time is called the Dark Ages.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Jokes on you! I''m a cadaver with chopped off hands! (j/k)
I know how to use python very well, but, python is very hard to implement. (IMHO) You COULD USE Python to RUN the game, but then it would be extremly slow! I have experience in Python, so trust me, make you''re OWN scripting thing.
But, Python functions are based on c functions so it COULD work, but howw woould you implement the drawing of objects?
I know how to use python very well, but, python is very hard to implement. (IMHO) You COULD USE Python to RUN the game, but then it would be extremly slow! I have experience in Python, so trust me, make you''re OWN scripting thing.
But, Python functions are based on c functions so it COULD work, but howw woould you implement the drawing of objects?
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
Andrew Nguyen is a doofus. Here''s why:
The Python code, like any other scipting language embedded in a game, would make calls to functions exposed by the game engine. Ergo, the scripting language would define the game mode and maybe additional logic, but the graphics rendering, etc (which you are so hung up on) would have been pre-implemented in whatever language the engine was written in (C/C++/etc).
Before you respond to any technical questions, ask yourself if you understand the question and all its implicit information. Then shut up, because you generally have had nothing to add to these forums.
[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
The Python code, like any other scipting language embedded in a game, would make calls to functions exposed by the game engine. Ergo, the scripting language would define the game mode and maybe additional logic, but the graphics rendering, etc (which you are so hung up on) would have been pre-implemented in whatever language the engine was written in (C/C++/etc).
Before you respond to any technical questions, ask yourself if you understand the question and all its implicit information. Then shut up, because you generally have had nothing to add to these forums.
[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement