The following is part of an ongoing series of basic tutorials for gameplay scripters.
Many have asked me what the difference between scripting and programming languages are, so I thought I’d write a short post about it.
The truth is that the line is often blurred between these two things, and people often refer to scripting as the act of creating content with something that resembles code.
In general though, there are some aspects that can be broadly applied to most (but not all) scripting or programming languages that offer some distinction
Scripting Languages
- Often uncompiled meaning that what you write it what actually gets read by your program. This is known as being ‘interpreted’ (rather than ‘compiled’)
The above means they are slower to execute than programming languages
It also means they can often be live edited if your set-up allows it, which is brilliant for iterating on a feature quickly and is relatively easy to set up.
- They are often designed to be a middle ground between the more technical engine code and the game, mostly being designed to be designer friendly with complex sequences of actions being wrapped up in easy to use functions.
To give an arbitrary example, a function like ‘GoAndOpenGate(Sully)’ could take a string name (Sully), search for the nearest gate, calculate a path there, run the relevant locomotion and animation scripts, position the character in the right place and send messages to open the gate.
Some Examples of Scripting Languages
- Lua
- Lisp
- AppleScript
Programming Languages
-
Are compiled before the game is run into an optimised, more computer-friendly format
This means faster execution
It also means they cannot be altered at run-time, unless your set-up allows you to recompile and reload modules on the fly, but this is harder to pull off.
Some Examples of Programming Languages
- C++
- C
- C#
- Java