Jump to content
  • Advertisement
Sign in to follow this  
korCZis

What is best script language?

This topic is 5049 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

I am developing my own game engine for creating, editing and viewing virtual worlds. I need use script language for animation of objects, interaction with engine, state managment...and so on. I need script language which can to use c++ classes. And script language which can be embedded in c++. I would like to use python, but may i use my c++ classes in python without changing? Must be all methods (which i will to use) declared as static? If yes, then it is big restriction for me.... I know than can i use also lua, but what my classes? I will use script language without (radically or progressive) changing my code. Which language is best for embedding? Which is faster? Which is most used? Which is good documented? I know than a python is used for example used in Blender and blender can do many with python, but when i need use python in my engine must i create all classes with view of python using? Which script language do you use and why? Thank...

Share this post


Link to post
Share on other sites
Advertisement
I prefer Lua, though I do use Python quite a bit. Lua is fairly small and lightweight, and you can bind to object methods easily allowing you to use C++ classes. Look at tolua or LuaBind for tools on performing these bindings easily.

Share this post


Link to post
Share on other sites
My personal recommendation is instead of embedding Python in your C++ app, if you want Python scripting use C++ extensions. Embedding Python is quite a bit of work and C++ isn't the best glue langauge. Python will make connecting the 2 a lot easier.

I quite like using Python for scripting, it's very readable and powerful. It's kind of slow if you really need speed though. I'm currently coding my own scripting langauge for higher performance, but it's nowhere near usable so I'll just recommend Lua or Nervebreak (haven't used Nervebreak but I'm told it's fast.)

Share this post


Link to post
Share on other sites
Oh yeah, there's also GameMonkey; evolutional here at gdnet has been working on some binding stuff for it; you might want to check out his site for updates on how it's going and a download of the current version of the binder. I haven't actually played with GM for quite awhile, but I guess it's coming along rather nicely.

Share this post


Link to post
Share on other sites
Quote:
Original post by korCZis
I am developing my own game engine for creating, editing and viewing virtual worlds. I need use script language for animation of objects, interaction with engine, state managment...and so on. I need script language which can to use c++ classes. And script language which can be embedded in c++. I would like to use python, but may i use my c++ classes in python without changing? Must be all methods (which i will to use) declared as static? If yes, then it is big restriction for me.... I know than can i use also lua, but what my classes? I will use script language without (radically or progressive) changing my code. Which language is best for embedding? Which is faster? Which is most used? Which is good documented? I know than a python is used for example used in Blender and blender can do many with python, but when i need use python in my engine must i create all classes with view of python using? Which script language do you use and why? Thank...

You don't need to make all your classes with the intent of Python using them. Only those classes that you wish to export to Python.

Don't make any of your classes directly usable by Python. Use a tool like SWIG or Boost.Python to create wrappers.

This is a good idea because it means that switching to another scripting language later won't break all your classes, but only the wrappers, which you would have to redo anyway.

You wouldn't have to switch, either. You might just want to add support for another language. Python is good, but not perfect. Perhaps some parts of the program would be better scripted in Lua, Lisp, or some other language.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!