Advertisement

What a scripting language?

Started by October 28, 2011 12:47 AM
10 comments, last by ApochPiQ 13 years, 4 months ago
I thought game programming only required base language like C++ and graphics-related language API like OpenGL/DirectX.

What need would scripting be for unless athe game is made with Lua or some langauge tho it is has OOP and I don't do that.
Well, if you want to be pedantic, game development only requires assembly language. Or machine code. Or a magnetized needle and a steady hand ;-)

You can of course make games however you want. Some games need the low-level access of C or C++ to get the most out of the hardware; most don't. The idea of using a scripting language is to let you do a large part of the game in a way that doesn't make you think about irrelevant details. At some point, you stop caring if your hit-point counter is 32 or 64 bits, or whether it is signed or unsigned, or whether or not it follows the magic-points counter by exactly 4 bytes in memory, and all that cruft. You just want to make the game, and the low-level concerns of a language like C or C++ actually get in your way.

This becomes very common in large-scale games, which is where you will traditionally find scripting used most heavily. A lot of people find it more productive to write in a high-level language, so you do that where possible, and only dip into the low-level stuff when you absolutely have to have speed.


Of course, nobody says you have to do this; if you have ample time or just prefer doing everything low-level, that's perfectly fine. There are still people (few and far between, granted) who write games entirely in assembly language.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Advertisement

Well, if you want to be pedantic, game development only requires assembly language. Or machine code. Or a magnetized needle and a steady hand ;-)

You can of course make games however you want. Some games need the low-level access of C or C++ to get the most out of the hardware; most don't. The idea of using a scripting language is to let you do a large part of the game in a way that doesn't make you think about irrelevant details. At some point, you stop caring if your hit-point counter is 32 or 64 bits, or whether it is signed or unsigned, or whether or not it follows the magic-points counter by exactly 4 bytes in memory, and all that cruft. You just want to make the game, and the low-level concerns of a language like C or C++ actually get in your way.

This becomes very common in large-scale games, which is where you will traditionally find scripting used most heavily. A lot of people find it more productive to write in a high-level language, so you do that where possible, and only dip into the low-level stuff when you absolutely have to have speed.


Of course, nobody says you have to do this; if you have ample time or just prefer doing everything low-level, that's perfectly fine. There are still people (few and far between, granted) who write games entirely in assembly language.



ok. so what is a scripting language? i still don understand. and why use it if you have a programming language and API? of all the stuff you wrote it had little to nothing to do with how, what or why i use scirpting language. very unhelfupl.

"[color=#1C2837][size=2]The idea of using a scripting language is to let you do a large part of the game in a way that doesn't make you think about irrelevant details."

so what is a "large part"? and what do you consider "irrelevant"?
Here...

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"


Here...



k thanks for letting me knoe how gay it is. thumbs up mark.


[quote name='IADaveMark' timestamp='1319764823' post='4877746']
Here...




k thanks for letting me knoe how gay it is. thumbs up mark.
[/quote]

First of all, that kind of slur is not appreciated on these forums.


Secondly, just because you don't personally see the need for something does not make it worthless.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Advertisement

[quote name='SWQUEENIFY' timestamp='1319764956' post='4877747']
[quote name='IADaveMark' timestamp='1319764823' post='4877746']
Here...



k thanks for letting me knoe how gay it is. thumbs up mark.
[/quote]

First of all, that kind of slur is not appreciated on these forums.


Secondly, just because you don't personally see the need for something does not make it worthless.


[/quote]

srry for the slurs! im, new forgive/? and it is worthless to me becaus i dont work that way. sorry i cant be inside your brain.... like yeah. :P

ok. so what is a scripting language? i still don understand. and why use it if you have a programming language and API? of all the stuff you wrote it had little to nothing to do with how, what or why i use scirpting language. very unhelfupl.

"[color="#1C2837"]The idea of using a scripting language is to let you do a large part of the game in a way that doesn't make you think about irrelevant details."

so what is a "large part"? and what do you consider "irrelevant"?


Basically the difference between a script and a program is that a program contains instructions for a machine (possibly a virtual one) while a script contains instructions for a program or a component of a program.
a scripting language is a language used to write scripts. (All languages can be used as scripting languages, but high level languages tend to be better suited for the task)

You could hardcode everything if you wanted to, but why would you ?
Do you load your graphics from image files or do you write those in C++ ?
Do you load your levels from level files or do you write those in C++ ?

Scripts have tons of advantages.

1) They can be written in a high level language with a feature set tailored to your game.
2) They can be loaded and modified at runtime.
3) The scripts can run in their own sandbox and will work on all platforms supported by your game without recompilation.

Why should the behaviour of for example a monster be hardcoded when its visual apperance is not ?

In my current game project the behaviour of all non player actors, the levels, and triggers are scripted which allows me to create new enemies, weapons, levels, etc at a fairly high pace, and more importantly, it allows my future players (Which i hope to get) to do the same.

If games such as Warcraft 3 didn't support scripts for their units and levels we wouldn't have gotten things like tower defense and dota maps for that game, That is the kind of flexibility scripts can give you.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
so a scripting language is a programming language?
Yes.
"Scripting languages" are programming languages, and "scripts" are programming code like any other programming code.

Programming languages are usually called "scripting languages" when they're used to provide extensions to an existing program.
For example, many games are written in C++ but provide a Lua API for "scripting" the C++ core. Or, how browsers allow Javascript to "script" the behavior of webpages. Or how Unity can be written in C++, but allows users to "script" the logic of game objects in C#.

In other contexts, Lua, Javascript and C# might not be "scripting languages", but in the above examples where they're used to extend an application's core functionality, they become "scripting languages".

This topic is closed to new replies.

Advertisement