Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Exellon

Embedding the Python Interpreter in Games

This topic is 5811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
quote:
Original post by Exellon
Is this possible, or would it even work? Would it be beneficial?


Depends, depends, depends.

It would help to know which language you''re willing to embed Python into, how and what for, and what you''re expecting to do with it.

Python can be embedded, but wasn''t meant to be. It means it is not the easiest interpreter to embed (nor the hardest one, for that matter). Now if all you''re willing to do is run Python scripts from your C program, it''s very easy. If you need both languages to interact, it gets tougher. If you want to map C++ classes to Python objects, it becomes quite harder.

Hope this helps.

Share this post


Link to post
Share on other sites
Well can anybody think of a language that would be easy to embed with C++ and interoperate with C++ classes?

Share this post


Link to post
Share on other sites
http://www.lua.org , combined with SWIG or any of the other binding generators.



Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
I''ve been playing around with Simkin on a simple game project in my spare time. It is really easy to make an object sciptable. It''s not perfect, but I had it hooked up to a gameobject and was controlling it through scripts in short time.

You have to email to Simon with a request for Simkin - but you get the source and all - you can''t beat it.

Dave "Dak Lozar" Loeser

Share this post


Link to post
Share on other sites
quote:
Original post by blueEbola
You can consider LUA (its the easiest to embed I''ve ever seen), but its not object oriented.

But it can simulate object-orientation quite easily, and ends up looking very similar to Python or java-script. Which is nice. You just have to have some discipline when using it.



[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
quote:
Original post by Kylotan
But it can simulate object-orientation quite easily, and ends up looking very similar to Python or java-script. Which is nice. You just have to have some discipline when using it.



Yeah, I've actually done something like that before when I was giving LUA a test drive. The resulting object constructor isn't that pretty though

LUA is very extensive, using its tag methods you can simulate operator overloading on an object (table).



[edited by - blueEbola on August 17, 2002 5:58:21 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!