Sign in to follow this  
HexDump

Angel Script a real alternative?

Recommended Posts

Hi all, I just started a new game and I would like to know if AS is a good alternative to lua (the one I have being using until now). I like a lot of features of AS, one of the most is the little binding coding needed (lua is a pain in the ass). In the other hand I see little support, and no games made with it, so I don´t know what to do. Could anybody give any tip on this please? Thanks in advance, HexDump.

Share this post


Link to post
Share on other sites
I've just implement it, and I'm very happy with it. No problems so far. And it is being actively developed (tho this could be taken as a pro or a con depending on how much do you feel to do mantainance work on your side, because there are occasional api changes). I don't regret my decission of choosing it over Lua.

Share this post


Link to post
Share on other sites
Hello, Im just a noob when it comes to game programming, right now i'm just teaching myself C++. I would like to know how scripting languages are used, are they used in the C++ code??? Are they implemented inside the game engine??? I really just want to know how you use scripting languages for games.

Share this post


Link to post
Share on other sites
Quote:
I would like to know how scripting languages are used, are they used in the C++ code???


Not directly. The C++ code generally will kick off some action within the script, but that's it.

Quote:
Are they implemented inside the game engine???


Yes.

Quote:
I really just want to know how you use scripting languages for games.


The C++ code sometimes will be responsible for creating and managing objects, sometimes the script will be. Sometimes C++ may only be a thin layer between the code and the operating system, other times scripts may be small chunks of code relative to the amount of C++. Where the line is drawn between C++ and scripts is dependent on the game's design.

Share this post


Link to post
Share on other sites
Quote:
Original post by niteice
Quote:
I would like to know how scripting languages are used, are they used in the C++ code???


Not directly. The C++ code generally will kick off some action within the script, but that's it.

Quote:
Are they implemented inside the game engine???


Yes.

Quote:
I really just want to know how you use scripting languages for games.


The C++ code sometimes will be responsible for creating and managing objects, sometimes the script will be. Sometimes C++ may only be a thin layer between the code and the operating system, other times scripts may be small chunks of code relative to the amount of C++. Where the line is drawn between C++ and scripts is dependent on the game's design.


Ok, but like, where do the programmers actually place the scripting code, like lets say you're using MS visual studio, could you make an open gl project or something and also incorporate a scripting language into the IDE and use it in the project???

Share this post


Link to post
Share on other sites
Languages are generally available as a static (.lib) or dynamic (.dll) library that you link against, some (Lua, for instance) are small enough that you can add the source files directly to your project.

Share this post


Link to post
Share on other sites
After you've linked to the library, you'll include the main header file and then you can use every function from that library. If you've got the sourcecode, you can also add the files directly and compile it for yourself. I've done it like that before, however I've got sick of unintentionally recompiling the language for the x-th time :)
Moreover, if you're using lua or angelscript (maybe there are others as well) you can enable syntax highlighting for visual studio very easily, so you can edit the files directly in MSVS.

But I think, before you incorporate a scripting language into your project, make another (preferably console) project and test the language their to get familiar with it. It's very easy to integrate the scripting language after you understand how it works.

Share this post


Link to post
Share on other sites
So... do the developer consoles that games like half-life, quake, unreal, and others use a scripting language? And does that allow them to edit variables of different things such as bullet speeds and damage on the fly without having to rebuild everything???

And if so, How do they make a console for a game(in generalization)???

Share this post


Link to post
Share on other sites
I'm not shure if half life 1 used a scripting language, propably not, but my guess would be that they used it in 2. Unreal definately uses one. You're right about your assumption, but it goes much further. I'm implementing the whole AI in angelscript.

Well, a console (in my eyes) is just a system, that allows to execute (script) commands on the fly. You'll add behaviour that allows the user to execute commands, possibly view and edit variables (that's what I did). It's main purpose is to help the developers (in my eyes as well). I can easily switch bewteen 1st and 3rd person with 1 command on the fly, since I haven't developed a system, that changes bewteen those when needed.

Share this post


Link to post
Share on other sites
Hmm, what exactly does AngelScript provide that C++ doesn't?

From the specification I can see:
- Co-routines
- Dynamic loading from source (?)
- Semi-automatic Memory management (maybe even full, ie. you never have to touch the reference counter yourself, not even in C or C++ code)

Is there anything else?

Lua has all of the above, as well as functions-as-values (actually full closures + lexical scoping), which is great for small-scale abstractions. It has a just-in-time compiler and performs better than most other scripts in benchmarks (this probably won't matter that much though). It is also very lightweight. It's not statically typed though.

In any case, maybe SWIG will help you out with your binding issues.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ahnfelt
Hmm, what exactly does AngelScript provide that C++ doesn't?


Sorry, but I cannot make much sense of your question. Scripts are always a great addition to c++ (maybe other languages as well).
I think I don't understand what you mean.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiS-Shadowman
Quote:
Original post by Ahnfelt
Hmm, what exactly does AngelScript provide that C++ doesn't?


Sorry, but I cannot make much sense of your question. Scripts are always a great addition to c++ (maybe other languages as well).
I think I don't understand what you mean.


I disagree; there is no sense in adding a scripting engine to your game for the sake of having a scripting language. It should add something to your game that C++ doesn't, or it's a useless dependency.

However, I think that most scripting languages make you significantly more productive, are less error-prone than C++, and easier to learn for new users.

I can see that AS add some benefits, but my question is if it adds anything else than the three things I listed?

Share this post


Link to post
Share on other sites
I'd say the main benefit is being able to change/add things without recompiling. For example, a downloadable plugin AI character or something. Or for user interfaces, so that users can customize their interface like they want.

You don't really use a scripting languages 'cause it's a more powerfull language.

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