Jump to content
  • Advertisement
Sign in to follow this  
StephanieWhite

What a scripting language?

This topic is 2602 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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"?

Share this post


Link to post
Share on other sites

[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.

Share this post


Link to post
Share on other sites

[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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
Share on other sites
Hidden
is 13andincrediblycut Andy Harglesis ?

Edit: Looks like his posts were removed so this post might look a bit out of place, might make this thread cleaner if this post and fastcalls were removed aswell.

Share this post


Link to post

This topic is 2602 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!