By scripting here I mean not just putting config data in a script, but scripting parts of the project like some class methods, test specific game loop, etc. This would be not just to accelerate development, but also allow players to see some of these scripts to tweak some aspects of the game.

Some language like Lua have some wrappers like luabind, but when I've used it in the past it had problems because it didn't support method redefinition in a context of inheritance.

What are your suggestions of language / wrappers to use or not to use?

This question appears to be off-topic. The users who voted to close gave this specific reason:

"Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – Josh Petrie

6 Answers
6

LuaBind is great product but for me it looked too complicated. For one the code is not easy to follow where the classes and objects are. Also seeing that I wanted to integrate Lua into a wxWidgets application, using templates was a bit of a no no (you can read cross-platform issues on the wxWidgets site).

I haven't seen any benchmarks, but I haven't had any performance problems yet... my main grip so far would be that it doesn't convert between numeric types implicitly (so you get an error if you pass an int to a function taking a float, etc).
–
Riley AdamsOct 21 '10 at 19:03

About Boost, I think maybe it's a huge library and many many things are not quite useful in all projects. In fact luabind use Boost a lot and it's one of the things I didn't like.
–
Frédérick ImbeaultOct 21 '10 at 1:24

1

I would say it is an advantage. You have many many solutions out of the box. And your project has only 1 extern dependency - Boost. Not many many little libraries (that use different styles, approaches, licenses, and in turn may have extern implicit dependencies) that are hard to update, sync with your code and maintain.
–
toprightOct 21 '10 at 2:28

1

And you include only those Boost libraries (headers) that you need. Boost is huge, but you don't care until you need this or that.
–
toprightOct 21 '10 at 2:33

And about python and Lua, is there some wrappers for C++ that allow you to redefine class methods, create new methods, etc ? And is this feature can be controlled from the C++ code (for security) ? As I said, LuaBind does these things but fail in a context of inheritance, which is quite common in a game project. Methods I would like to redefined are for exemple, tests specific game loop, update methods of entities like player, update method of the game world itself, etc.
–
Frédérick ImbeaultOct 21 '10 at 11:26

Lua doesn't have classes and objects, but they can be emulated by tables. Here is a Lua library for OOP that I prefer: love2d.org/wiki/MiddleClass.
–
toprightOct 21 '10 at 13:56

If you've got time, patience and the willingness to learn - you could always try developing your own scripting engine with all the features and syntax that you need.

Advantages

You'll learn about an interesting part of Computer Science.

By developing an 'in-house' scripting engine, it gives you complete control from start to finish by allowing you to tailor the engine to exactly what you need.

If you need to make any changes later down the road, they can made somewhat easier knowing the in's and out's of your own codebase, rather than learning the in's and out's of someone elses.

You won't have to worry about keeping your engine up to date with someone else's patches.

Disadvantages

Time. Not many people have it. If you need something NOW, try an already existing engine (like one of those already suggested).

Speed. A lot of existing scripting engines are very fast - a custom solution may not be as fast.

Team Size. A lot of existing scripting engines have larger teams of people working on the codebase, whether that be private teams or global volunteers, there is something to be said for code that is checked and re-checked by many other people.

A scripting engine requires a certain amount of initial planning to pull of effectively. There is a lot of groundwork that would need to be implemented as well that may not have to do with the actual scripting engine at all.

Your playerbase/developers would have to come accustomed to your scripting engine. This may not be a problem if the syntax and functionality is nearly the same as most modern scripting engines, but just be aware of that.

This is by no means an exhaustive list. If you find yourself having to make an large amount of changes to the back-end of an existing scripting language to get the functionality you want, IMO you should probably look for another engine that fits your requirements more closely or just build your own.

I realize people enjoy throwing around "laziness" and "don't re-invent the wheel" but I think there is something to be said about learning how this stuff is done. And a specific implementation is probably going to be better for your project than a generic implementation.

You'd be surprised how far you can go with no real knowledge of those things however. Lots of MUDs have a scripting language which is little more than a list of statements with some hacks to enable conditionals, and yet they can achieve a lot with that alone.
–
KylotanOct 26 '10 at 13:17

Been there, done that. Learned a lot about parsing, compiler design, bytecode machines, all that stuff. Next time I'll probably use Lua and appreciate it all the more. :)
–
Kaz DragonOct 27 '10 at 11:04

I've tried Lua, Python, Scheme, and Squirrel. Lua worked out the best; it has a larger community and better support than Squirrel, and much better memory and performance characteristics than Python. Scheme worked really well too, and has a really tiny interpreter, but it was hard for designers to wrap their heads around a functional language.