Game scripting languages
Game scripting languages
Hello all!
Currently in the game I am working on, I have a statemachine, rudimentary event system, the ability to read the parameters for createDevice() out of a config file, additionally a teammate added in code so that settings in the config file can be overriden by commandline operators and not much else... My game is aiming to be a 6DoF FPS similar to the Descent series. The series hasn't had any major improvements in several years, so my team is aiming to create a new game, perhaps not in name to avoid copyright issues...
On the side I've been using irrBullet to sort out physics. For testing I've basically torn one of the irrbullet examples apart and figured out how to make things work. Before I integrate physics into my game I want to get my attribute loader in place, to load physics values for objects and not have to hardcode values.
Starting with the beginning I've tried to plan out the structure of my game to the best of my ability to ensure that I reduce the number of times I have to tear out code to do it right. In fact, I ended up planning for five days before starting any code (not doing nothing but planning mind you...) This has gotten me to the current state of my game. I'm proud of the current state of my game, although my methods may not be the best in the world.
All of this talking has finally gotten us to my question! yay!
As I said, I've been planning everything and when I got to thinking about scripting I had to sit down and figure out what would possibly be using scripting, and this is what I came up with: Note Sheet [LARGE IMAGE]
Looking at this made be realize that I haven't got clue one as to where to start with scripting. I've heard of many languages, and I've seen many articles, but none have been the "general outlay" of how the scripting should best be laid out.
In addition, I've heard good things about languages line Angelscript, python, Lua, swig, but the best thread that I saw that talked about them was this one: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=19356 and I'm concerned that it's outdated.
Are there any good resources for learning about scripting? Are certain languages better for certain types of scripting than others? Does anyone know of good examples of working game implementations of these languages?
Currently in the game I am working on, I have a statemachine, rudimentary event system, the ability to read the parameters for createDevice() out of a config file, additionally a teammate added in code so that settings in the config file can be overriden by commandline operators and not much else... My game is aiming to be a 6DoF FPS similar to the Descent series. The series hasn't had any major improvements in several years, so my team is aiming to create a new game, perhaps not in name to avoid copyright issues...
On the side I've been using irrBullet to sort out physics. For testing I've basically torn one of the irrbullet examples apart and figured out how to make things work. Before I integrate physics into my game I want to get my attribute loader in place, to load physics values for objects and not have to hardcode values.
Starting with the beginning I've tried to plan out the structure of my game to the best of my ability to ensure that I reduce the number of times I have to tear out code to do it right. In fact, I ended up planning for five days before starting any code (not doing nothing but planning mind you...) This has gotten me to the current state of my game. I'm proud of the current state of my game, although my methods may not be the best in the world.
All of this talking has finally gotten us to my question! yay!
As I said, I've been planning everything and when I got to thinking about scripting I had to sit down and figure out what would possibly be using scripting, and this is what I came up with: Note Sheet [LARGE IMAGE]
Looking at this made be realize that I haven't got clue one as to where to start with scripting. I've heard of many languages, and I've seen many articles, but none have been the "general outlay" of how the scripting should best be laid out.
In addition, I've heard good things about languages line Angelscript, python, Lua, swig, but the best thread that I saw that talked about them was this one: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=19356 and I'm concerned that it's outdated.
Are there any good resources for learning about scripting? Are certain languages better for certain types of scripting than others? Does anyone know of good examples of working game implementations of these languages?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
"I'll find out if what I deleted was vital here shortly..." -d3jake
Well, one of the first things you should do is decide what language features are acceptable, and which ones aren't. For example, AngelScript is an object oriented language very similar to C/C++ that is also statically typed. Lua is a dynamically typed language with a very unique syntax, and heavily revolves around the use of tables. In Python, scope is determined by whitespace. An extra tab or a space in front of a line could cause errors in your code.
You should first evaluate the type of scripting languages you would be comfortable with, then look at how easy they are to implement in your project. The sirrf project is a good place to start for learning AngelScript implementation, as it includes bindings for Irrlicht's basic classes (although, it is a little old, so the bindings aren't complete.) Boost.Python, part of the Boost library, makes it easy to bind C++ classes to python.
You should first evaluate the type of scripting languages you would be comfortable with, then look at how easy they are to implement in your project. The sirrf project is a good place to start for learning AngelScript implementation, as it includes bindings for Irrlicht's basic classes (although, it is a little old, so the bindings aren't complete.) Boost.Python, part of the Boost library, makes it easy to bind C++ classes to python.
In addition to AngelScript mentioned above. There is Game Monkey http://www.somedude.net/gamemonkey/ it is very nice. I would highly recommend it. Game Monkey is easier to learn and get set up, AngelScript is harder to learn and get set up but is easier to bind once you learn. I also experienced better community support with GameMonkey.
~David
~David
Falcon is another fun one to have a look at.
http://www.falconpl.org
It's base syntax is very similar to Lua, but it has a ton more stuff (like functional and oo programming).
http://www.falconpl.org
It's base syntax is very similar to Lua, but it has a ton more stuff (like functional and oo programming).
Also for python see this http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=37667
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
Also v8 from google, its a great and easy to use scripting engine (which i replaced my use of angelscript with).
I also wrote a small primer/helper function for people interested in v8 :
http://blog.owned.co.za/?p=205
There is also game programming gems 6, which compares a good handful of scripting engines and why to use each.
I also wrote a small primer/helper function for people interested in v8 :
http://blog.owned.co.za/?p=205
There is also game programming gems 6, which compares a good handful of scripting engines and why to use each.
-
- Posts: 3
- Joined: Fri Jun 04, 2010 7:02 am
Thanks 1000x. Your blog post is exactly what I looked for. You now have one more reader.FuzzYspo0N wrote:Also v8 from google, its a great and easy to use scripting engine (which i replaced my use of angelscript with).
I also wrote a small primer/helper function for people interested in v8 :
http://blog.owned.co.za/?p=205
There is also game programming gems 6, which compares a good handful of scripting engines and why to use each.
In case anyone else is interested: http://code.google.com/p/v8-juice/ helps to embed V8 into your application.
Edit:
Also check this out: http://shootout.alioth.debian.org/u32/b ... &lang2=gcc
You can compare all kinds of scripting languages in case speed is of essence for your game.
My experience is that LUAjit should be easiest to implement and very,very fast. Gamemonkey is close second, but it is rather old and unmaintained if I remember correctly. With python, you can do absolutely everything right out of the box, of course, but is a little slower and may slow your startup time down a little bit (maybe 5 seconds). Please take all of this with a grain of salt. You should maybe try some of those languages to check the syntax and how to bind them to C++.
I personally just like JavaScript better and in case HTML5 games ever take off, this is pretty future proof.
The information above is appreciated!
The next question that comes to mind is this: I've heard that scripting languages can speed development dramatically, at least in the realm of multiplayer gametype and\or level scripting. Also, using straight C++ seems like a logical choice, nothing more to set up, just create a uniform API, and away you go. How would you make the argument for using a scripting language, and the correct code to allow it to talk to C++, instead of using straight C++?
The next question that comes to mind is this: I've heard that scripting languages can speed development dramatically, at least in the realm of multiplayer gametype and\or level scripting. Also, using straight C++ seems like a logical choice, nothing more to set up, just create a uniform API, and away you go. How would you make the argument for using a scripting language, and the correct code to allow it to talk to C++, instead of using straight C++?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
"I'll find out if what I deleted was vital here shortly..." -d3jake
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
- Posts: 363
- Joined: Thu Dec 16, 2010 8:50 pm
- Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..
scripting languages are slower because they are a second layer of abstraction and not as "real" as lower level languaging.
it is easier for humans to read
but computer needs to execute script every logic/whatever tik and figure out what it means in lower level terms.
however we have powerful computers today so sppeed issue of scripting languages is not a big as problem as before.
it is easier for humans to read
but computer needs to execute script every logic/whatever tik and figure out what it means in lower level terms.
however we have powerful computers today so sppeed issue of scripting languages is not a big as problem as before.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Scripting languages might compile to byte code, but this is not native code and is inheritly slower. However, this is becoming less and less of an issue as computers get faster and scripting languages get more optimized.
Also, I was surprised to see I posted in this topic, from the grave!
~Pathogen David
Also, I was surprised to see I posted in this topic, from the grave!
~Pathogen David
I'd recommend pawn it is really fast ( is said to be faster than lua JIT), small in size (fits into about 27kb or even smaller), and is easy to integrate.
It is used for amxmodx(scripting for hl1 engine game servers, and maybe others) project tough I think they modified it a bit.
Also theres SA-MP which is GTA san andreas multi-player modification.
There may be other cool projects using it tough I don't know any.
You can take a look at my attempt to write a "tutorial" for it in my signature, tough I think I made some mistakes, but if you need help I will try or you could look at the manual which explains every detail of it.
Also I have tried python, It gives you more control out of the box but also is a lot harder to use(like distribution).
It is used for amxmodx(scripting for hl1 engine game servers, and maybe others) project tough I think they modified it a bit.
Also theres SA-MP which is GTA san andreas multi-player modification.
There may be other cool projects using it tough I don't know any.
You can take a look at my attempt to write a "tutorial" for it in my signature, tough I think I made some mistakes, but if you need help I will try or you could look at the manual which explains every detail of it.
Also I have tried python, It gives you more control out of the box but also is a lot harder to use(like distribution).
Working on game: Marrbles (Currently stopped).
Well I had problems to get it to run on other machines, it usually requires them to get the same version of python, ect. I haven't done anything lately with it so I can't really remember right now._maxim_ wrote:what is distribution problem?serengeor wrote:Also I have tried python, It gives you more control out of the box but also is a lot harder to use(like distribution).
Working on game: Marrbles (Currently stopped).