Jump to content
  • Advertisement
Sign in to follow this  
Richy2k

Integrating scripting into an application...

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

First off, have many people used Ruby for scripting in a game before? It was suggested to me to try out by a friend, and it was a choice between Ruby, Python or Lua. Haven't used any of the three myself, but scripting is a definate must for my game, will pretty much simplify writing the game itself. Anyways, how easy is it to actually integrate Ruby, Python, whatever into a game engine? For example, say in Ruby I want to access functions within my game, how would I go about giving Ruby access to calls within my engine? Such as having a function to add a model to the render list, or having a class to control the camera? Also, what advantages are there of using scripting instead of having an external DLL to the engine to control and coordinate everything? Sorry for the n00bishness here, this is the first time i've looked at scripting.

Share this post


Link to post
Share on other sites
Advertisement
Hi there!
I am in the same situation as you are. I need to integrate a some kind of scripting language into my game. However, i have choosen Python. Still i haven't implemented it in my game, but using python scripts is pure fun. You just simple do the same things as in C++ but in much much fewer lines.
Now about the integration, i have heard that Python integration is harder than Lua. Also i have heard that Python is more powerfull scripting lanuage.
(Havent heard alot about Ruby)
Quote:

Also, what advantages are there of using scripting instead of having an external DLL to the engine to control and coordinate everything?

Well, the advantage is that you dont need to use C\C++ to code your AI,game logic,whatever..., you can use scripting language, which is more suited for such tasks.
Also you dont have to recompile your exe each time you change something.

Share this post


Link to post
Share on other sites
I can't speak about Ruby, but getting the project settings just right to embed Python can be annoying, but isn't actually difficult. Actually exposing things to Python is straightforward using boost::python, assuming that the C++ code you wish to expost to Python is sane. With boost::python you can usually just build Python bindings that closely resemble the C++ class/function interfaces.

The primary advantage of a scripting language is being ablt to modify the runtime behavior of your application without recompilation. This can include entering commands at a console or just modifying the behavior of a subsystem, such as how AI reacts without needing to go and recompile your application or DLL.

Share this post


Link to post
Share on other sites
I'd go with Lua as a first script language. Dead simple to use and integrate. If you are experienced it is an afternoon worths of work to get it integrated.

Python, well, that is a matter of religion... needless to say I am an agnostic of the Python faith.

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!