• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
_Silence_

Robsut C++ bound scripting language

7 posts in this topic

Hello.

I am now looking for a good scripting language to use within C++ which will replace the current one (luabind).

Now I will explain why I want to change luabind.
First I like the lua syntax, and the fact it is quite easy to interface it with my development. It is also appreciable to use a scripting language widly adopted in the world.
But I am now fed up with it for these reasons: each time there's a new version of luabind I have many problems with my development: compilation issues, linking issues and running issues (segmentation fault, not running...). For example the last time I could plainly use my program (which uses luabind) was on april. All the next releases I had broken things (out of my concern). It is also worth to add that there are other bad points with using luabind. One of them is that it is not that easy to write object-oriented scripts with it (for example I often have to use temporary variables between commands so that the script works). But I can live with that.

I know there are other C++ bounds from lua (cf [url="http://lua-users.org/wiki/BindingCodeToLua"]http://lua-users.org...indingCodeToLua[/url]) but I would like to avoid to have to try them all, mainly if I will encounter the same experiment than I did with luabind.

What I am looking for should not necessary binds the lua language. I am also opened to python. However my last attempt to use python was a disaster, mainly because of the bjam thing which I didn't succeed to make it work (if you know how to manage this, feel free to propose python).

So, to resume this all, I am looking for a good program (library for example) that can easily interface with a scripting language like lua or python, and offers object oriented capabilities (I want to be able to easily use my C++ objects inside the scripts). And most importantly, I want something that won't be broken each times there's an update (I use Linux/Debian Testing, so updates could happen quite frequently), and something I can easily, and bug-freely migrate to other Linux, Windows (and later Apple) machines without having harms because of incompabilities due to versions/systems...

I hope you could help me find the rare pearl.

Thanks for the read.
0

Share this post


Link to post
Share on other sites
It's not what you're looking for, but you could consider manually writing your Lua API, instead of using a library to automate it. The author of the BitSquid engine tries to justify this approach by arguing that you'll end up with a more Lua-centric API if you do it this way:[quote name='NiklasFrykholm'][size=2]we actually write all our Lua bindings by hand (i.e., explicit int do_something(lua_State *L) functions).[/size]
[size=2]It is just a few lines of code for each function you bind, so it doesn't take much time and I find that being deliberate about what you export to Lua and how leads to better Lua APIs -- smaller, simpler and more Lua-style than C-style. It also means we can refactor the C code without affecting the Lua API.[/size]
[size=2]I used to do automatic Lua bindings in the past (with template matching), but I like this approach a lot better.[/size]
[size=2]We export most C objects as lightuserdata, to minimize the load on the garbage collector. This means that our C++ classes become more like "modules" in Lua -- tables grouping functions. So, you can't actually call unit:set_position(...) in our Lua API, you have to call Unit.set_position(unit,...)[/size][/quote][quote name='dAgeCKo' timestamp='1344770249' post='4968685']And most importantly, I want something that won't be broken each times there's an update (I use Linux/Debian Testing, [b]so updates could happen quite frequently[/b])[/quote]Does this mean that you have no control over when updates to your dependencies occur, or which version you're compiling against? If so, that's a huge red flag and is really unprofessional -- e.g. a QA department couldn't even begin to validate your game if you can't control what code is being included in a build. You [i]need[/i] to have full control over your dependencies. I'd sort this out before rejecting libraries based on this fault.
1

Share this post


Link to post
Share on other sites
Hello,

first of all, thanks for the reply. I will consider to have a look at it, even if it means to spend time studying lua's internals. I think this ([url="http://lua-users.org/wiki/CppBindingWithLunar"]http://lua-users.org...indingWithLunar[/url]) is a bit like what you said. Anyway, at a second thought, it seems your idea looks to be a very good solution: since it won't change often, it will remain stable and robust. Since I could add what I want, it will remain little, easy to maintain and fast.

To answer your second part: I want something that runs with C++ 03, which supports OpenGL 2.x... and that support lua 5.1 (or above). That's enough for me, and that should be enough for everyone.
If things work with luabind 0.9.0 but stop to work with luabind 0.9.1, or work with lua 5.1 but stop with lua 5.2, that simply means for me that there's something bad in these solutions, not with mine. Here ([url="http://www.lua.org/versions.html"]http://www.lua.org/versions.html[/url]), noone can read that something was broken between the last two releases, for example.
I know some will argue that GL 3.x and above deprecated many functions of GL 2.x and below, but this is something different. I expect minor verisons not to destroy intentionaly what was made in the just previous minor version.

For general concerns, linux distributions (at least in Debian) provide several versions of programs, ie c++ compiler with different minor versions, lua 5.1 and 5.2 ... which, normally, should help people to keep a coherent, stable and robust developping system. However this is not always easy, and when we do things alone (long time projects, in several years), it is important to consider dependency evolutions, ie, move to C++ 11, move to GL 3.X or even 4.X, use lua 5.2...
Another important point about linux distributions (at least for Debian), is that updates happen as long as the distribution is said in testing. At a point (like at this time), it began frozen, and program versions do not change that often, only to correct bugs and security issues.
To summerize this, I just want to say that it's important to follow the evolution, not to be stuck with a release, and minor versions (as I tried to say it above) are meant to correct bugs, to add minor functionalities, and to prepare to the next major release, not to destroy old functionalities.

Thanks again for your reply. Edited by dAgeCKo
0

Share this post


Link to post
Share on other sites
[quote name='dAgeCKo' timestamp='1344770249' post='4968685']
But I am now fed up with it for these reasons: each time there's a new version of luabind I have many problems with my development: compilation issues, linking issues and running issues (segmentation fault, not running...). For example the last time I could plainly use my program (which uses luabind) was on april. All the next releases I had broken things (out of my concern).
[/quote]

[quote name='dAgeCKo' timestamp='1344770249' post='4968685']
What I am looking for should not necessary binds the lua language. I am also opened to python. However my last attempt to use python was a disaster, mainly because of the bjam thing which I didn't succeed to make it work (if you know how to manage this, feel free to propose python).
[/quote]
Trouble with tools shouldn't be an important reason to choose or dismiss a scripting language. If what you are trying to do doesn't work, it can be assumed that what you are trying to do is [i]wrong[/i], not that tools are defective: a humble approach would be more productive. Why don't you explain your difficulties in detail in order to get help? Recommending alternative tools that you'll also make mistakes with isn't going to be very useful.
0

Share this post


Link to post
Share on other sites
i second learning lua c api.
you will have a better understanding of how lua and c interacts. what are tables, objects etc.. actually are
0

Share this post


Link to post
Share on other sites
[quote name='dAgeCKo' timestamp='1344770249' post='4968685']
I am now looking for a good scripting language to use within C++ which will replace the current one (luabind).
[/quote]

Well in my opinion best two options are AngelScript ( http://www.angelcode.com/angelscript/ ) and Squirrel+Sqrat ( http://squirrel-lang.org/ + http://scrat.sourceforge.net/ )

Squirrel itself does not support C++ out of the box, but the Sqrat wrapper makes it really easy to extend c++ objects.

While Squirrel+Sqrat are easier to integrate, AngelScript is much faster and has the better support (this forum ;-) but requires you a lot of more typing.
0

Share this post


Link to post
Share on other sites
I would agree with others that you shouldn't change your scripting language just because you are having trouble keeping up with a proper integration.

That being said, I would have 2 suggestions that would probably be different than most:

1) [url="http://www.mono-project.com/Embedding_Mono"]Embedded Mono[/url]: you can then use C# or most other .NET capable languages to extend your game as if you were using a scripting language, also giving you a wide selection of programmer/scripters to choose from.

2) [url="http://code.google.com/p/v8/"]Google's V8[/url]: the high-performance Javascript engine that is used in Google Chrome. Javascript is also a very widely popular language.

I've used both of these to great effect, though they are not as easy to get working as luabind, so don't expect to get up and running with either of them overnight ;) Edited by krippy2k8
0

Share this post


Link to post
Share on other sites
What about ObjectScript, you could read [url="http://www.codeproject.com/Articles/466907/ObjectScript-A-new-programming-language"]here[/url] about. ObjectScript is a new embedded programing language that mixes the benefits of JavaScript, Lua, and PHP. ObjectScript has syntax from JavaScript, multiple results from Lua, OOP from PHP, and much more.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0