4 ms·
Uncharted uses a DSL for gameplay scripting. The compiler is implemented in Racket. You can see what it looks like in Jason Gregory's 2009 presentation: http://
by ginsweater 15y ago
Uncharted uses a DSL for gameplay scripting. The compiler is implemented in Racket. You can see what it looks like in Jason Gregory's 2009 presentation:
http://www.gameenginebook.com/gdc09-statescripting-uncharted2.pdf http://www.gameenginebook.com/gdc09-statescripting-uncharted...
The compiler is written on top of the low-level system in Dan Liebgold's 2008 presentation:
http://www.naughtydog.com/docs/Naughty-Dog-GDC08-Adventures-In-Data-Compilation.pdf http://www.naughtydog.com/docs/Naughty-Dog-GDC08-Adventures-...
More or less, the sexps that define a state-script get run through a maze of Scheme macros - there's even a pretty decent expression language in there which is compiled to bytecode - and the result is big honking C++ structure which is fed to the Uncharted runtime and interpreted.
In particular, note all those wait-blah-blah calls; those are using call/cc to implement coroutines. Which is something you really really want in a game but which C++ of course doesn't have. (GOAL had native coroutines.)
It's also nice to be able to iterate on the language syntax without having to fool with BNF grammars and so on.