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

Squirrel or Lua for RPG quests, gui and AI scripting?

8 posts in this topic

I'm currently making an RPG and everything is going great, I've been working on it for 6 months and I came to point where I need script language for easy writing quests, ai and configuring gui. I don't have time to write a big editor which would allow to create quests etc without scripting.

 

However, I'm stuck between Lua and Squirrel. Lua is much more used in the industry, but squirrel has nicer syntax to me (c++ like). Both have good c++ binders, oolua and sqrat. Both languages are wery well maintaned, but on the binder side, I found that almost all squirrel binders are abandoned (for version 2 only and now there is 3). Only sqrat is updated for 3, but still it's not that actively maintaned and I'm not sure about it. Lua has a lot of active binding tools.

 

On the other hand, I heard that lua garbage collection is very bad in terms of performance and it can slow down my application every 30-60 sec. And I need good performance all the time without slow downs. Actually one of the reasons why squirrel was made was to fix the lua garbage collection. However, in lua 5.2 they changed something with garbage collector, but many people say that it is still bad...

 

Based on your experience and knowledge, which language should I choose? I really don't know. If you know a language better than these 2, tell me about it.

Edited by NetrickPL
0

Share this post


Link to post
Share on other sites

I've never used Squirrel, so I can't really say anything there.

 

As far as Lua goes, it is possible that you can run afoul of the garbage collector, but there are plenty of ways around it. The collector is fairly flexible; you can disable automatic garbage collection and specify manual collection steps to be run when you desire. Also, Lua provides locals that are implemented in a register-like fashion, so by careful usage of locals and just general all-around thoughtfulness, you can reduce the generation of garbage to an acceptable happy medium.

 

I use Lua for the main guts of my game, Goblinson Crusoe. Certain aspects of it (scene rendering, pathfinding, picking, etc...) are implemented in C++ and exposed to Lua, but the main loop and all of the logic are Lua. I have had upwards of a thousand AI objects operating concurrently (back when it was a point-and-click Diablo-clone, not the turn-based thing it is now), and the performance was more than acceptable. Just be careful about the generation of unnecessary garbage, and you're probably going to be fine.

2

Share this post


Link to post
Share on other sites
I can safely say after using Squirrel for almost 6 years that it is a very solid choice as a scripting language.
The language in itself makes a lot of sense which makes it easy to learn, has all the features you'd expect, and no GC (HELL YEAH!). Edited by Eden-san
1

Share this post


Link to post
Share on other sites

what about angelScript? I'm using it right now i my engine, and it's fantastic for C++ binding. you don't need to mess with metatables or anything of the sort.

 

It's really easy to bind and most (if not all) C++ abstractions can be bound directly with angelscript.

0

Share this post


Link to post
Share on other sites

Lua isn't really that slow. For what you're interested in using it for, it would be more than a fine choice. 

0

Share this post


Link to post
Share on other sites
probably either Lua or Squirrel would work.

usually if a person is dealing with lots of GC performance issues, it probably means they are doing something wrong.
except for certain types of tasks (like using scripting code to write parts of a 3D renderer or the physics engine), raw performance of a script-language isn't usually a huge issue.

in my case, I am using a custom scripting language.
probably hardly mature enough to recommend it to anyone else, but granted I am prone to writing most of my own code (and was largely unaware of many of the scripting languages which existed at the time, ~ 10 years ago, having had been only really exposed to Python and Guile).

Squirrel looks vaguely similar to my language, so that is interesting to me at least.


side notes (my language):
the syntax in my language is much closer to ActionScript3 mixed with elements of C and C#. in its present form, it is mostly using static/manifest typing (though dynamic typing is also supported, and still often used), supporting either AS3 or C# like declaration syntax, and using a C#-like collection of core types. it has a GC, but tries to minimize memory leaks and has value-type structs/classes (value-classes are like structs, but with methods and copy-constructors and similar), as well as "delete", and things like strings and vectors are built-in types, ... (and for 32-bit x86, currently has a basic JIT).

package/import and class declaration syntax works more like in AS3 though (comparable to namespace/using in C#).
technically, the language design was more of a grab-bag though (neither minimalism nor elegance were significant goals).

loading is typically either directly from source, or from bytecode (where VM bytecode may be embedded inside DLLs or SOs via an embedded WAD-like container).

would probably need considerably more work though to compare favorably with more mainstream languages: for example, making everything faster and more robust, having a more feature-complete set of core libraries (vs a half-assed J2ME knock-off), ... but, for my uses, it is mostly ok.

... Edited by cr88192
0

Share this post


Link to post
Share on other sites

NetrickPL:

 

Lua and Squirrel would both work fine, which is kind of a wishy-washy answer, I know. Since you're already leaning toward Squirrel, use Squirrel. If you want more info, you might be interested in this article discussing the advantages that come with Squirrel over Lua:

 

http://computerscomputing.wordpress.com/2013/02/18/lua-and-squirrel-the-case-for-squirrel/

 

That said, they're both excellent scripting languages for embedding, and none of Lua's quirks are a dealbreaker. Just quirks.

2

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