Scripting language use in game programming

Started by
9 comments, last by EarthBanana 11 years ago

I've noticed a lot of top Game Development companies list knowing a scripting language as a valuable asset to have.

I have a few questions on this topic, so I'll make it a little easier than reading a block of text.

1) What role do scripting languages play in the development of top teir games?

2) Are they commonly used outside of big game companies?

3) What is a concrete example of a scripting language inside of top teir games and what specifically are they used for?

That's about all I can think of at the moment, if you think of something else that may be relevant to this topic, please share it so I can understand.

Thanks

Advertisement

1) What role do scripting languages play in the development of top teir games?
3) What is a concrete example of a scripting language inside of top teir games and what specifically are they used for?

Many, not exactly performance dependent, features of a game, like user interface or game logic, are often written in a scripting language. The benefit is, that it is much easier and faster to handle, more flexible and more designer friendly. E.g. WoW user interface is written in lua.

2) Are they commonly used outside of big game companies?

Yes, even hobby games use often scripting languages to fasten up the development.

Lua is pretty easy to pick up and seems to be the most commonly used scripting language. Ruby is like the chocolate-flavored sex of the programming world, but I rarely see it used any more. Java and C# are ubiquitous. People will probably rage at me for implying that they're scripting languages, but they're nearly the same thing.

The idea behind a scripting language is that you can easily and rapidly design or modify high-level behavior without needing to recompile. The low-level engine handles all the intensive stuff like drawing and sorting, any heavy math, etc. The scripting language sits on top of that and tells it what to draw, what calculations need done, etc.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
Keep in mind that 'scripting' just means programming, and scripting languages are just programming languages.
The distinction of which languages fall into the 'scripting language' category is completely arbitrary... Because of this, I like to call them "extension languages" - programming environments embedded into a system to allow that system to be easily and flexibly extended. This includes browsers, which are simple, but can be extended into any kind of "web app" through the use of their embedded JavaScript environment. Game engines are the same - they're a barren framework of idle systems (physics, 3d renderers, etc), that are useless until a game team comes along and uses the engine's programming environment to reshape those systems into a living game world.

In the last 3 console games I've worked on, Lua has been the primary programming language used by the game - almost the entire game is written in Lua.
The game-engine itself is written in C/C++, as are some small parts of the game, as required.

Lua is preferred over C++ because it's a more productive language. Problems require less lines of code to solve, the code is more malleable, and errors are easier to fix.
C++ is a dangerous language that you can only trust in the hands of veterans, and even then, it's all too easy for even your programming veterans to write brittle and buggy code. There's whole classes of bugs/errors that are all too easy to write in C, but are impossible to write in Lua (basically anything to do with memory accesses, lifetimes and corruption).
It's the same reason that C# is so popular in many fields - its often a more productive choice.

This doesn't mean that C++ is bad -- there are many situations where C++ is he most productive language choice, but general gameplay programming is not one of those situations.

Lau, python, javascript are some of the most common. There are others too. Some companies make their own. Even Java ( as in not JavaScript ) is going to be used for scripting in Arma 3. And c# is used as scripting language in Unity.

There are 3 major reason people use these in games,

1 Increase speed of development ( easier and faster coding, don't have to recompile when you make small changes, often you don't even have to close the game to see the change to a script in action )

2 Less bugs ( it's pretty easy in c++ to make a bug that compiles, and even easier to make errors that don't compile )

3 Seperation of game logic and low level engine code

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

I have a question associated with scripting languages, and I don't want to create new thread because of it.

I just would like to hear what is the preferred scripting language for game development (i'm using java as programming language). I am still in kind of beginners stage of game development. I was making a game and I kind of stuck on UI thing because I didn't know how to make it less messy. But know I realize that my problem was that I didn't use any scripting language, and It was very messy to just hardcode every button, and every action that button does.

So again, what scripting language would you guys recommend for my little game, and probably other upcoming games?

“There are thousands and thousands of people out there leading lives of quiet, screaming desperation, where they work long, hard hours at jobs they hate to enable them to buy things they don't need to impress people they don't like.”? Nigel Marsh

I have a question associated with scripting languages, and I don't want to create new thread because of it.

I just would like to hear what is the preferred scripting language for game development (i'm using java as programming language). I am still in kind of beginners stage of game development. I was making a game and I kind of stuck on UI thing because I didn't know how to make it less messy. But know I realize that my problem was that I didn't use any scripting language, and It was very messy to just hardcode every button, and every action that button does.

So again, what scripting language would you guys recommend for my little game, and probably other upcoming games?

Lua is a very popular scripting language used within games everywhere. Python is too. Just like in Programming language where their isn't a best language, their isn't in scripting languages either really. Basically you just look at them and use some of them. See which one fits your needs and also which one you like. You might not like the syntax of one. Also see how easy it is to integrate it into your language you're using. Lua and c++ seem to be popular together so I would imagine (I've never personally used Lua but was thinking of it soon) their would be plenty of examples of using them together and wouldn't be that hard to use.

Thanks for all the great replies, I understand what they're used for now and feel like learning either Python or Lua wouldn't be a bad choice. My next question is, coming from a Java background, which one of these two languages will I find easiest to pick up? Can anyone give me a little comparison between the two?

Thanks

i'm using java as programming language. I kind of stuck on UI thing because I didn't know how to make it less messy. But know I realize that my problem was that I didn't use any scripting language, and It was very messy to just hardcode every button, and every action that button does.

Java is often considered a 'scripting language' by game devs, so this is probably not your problem.
Maybe you're looking for a data-driven UI system instead of hard doing the data (whether in your main or secondary languages...)

2 Less bugs ( it's pretty easy in c++ to make a bug that compiles, and even easier to make errors that don't compile )

Mmmmmmmmmmmmmmmmmmmmmmmmm...

Shorter code makes for fewer bugs, but it's actually easier to introduce logical errors in a scripting language for the obvious reason that it's easier to do almost everything in a scripting language. They also tend to have less stringent rules than lower level languages, which means that it's possible to get into more kinds of trouble. The upside is that once you've found a bug it's generally easier to repair because you don't have to recompile to test your fix.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement