Game Development Reference
In-Depth Information
defining data, like you might use in XML. I personally tend to fall somewhere in the
middle. I think that large systems that tend to remain relatively static and time-critical
code should be in C++, while volatile code or code that
'
s not time-critical should be in
the script. No matter what, it
s always a judgment call. We had to move all of the AI
processing for Drawn to Life out to C++ because it was taking too long to process.
'
Scripting Language Integration Strategies
Scripting languages come in all shapes and sizes, each with its own strengths and
weaknesses that complement the things I
ve already mentioned. When choosing a
scripting language, there are two general strategies you can follow. You can either
write your own, or you can integrate an existing language.
'
Writing Your Own
In the early days of scripting languages, writingyourownwasreallytheonlyviablechoice,
as other high-level languages either weren
tuptothetask.Mostearly
scripting languages were very specific to the engine they were developed for. Examples of
such languages include SCUMM, used by many of the LucasArts adventure titles, SCI,
used by Sierra On-Line for many of their early point-and-click adventure games, and
UNK and AGIL for the Ultima games at Origin Systems, QuakeC, and UnrealScript.
The real advantage to creating a custom scripting language is that engine-specific
constructs can be integrated directly into the language. With an existing general-
purpose language, you must write all these layers yourself. You can also cut out all
the things you don
'
tavailableorweren
'
'
t need that many languages include directly.
Writing your own scripting language is an incredibly daunting task. If you choose to
walk down this path, expect to spend the first year or so just getting the language up
and running, assuming you
re targeting a high level of polish. The first year of devel-
opment for Maniac Mansion was just getting the SCUMM language up and running.
There are entire topics dedicated to writing your own programming language. You
have to write an interpreter that can read a source file, decompose it into its core
structure, and then process that structure to actually execute the instructions. Doing
this is far beyond the scope of this topic, but if you ' re interested in it, you should
check out LEX and YACC. They can give a leg up in your endeavor. Good luck.
'
Using an Existing Language
Using an existing scripting language is relatively common these days. In fact, the Lua
programming language was designed from the ground up to be embedded within a
native application.
 
 
 
 
Search WWH ::




Custom Search