30
A Reusable Scripting Engine for Automating Cinematics and Cut-Scenes in Video Games M. McLaughlin and M. Katchabaw Department of Computer Science The University of Western Ontario

A Reusable Scripting Engine for Automating Cinematics and Cut-Scenes in Video Games M. McLaughlin and M. Katchabaw Department of Computer Science The University

Embed Size (px)

Citation preview

A Reusable Scripting Engine for Automating Cinematics and Cut-Scenes in Video Games

M. McLaughlin and M. KatchabawDepartment of Computer ScienceThe University of Western Ontario

Outline

1. Introduction

2. Story Scripting and Scripting Languages

3. Reusable Scripting Engine Design

4. Prototype Implementation

5. Results to Date

6. Concluding Remarks

Introduction

Storytelling is widely recognized as an important element of modern video games

For games that are dependent on their story elements, the level of quality required for their story at least equals the need for quality in graphics, audio, and other aspects of the games

Consequently, it is important to ensure thereare sufficient supports for storytellers to beable to effectively and efficiently tell theirstories with games

Introduction

The current state-of-the-art typically requires programming background or expertise to provide story elements to games– This is usually outside the realm of most storytellers

As a result, implementing stories in games tends to require storytellers to rely on programmers– Can be costly, prohibitively so in some cases– Possibility of communication and programming errors– Potential loss of direct and total control of the story,

affecting the creative process and overall story quality

Introduction

To assist storytellers, tools and supports arenecessary to allow them to tell their stories with minimal, if any, programming required– The storytellers are given a simple and natural

way of expressing their story– Automation prepares this content for presentation

within the game with little or no human intervention This is the intent of our current work, a

Reusable Scripting Engine– Our current focus is on story content for cinematics or

cut-scenes, as opposed to in-game story elements

Introduction

Screen shot from Trauma Center: Under the Knife

Story Scripting and Scripting Languages

To automate the presentation of story elements from a story, the original story needs to be scripted in such a way that it can be easilyacted out on-screen– This scripting must identify characters, dialogue, stage

directions, setting, and other elements common to traditional dramatic pieces

– This scripting will also need to be precise and formal enough for it to be easily processed and understood by the software automating the presentation

Story Scripting and Scripting Languages

Fortunately, the Text Encoding Initiative (TEI) has developed an XML-based specification for marking up all different kinds of texts, including dramatic pieces

Since XML is not necessarily the most natural platform for storytellers writing stories, several tools have been developed according to TEI guidelines for importing existing works or writing them from scratch

Story Scripting and Scripting Languages

In the end, we could not completely follow TEI guidelines, and had to derive something with some modifications and extensions– TEI guidelines are incredibly detailed and require

information that does not quite make sense in ourtarget application

– Several elements in the TEI guidelines are not formal or precise enough yet for our purposes

– We needed additional elements to link content and assets into story scripts

For example, consider the following …

Story Scripting and Scripting Languages

<performance title="Battle of Wits"> <!--Information about the graphical elements of the play--> <header> <!--Cast of characters and props--> <castList> <character id="vizzini"> <name> Vizzini </name> <!--Character models defined for this character. The first model is designated the default model--> <availModelList> <model id="defaultViz" location="c:\performances\bow\models\vizzini\default.bmp"/> <model id="vizziniDrink" location="c:\performances\bow\models\vizzini\drinking.bmp"/> <model id="vizziniLaugh" location="c:\performances\bow\models\vizzini\laughing.bmp"/> <model id="vizziniDead" location="c:\performances\bow\models\vizzini\dead.bmp"/> </availModelList> </character>

… </castList> …</header>

Story Scripting and Scripting Languages

…<dialogue speaker="vizzini">

<line>Well, I- I could have sworn I saw something.</line> <line>No matter. First, let's drink.</line> <line>Me from my glass, and you from yours.</line> </dialogue> <stageDirection> <costumeChange characterID="vizzini" model="vizziniDrink"/> <costumeChange characterID="westley" model="westleyDrink"/> <pause duration=“3”/> <costumeChange characterID="vizzini" model="defaultViz"/> <costumeChange characterID="westley" model="defaultWest"/> </stageDirection> <dialogue speaker="westley"> <line>You guessed wrong. </line> </dialogue> <stageDirection> <costumeChange characterID="vizzini" model="vizziniLaugh"/> </stageDirection> ...

Reusable Scripting Engine Design

DirectorDirector StageManager

StageManager

ScriptReader

ScriptReader

AuthoringTools

AuthoringTools

ScriptScript

UserUser DisplayDisplay

StorytellerStoryteller

Reusable Scripting Engine

Reusable Scripting Engine Design

Director– Manages script reader and stage manager to

oversee the entire production– Provides playback control to the user, which could

be the application the engine is embedded in Script Reader

– Reads in the script and processes it– Verifies correctness and completeness of script– Generates a collection of stage actions from the script,

creating a performance, and gives this performance to the director

Reusable Scripting Engine Design

Stage Manager– Responsible for generating the actual on-screen

performance of the script– It receives its direction on what to do and how

to do this from the director– It also reports back to the director on the status

of the production

Prototype Implementation

Based on this design, a prototype has been implemented for Microsoft Windows XP, written in C++ in Microsoft Visual Studio .Net

XML processing was implemented usingMicrosoft’s XML libraries

For visual rendering of the cinematic or cut-scene, Ogre3D was used– Allows both 2D and 3D support– Chosen to support easy integration with other

on-going research projects at Western in this area

Results to Date

So far, we have been able to stage some simple productions using our prototype– There is still the odd glitch here and there, but

things generally work pretty well– Development is continuing …

Integration into some of the other gameprojects under way at Western is currentlyin progress

Homer: Well, time to go to work.

An Example from the Simpsons

An Example from the Simpsons

Little do they know I’m ducking out early to take theDuff Brewery tour …

Roll in at nine, punch out at five, that’s the plan.

An Example from the Simpsons

An Example from the Simpsons

Heh heh heh … They don’t suspect a thing …

An Example from the Simpsons

An Example from the Simpsons

Well, off to the plant!

Then to the Duff Brewery …

An Example from the Simpsons

An Example from the Simpsons

Uh oh! Did I say that or just think it?

An Example from the Simpsons

I’ve got to think of a lie fast!

An Example from the Simpsons

Marge: Are you going to the Duff Brewery?

An Example from the Simpsons

Homer: Ahhhh!

An Example from the Simpsons

Concluding Remarks

Storytelling is a very important aspect tomodern video games

Tools and supports are necessary to enablestorytellers to directly produce story contentfor games, without requiring programmingbackground and expertise

Our Reusable Scripting Engine provides a stepin this direction for cinematics and cut-scenes– Results to date have been quite promising

Concluding Remarks

Directions for future work include the following:– Support for audio, including spoken dialogue,

background music that changes, and sound effects– Support for animated characters and background

elements and effects– 3D cinematics and cut-scenes (which would require

the addition of new stage directions)– Support for dynamically generated story elements– Support for in-game storytelling sequences