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

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

description

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. Outline. Introduction Story Scripting and Scripting Languages Reusable Scripting Engine Design - PowerPoint PPT Presentation

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

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

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

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

Outline

1. Introduction

2. Story Scripting and Scripting Languages

3. Reusable Scripting Engine Design

4. Prototype Implementation

5. Results to Date

6. Concluding Remarks

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

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

Page 4: A Reusable Scripting Engine for Automating Cinematics and  Cut-Scenes in Video 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

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

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

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

Introduction

Screen shot from Trauma Center: Under the Knife

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

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

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

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

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

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 …

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

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>

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

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> ...

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

Reusable Scripting Engine Design

DirectorDirector StageManager

StageManager

ScriptReader

ScriptReader

AuthoringTools

AuthoringTools

ScriptScript

UserUser DisplayDisplay

StorytellerStoryteller

Reusable Scripting Engine

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

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

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

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

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

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

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

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

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

Homer: Well, time to go to work.

An Example from the Simpsons

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

An Example from the Simpsons

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

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

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

An Example from the Simpsons

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

An Example from the Simpsons

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

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

An Example from the Simpsons

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

An Example from the Simpsons

Well, off to the plant!

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

Then to the Duff Brewery …

An Example from the Simpsons

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

An Example from the Simpsons

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

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

An Example from the Simpsons

I’ve got to think of a lie fast!

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

An Example from the Simpsons

Marge: Are you going to the Duff Brewery?

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

An Example from the Simpsons

Homer: Ahhhh!

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

An Example from the Simpsons

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

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

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

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