Jump to content
  • Advertisement
Sign in to follow this  
knutaldrin

Scripting speed?

This topic is 4029 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've thought some more about having a scripting language implemented in my game engine. I first thought Python would be a good idea, but it's nasty C API is a serious drawback... Although Boost.Python makes extending easier, but not embedding. I've discovered several languages, like AngelScript, GameMonkey, and Squirrel. GameMonkey, I believe, is used in the Omni-Bot library for Q3 games. Anyway, the question is, does anyone have any comparison or speed test on AngelScript Vs. LUA Vs. Squirrel Vs. GameMonkey Vs. Python?

Share this post


Link to post
Share on other sites
Advertisement
I dont have any information on speed, but in my own experience, Lua is a brilliant scripting language to use. You dont have to take my word for it, Lua is used in many commercial games. The only real problem with the language, is that it does not support C++, but that can be fixed via LuaBind.

Share this post


Link to post
Share on other sites
You don't typically care about speed for a scripting language, because the stuff that needs to be fast is not scripted. What you do often care about is memory use, though. In that respect, Python is probably the heaviest, and Lua is probably the lightest, with Squirrel being close. (All guessing here.)

Share this post


Link to post
Share on other sites
Yeh, when I mean "speed", I mean memory footprint, and of course how fast it really executes. Of course the things that need speed aren't scripted, but I'd still like the scripting to go as fast as possible. But, yes, memory footprint is more important.

What you mean, is that I should use LUA?

[Edited by - knutaldrin on July 9, 2007 4:14:12 AM]

Share this post


Link to post
Share on other sites
Quote:

Although Boost.Python makes extending easier, but not embedding.


Embedding has never been difficult with Python :
Calling Py_Initialize(), PyRun_SimpleString(), and Py_Finalize() is enough for basic embedding.
More complex embedding is hardly harder, and the documentation is quite good on this point.

Extending is another beast !!

Emmanuel

Share this post


Link to post
Share on other sites
Well, also, in addition to just running a string, I'd love to use files, as well as loading the files as a library kinda... Yes, I know I can just read the file, and use it as a param in PyRun_SimpleString()... I have gotten that to work, but it's simply too heavy...

Share this post


Link to post
Share on other sites
Quote:
Original post by knutaldrin
Well, also, in addition to just running a string, I'd love to use files, as well as loading the files as a library kinda... Yes, I know I can just read the file, and use it as a param in PyRun_SimpleString()... I have gotten that to work, but it's simply too heavy...


May I ask what you mean by too heavy?
Have you also tried PyRun_File?

Share this post


Link to post
Share on other sites
I think I might have decided on Squirrel: I like it's syntax, it's fast, and fairly easy to implement.

If anyone has any experienes with Squirrel, care to share them? :)

Share this post


Link to post
Share on other sites
Really you should evaluate each scripting language to see what fits your needs/wants, no one can tell you what language to use as they all have different strengths and weaknesses.

For my part, I personally like Lua, even more now that I've found out how easy it is to sandbox scripts/modules o.O (see journal...)

Share this post


Link to post
Share on other sites
Quote:
Original post by knutaldrin
Well, also, in addition to just running a string, I'd love to use files, as well as loading the files as a library kinda... Yes, I know I can just read the file, and use it as a param in PyRun_SimpleString()... I have gotten that to work, but it's simply too heavy...


The real stuff is explained here, and is quite easy :
http://www.python.org/doc/ext/pure-embedding.html

But nothing prevent you to use simple string like this :


PyRun_SimpleString("import MyStartingFile");
PyRun_SimpleString("MyStartingFile.MyStartingFunction()");


And do all your stuff in your 'MyStartingFile' python file...


Emmanuel

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!