Game Development Reference
In-Depth Information
Scripting Languages
What is a scripting language? This may seem like a simple question, but the term
has become somewhat ambiguous as more complex programs are written in
what are traditionally thought of as scripting languages. Simply put, a scripting lan-
guage is a high-level programming language that is interpreted by another program
at runtime. It is often embedded within a native application. If you think about it,
this is a rather broad definition. Is C# a scripting language? It certainly meets the
criteria. C# is compiled into byte-code that
script
'
s interpreted at runtime by NET, yet
'
most people don
t consider it a scripting language.
For purposes of this chapter, I ' m going to consider anything higher level than C++
that is embedded into the core game engine to be a scripting language. I
m sure the
time will come when even C# and Python are considered archaic relics of the past,
and programming is done entirely visually.
As far as I can tell, the first scripting language used in a game was the SCUMM
engine by LucasArts. SCUMM stands for Script Creation Utility for Maniac Mansion.
It was a custom language created during the development of Maniac Mansion to
make it easy to create locations, dialogue, objects, puzzles, and other high-level game-
play constructs without having to the touch the 6502 Assembly code at all. This was
an incredibly powerful tool that allowed them to iterate on gameplay incredibly
quickly. In a talk at GDC in 2011, Ron Gilbert (one of the creators of the SCUMM
system) recalled one particular sequence where the player could take a hamster, put it
in the microwave, turn it on, and watch it explode. This was all done in just a few
minutes with the power of the SCUMM system. If you were to do something like this
in 6502 Assembly, it would take 10
'
20 times as long. This is the power of scripting
and why you should absolutely use it for all of your high-level game logic.
-
Using a Scripting Language
There are a number of benefits to using scripting languages for your gameplay, but
there are also a lot of pitfalls that I see developers fall into over and over again. I
'
ve
made a number of these mistakes myself, and I hope that you can learn from them.
Rapid Prototyping
One of the coolest things about using a scripting language is the rapid prototyping.
You can build complex interactions and systems extremely quickly and get them run-
ning in the game without a lot of effort (at least compared to C++). A great example is
the delegate system used in the Event Manager. It took me a full Saturday to rewrite
the event system using delegate functions, and that
'
s not including the FastDelegate
 
 
 
 
Search WWH ::




Custom Search