GRIMM GRIMM Choose- -Your Your- -Own Own- -Story Language - - PowerPoint PPT Presentation

grimm grimm
SMART_READER_LITE
LIVE PREVIEW

GRIMM GRIMM Choose- -Your Your- -Own Own- -Story Language - - PowerPoint PPT Presentation

GRIMM GRIMM Choose- -Your Your- -Own Own- -Story Language Story Language Choose Mike Lenner Mike Lenner Billy Liu Billy Liu Mariya Nomanbhoy Nomanbhoy Mariya Becky Plummer Becky Plummer What is GRIMM What is GRIMM ! Named for


slide-1
SLIDE 1

GRIMM GRIMM

Choose Choose-

  • Your

Your-

  • Own

Own-

  • Story Language

Story Language

Mike Lenner Mike Lenner Billy Liu Billy Liu Mariya Mariya Nomanbhoy Nomanbhoy Becky Plummer Becky Plummer

slide-2
SLIDE 2

What is GRIMM What is GRIMM

! ! Named for famous storytellers

Named for famous storytellers – – Grimm Grimm Brothers Brothers

! ! Designed to make creating an interactive,

Designed to make creating an interactive, first first-

  • person role playing game easy and

person role playing game easy and intuitive intuitive

! ! No programming experience required

No programming experience required – – language based on free language based on free-

  • form English

form English

! ! Reallocates the majority of effort where it

Reallocates the majority of effort where it belongs belongs – – the story writing the story writing

slide-3
SLIDE 3

Language Outline Language Outline

! ! First section of GRIMM programs are declarations

First section of GRIMM programs are declarations

! ! Developer declares scenes within a story. Each scene

Developer declares scenes within a story. Each scene contains standard set of properties contains standard set of properties

– – Name (“The Living Room”) Name (“The Living Room”) – – Description (“You are standing in a room with green walls”) Description (“You are standing in a room with green walls”) – – Picture (“ Picture (“room.jpg room.jpg”) ”) – – Items (couch, notebook) Items (couch, notebook) – – Exits (hallway, kitchen) Exits (hallway, kitchen)

! ! Developer may also declare items and characters

Developer may also declare items and characters

slide-4
SLIDE 4

GRIMM Example GRIMM Example -

  • Declarations

Declarations

scene castleGate scene castleGate scene scene courtYard courtYard castleGate name “The Castle Gate” castleGate name “The Castle Gate” castleGate description “You are standing in front of a large castleGate description “You are standing in front of a large wooden gate. The gate is locked and there are two soldiers wooden gate. The gate is locked and there are two soldiers preventing your passage.” preventing your passage.” castleGate exit courtYard castleGate exit courtYard courtYard name “Castle Court Yard” courtYard name “Castle Court Yard” courtYard description “You have entered the castle court yard. courtYard description “You have entered the castle court yard. You see that a joust tournament is about to begin.” You see that a joust tournament is about to begin.” courtYard contains item lance courtYard contains item lance courtYard contains item helmet courtYard contains item helmet character Merlin character Merlin Merlin holds item staff Merlin holds item staff

slide-5
SLIDE 5

Language Outline Language Outline

! ! Second part of GRIMM program is the

Second part of GRIMM program is the actual story using these declared scenes, actual story using these declared scenes, characters and items. characters and items.

! ! Control flow constructs guide user through

Control flow constructs guide user through declared scenes based on user input. declared scenes based on user input.

! ! Conditionals test the state of the user

Conditionals test the state of the user (what scene is occupied, what items are (what scene is occupied, what items are

  • wned).
  • wned).
slide-6
SLIDE 6

GRIMM Example GRIMM Example – – Control Flow Control Flow

while user inside dungeon while user inside dungeon read user input read user input if user says “unlock cage door” and not user has key then if user says “unlock cage door” and not user has key then say “You cannot unlock the door without the key.” say “You cannot unlock the door without the key.”

  • therwiseif user says “unlock cage door” and user has key then
  • therwiseif user says “unlock cage door” and user has key then

say “The door is unlocked and you slip through the cage say “The door is unlocked and you slip through the cage

  • unnoticed. You move quickly to the treasure room
  • unnoticed. You move quickly to the treasure room

next door.” next door.” goto treasureRoom goto treasureRoom

  • therwiseif user says “open treasure chest” then
  • therwiseif user says “open treasure chest” then

say “You open the chest and you see a silver key.” say “You open the chest and you see a silver key.” read user input read user input if user says “take key” then if user says “take key” then user pickup key user pickup key say “You took the key” say “You took the key”

  • therwise
  • therwise

say “The chest has closed shut on its own.” say “The chest has closed shut on its own.” endif endif endif endif endwhile endwhile

slide-7
SLIDE 7

Game Play Game Play

! ! Story is played out by displaying current

Story is played out by displaying current scene to the user, then waiting for input. scene to the user, then waiting for input.

! ! Many such games are text based

Many such games are text based – – GRIMM GRIMM creates graphical based applications. creates graphical based applications.

! ! User interacts with a GUI console

User interacts with a GUI console

– – shows the current state of the game as well shows the current state of the game as well as allows for user interaction. as allows for user interaction.

slide-8
SLIDE 8

GUI Components GUI Components

Scene title Scene image Scene description Non-hidden scene exits User items Non-hidden scene items User – Game interaction

scene castle scene name “Castle Path” scene description “You are standing on a dirt path. Ahead of you in the distance you see the Castle of the North Kingdom. You think you hear something that sounds like trumpets blaring way off in the distance. To your left is a small dagger.” scene image “castle.jpg” scene castle contains item dagger scene exit gate if user says “pick up dagger” pickup dagger endif

slide-9
SLIDE 9

Scene Update Scene Update

slay dragon

slide-10
SLIDE 10

GRIMM Implementation GRIMM Implementation

! ! Lexer

Lexer – – separate text into token stream separate text into token stream

! ! Parser

Parser – – builds syntactically correct AST builds syntactically correct AST

! ! Walker

Walker – – builds symbol table while builds symbol table while checking for semantic errors checking for semantic errors

! ! Translator

Translator – – walks AST generating Java walks AST generating Java code based on each node code based on each node

! ! Runtime Environment

Runtime Environment – – Java classes used Java classes used by Translator in creating application code by Translator in creating application code

slide-11
SLIDE 11

GRIMM Implementation GRIMM Implementation

slide-12
SLIDE 12

Runtime Environment Runtime Environment

slide-13
SLIDE 13

Lessons Learned Lessons Learned

! ! Understand big picture before coding

Understand big picture before coding begins begins

! ! Split up responsibilities earlier in the

Split up responsibilities earlier in the project project

! ! Know the scope of your language from the

Know the scope of your language from the beginning and try not to deviate beginning and try not to deviate

! ! Difficult to maintain free

Difficult to maintain free-

  • from English

from English syntax when building the compiler syntax when building the compiler

slide-14
SLIDE 14

Summary Summary

! ! GRIMM is a useful tool for the storywriter

GRIMM is a useful tool for the storywriter

– – Less time spent on coding, more on Less time spent on coding, more on developing storylines. developing storylines. – – A lot can be accomplished without a lot of A lot can be accomplished without a lot of code. code.

! ! Maintained somewhat intuitive syntax

Maintained somewhat intuitive syntax

! ! Extremely successful team collaboration

Extremely successful team collaboration