|Video game scripting email@example.com (1998-08-10)|
|Re: Video game scripting firstname.lastname@example.org (1998-08-10)|
|Date:||10 Aug 1998 10:24:55 -0400|
|Organization:||Pacific Bell Internet Services|
|Keywords:||interpreter, design, question|
My name is David Woldrich, and I work at a video game company here in
Irvine, CA. I'm crafty with C++, but I might not be as astute as most
of you here on the subject of languages and software engineering, so
hopefully I don't make a fool out of myself, here.. :)
Anyhow, my company is developing a 3D flightsim racing game. The
graphics engine is progressing, but as we've begun to craft the game
logic and GUI logic, I've been noticing the klunk beginning to build
up. The fact of the matter is, managing all of the phases of movement
and the triggering dependancies of object actions are creating some
messy logic situations. For instance, we need to code complex
sequences like, "Airplane A, taxi through ground waypoints, then turn
to face end of runway, then wait for race start, then takeoff, follow
flight waypoints with AI engaged, land when race is complete" Doing
this in C++ always seems to end up being a switch...case statement or
myriad of callback functions where one processes the current state of
the object for one time unit, or transitions the object to other
modes. Of course, there are modules that are not so simple, and we
are now getting many hard to maintain areas of code.
I have heard tales about the Origin Usecode script system. It's
design sounds interesting. An object in Usecode can trigger actions
in other objects, and in doing so, the code to execute that action is
moved onto some main loop queue. Code blocks that move to the queue
can execute or defer until next loop so that they do not block the
rest of the system. When a code block in the main loop queue finishes
executing, it is removed from the queue. I think Usecode is compiled
to byte code which is then interpreted by the Usecode runtime. They
used this system in Ultima 6 and up, I believe.
A system like Usecode would satisfy many temporal management problems
we have in our systems. Gui manager, game rule logic, object
movement, sound triggers, dynamic "mood music" manager, and networking
protocol/security all need something like this, I'm convinced.
What I would love is to be able to code or acquire a C or C++ compiler
that has extensions to perform various program control deferring
mechanisms. Under the hood, a lot of the state change checks and such
would be generated by the compiler and executed by the script language
With the right debugger a system like this could make debugging a
dream .. you could watch objects get acted upon and see the
"consequence" code get shuffled over to the main loop queue. To me,
seeing many objects executing in parallel would greatly simplify
testing since I could focus on how complex interactions between 2 or
more objects work.
One could say that I am wanting a threading or pseudo-threading
system, but not really, since I don't believe just a simple thread
will solve my problems. A big goal I have is to minimize the amount
of state that I have to update in objects. That requires the language
to facilitate such things. By emulating the Usecode system, I believe
I can update only objects who require attention.
Does anyone know of scripting languages that are tuned for game
creation like Usecode? Does anyone have examples of what such script
languages actually look like? I would love to see how Usecode
After reading other posts on this group, I looked at www.scriptics.com
and checked out TCL. They make great arguments for the use of
scripting, and I think I've come to the same conclusions as them - I
need an integration/automation tool. TCL itself looks to be too
heavyweight for a real time sim, although from looking at the features
list, it appears to have many nice program control transfer features.
I also downloaded Objective CAML and installed it. I have no idea
what to do with it, though. Can anyone tell me of a free compiler
source that was made with ocaml that I can look at?
I'd be much more comfortable to use a prefabricated script language
than try to build my own, so any pointers you all have on those would
be greatly appreciated. I took a compiler design course in college,
but other than what I recall from that, I'm clueless on the subject.
(Still got the dragon book tho ;).
Return to the
Search the comp.compilers archives again.