Vespers3D: The Adventure Continues
by Rubes · 05/31/2006 (9:40 pm) · 14 comments
Vespers3D: The Adventure Continues
Recap:
Vespers3D is our attempt to bring old-school text-based adventure games (interactive fiction) into the world of real-time first-person 3D. It is based on Vespers, a fantastic text game that won numerous awards this past year from the IF community, including Best Game at the IFComp'05 and the XYZZY awards this past March. Vespers provides a compelling setting and a powerful storyline for a game that will, in the end, be kind of like Myst with a fully interactive 3D environment and good old-fashioned text command entry.
June 06
Well, it has been almost three months since the last .plan, and although it seems like progress is slow, it is nonetheless progress. In that time I tackled some of the more difficult aspects of the text parser, as well as the visual inventory.
Visual Inventory
One of the problems we faced is that, although the player could click on objects in the game world to select them (and subsequently interact with them), this couldn't be done for inventory items since all we had at this point was a classic text-based inventory, like such:

This didn't seem fair. We needed a visual inventory system, but there were many questions about how it would mesh with the current game mechanics. To this point, the mouse was only used in first-person mode, for mouse-looking and selecting objects in the crosshairs. If I implemented a visual inventory, I'd have to change things around: the mouse cursor would then need to be displayed, with first-person mouse-looking disengaged. That seemed like an awkward transition. But I gave it a shot anyway.
I decided to use the GuiObjectView for TLK resource to help, with some modifications. So I created a new inventory Gui and loaded it with four visible inventory slots (GuiObjectView's) and scroll arrow buttons at each end, like such:

Now we have a visual inventory mirrored by the text description below it. I later added the ability for the player to choose how to view the inventory (as either TEXT, IMAGES, or BOTH) using a "SET INVENTORY TO" command. There were still some kinks to work out, like getting different sized objects to display at an individually appropriate size in the GuiObjectViews, but it seems to be working well now. And it doesn't seem as awkward as I thought to switch between mouse-looking and the arrow cursor.
Then there was the task of allowing mouse clicks to produce object selection (along with object highlighting using TLK), both in the inventory window and in the game environment outside this window. It took a teeny bit of messing with the engine code, but I eventually got it working, like below:

So at last, we have an inventory window that allows clicking on inventory objects the same as any other object in the game world. And now interactive commands can utilize these selected objects the same as before, so if in the image above the player just typed "EXAMINE" it would interpret it as "EXAMINE MONKEYHEAD" since that is the currently selected object.
Text Parsing
There were also a series of upgrades to the text parser, which unfortunately don't lend themselves well to screenshots and is probably terribly boring. But if you're interested in how the parsing engine is coming, the two new features mentioned below were huge projects that eventually forced a lot of code rewriting in the process.
Disambiguation
One of the particularly painful features to implement in a text parser is disambiguation, or asking the player to clarify which object he is referring to when he's not clear enough. So if I'm in a room with two flashlights, one red and one yellow, and I say "TAKE FLASHLIGHT", the parser should respond with "Which flashlight do you mean, the red flashlight or the yellow flashlight?" Then comes the tough part: the text command that follows can be either a disambiguation ("THE RED FLASHLIGHT") or an entirely new verb-object command (ignoring the disambiguation request).
Fortunately, since Vespers3D is a game that involves visual, physical objects and object selection, it's doubtful that this will come up much in the game -- just click on the object you want beforehand. Nevertheless, it's one of those features of a text parser that is mandatory, so I had to put it in. It took some effort, but it seems to be working well. At least, it worked well until I tackled...
Multiple objects (cue the spooky music)
In text IF games, parsers often allow the players to refer to multiple objects in their commands, at least with some verbs. So players are allowed to say things like:
...and so on, ad nauseum. Commands like these might come in handy in a 3D game like ours, since you can only physically select one object at a time. But getting your parser to understand multiple objects is a real test of the spirit. The basic steps to parsing multiple objects include:
- after the verb (e.g., TAKE), split the rest of the text command into "tokens", which are separated by prepositions (if any). So in the last command above, the preposition ("FROM") splits the command into two tokens: "THE MONKEYHEAD AND ALL FLASHLIGHTS " and "THE CUPBOARD".
- then determine if any of the tokens is the word "ALL" by itself. Of course, "ALL" by itself is very different than if it's part of a phrase, like "ALL FLASHLIGHTS". And "ALL" by itself refers to a different set of objects if the verb is TAKE vs. if the verb is DROP.
- after that, then look at each token, and determine how many different "phrases" there are, each phrase referring to one or more objects or object types. So continuing on with the example above, the first token is divided into two phrases: "THE MONKEYHEAD" and "ALL FLASHLIGHTS".
- later, go back and determine what specific objects those phrases refer to. The phrase "ALL FLASHLIGHTS" would then refer to any and all flashlight objects that are in the player's surroundings. Then you have to make sure you're not including any flashlights the player is already holding, or any flashlight that might be nearby but not in visual range, etc.
- then you have to check and make sure there aren't any phrases that need disambiguation (ugh). So if the player types "TAKE THE MONKEY AND THE FLASHLIGHT FROM THE BOX" and there is more than one flashlight present, you have to tag that phrase for disambiguation. And what if there is more than one box, too?
- after all phrases are parsed, and they all refer to valid objects, then compile a list of all objects to be acted upon. This is rather straightforward, except of course when you run into a command like "TAKE ALL FLASHLIGHTS EXCEPT THE YELLOW FLASHLIGHT". Then you have to make sure you're excluding the latter object.
- once you have that final list of objects to act on, you then execute the verb action for each object in the list.
That's it. Then you have multiple object parsing. You may have lost a year or two from your life expectancy, but at least you have multiple object parsing.
The grand joke of all of this, of course, is that much of this will almost never be used by most players, since an exceptionally small number of commands in most pure text IF games require disambiguation or multiple objects. And I expect even fewer in a 3D game like this, owing largely to object selection. But regardless, these are two essential features of a good text parsing engine. Don't leave home without them.
Recap:
Vespers3D is our attempt to bring old-school text-based adventure games (interactive fiction) into the world of real-time first-person 3D. It is based on Vespers, a fantastic text game that won numerous awards this past year from the IF community, including Best Game at the IFComp'05 and the XYZZY awards this past March. Vespers provides a compelling setting and a powerful storyline for a game that will, in the end, be kind of like Myst with a fully interactive 3D environment and good old-fashioned text command entry.
June 06
Well, it has been almost three months since the last .plan, and although it seems like progress is slow, it is nonetheless progress. In that time I tackled some of the more difficult aspects of the text parser, as well as the visual inventory.
Visual Inventory
One of the problems we faced is that, although the player could click on objects in the game world to select them (and subsequently interact with them), this couldn't be done for inventory items since all we had at this point was a classic text-based inventory, like such:

This didn't seem fair. We needed a visual inventory system, but there were many questions about how it would mesh with the current game mechanics. To this point, the mouse was only used in first-person mode, for mouse-looking and selecting objects in the crosshairs. If I implemented a visual inventory, I'd have to change things around: the mouse cursor would then need to be displayed, with first-person mouse-looking disengaged. That seemed like an awkward transition. But I gave it a shot anyway.
I decided to use the GuiObjectView for TLK resource to help, with some modifications. So I created a new inventory Gui and loaded it with four visible inventory slots (GuiObjectView's) and scroll arrow buttons at each end, like such:

Now we have a visual inventory mirrored by the text description below it. I later added the ability for the player to choose how to view the inventory (as either TEXT, IMAGES, or BOTH) using a "SET INVENTORY TO" command. There were still some kinks to work out, like getting different sized objects to display at an individually appropriate size in the GuiObjectViews, but it seems to be working well now. And it doesn't seem as awkward as I thought to switch between mouse-looking and the arrow cursor.
Then there was the task of allowing mouse clicks to produce object selection (along with object highlighting using TLK), both in the inventory window and in the game environment outside this window. It took a teeny bit of messing with the engine code, but I eventually got it working, like below:

So at last, we have an inventory window that allows clicking on inventory objects the same as any other object in the game world. And now interactive commands can utilize these selected objects the same as before, so if in the image above the player just typed "EXAMINE" it would interpret it as "EXAMINE MONKEYHEAD" since that is the currently selected object.
Text Parsing
There were also a series of upgrades to the text parser, which unfortunately don't lend themselves well to screenshots and is probably terribly boring. But if you're interested in how the parsing engine is coming, the two new features mentioned below were huge projects that eventually forced a lot of code rewriting in the process.
Disambiguation
One of the particularly painful features to implement in a text parser is disambiguation, or asking the player to clarify which object he is referring to when he's not clear enough. So if I'm in a room with two flashlights, one red and one yellow, and I say "TAKE FLASHLIGHT", the parser should respond with "Which flashlight do you mean, the red flashlight or the yellow flashlight?" Then comes the tough part: the text command that follows can be either a disambiguation ("THE RED FLASHLIGHT") or an entirely new verb-object command (ignoring the disambiguation request).
Fortunately, since Vespers3D is a game that involves visual, physical objects and object selection, it's doubtful that this will come up much in the game -- just click on the object you want beforehand. Nevertheless, it's one of those features of a text parser that is mandatory, so I had to put it in. It took some effort, but it seems to be working well. At least, it worked well until I tackled...
Multiple objects (cue the spooky music)
In text IF games, parsers often allow the players to refer to multiple objects in their commands, at least with some verbs. So players are allowed to say things like:
> TAKE ALL > TAKE THE MONKEYHEAD AND THE FLASHLIGHT > TAKE THE MONKEYHEAD AND ALL FLASHLIGHTS > REMOVE THE MONKEYHEAD AND ALL FLASHLIGHTS FROM THE CUPBOARD
...and so on, ad nauseum. Commands like these might come in handy in a 3D game like ours, since you can only physically select one object at a time. But getting your parser to understand multiple objects is a real test of the spirit. The basic steps to parsing multiple objects include:
- after the verb (e.g., TAKE), split the rest of the text command into "tokens", which are separated by prepositions (if any). So in the last command above, the preposition ("FROM") splits the command into two tokens: "THE MONKEYHEAD AND ALL FLASHLIGHTS " and "THE CUPBOARD".
- then determine if any of the tokens is the word "ALL" by itself. Of course, "ALL" by itself is very different than if it's part of a phrase, like "ALL FLASHLIGHTS". And "ALL" by itself refers to a different set of objects if the verb is TAKE vs. if the verb is DROP.
- after that, then look at each token, and determine how many different "phrases" there are, each phrase referring to one or more objects or object types. So continuing on with the example above, the first token is divided into two phrases: "THE MONKEYHEAD" and "ALL FLASHLIGHTS".
- later, go back and determine what specific objects those phrases refer to. The phrase "ALL FLASHLIGHTS" would then refer to any and all flashlight objects that are in the player's surroundings. Then you have to make sure you're not including any flashlights the player is already holding, or any flashlight that might be nearby but not in visual range, etc.
- then you have to check and make sure there aren't any phrases that need disambiguation (ugh). So if the player types "TAKE THE MONKEY AND THE FLASHLIGHT FROM THE BOX" and there is more than one flashlight present, you have to tag that phrase for disambiguation. And what if there is more than one box, too?
- after all phrases are parsed, and they all refer to valid objects, then compile a list of all objects to be acted upon. This is rather straightforward, except of course when you run into a command like "TAKE ALL FLASHLIGHTS EXCEPT THE YELLOW FLASHLIGHT". Then you have to make sure you're excluding the latter object.
- once you have that final list of objects to act on, you then execute the verb action for each object in the list.
That's it. Then you have multiple object parsing. You may have lost a year or two from your life expectancy, but at least you have multiple object parsing.
The grand joke of all of this, of course, is that much of this will almost never be used by most players, since an exceptionally small number of commands in most pure text IF games require disambiguation or multiple objects. And I expect even fewer in a 3D game like this, owing largely to object selection. But regardless, these are two essential features of a good text parsing engine. Don't leave home without them.
#2
I'll definalty keep track for this release. I miss the days of Zork... *Insert Nostalgia Here*
I can just imagine what fun it could produce...
I can't wait. I want Vespers now!
05/31/2006 (11:57 pm)
You are a Braver man than I, sir.I'll definalty keep track for this release. I miss the days of Zork... *Insert Nostalgia Here*
I can just imagine what fun it could produce...
>Remove Battery from Torch You have remove the Battery from the Torch >Place Battery on Tongue I can't find a Tongue to but the battery on >Place Battery on Tongue I can't find a Tongue to but the battery on >Place Battery on Tongue Don't be an idiot, I won't do it >Place Battery on Tongue Thats it, I'm leaving... >Place Battery on Tongue ... >Place Battery on Tongue
I can't wait. I want Vespers now!
#3
06/01/2006 (3:54 am)
What a fantastic idea! I am really looking forward to seeing this in action. I miss the sense of exploration that text adventures gave you.
#4
06/01/2006 (4:38 am)
wow, i remember Zork. i never beat that game. i wonder why..
#5
06/01/2006 (8:07 am)
Thanks guys...we'll see how it goes....
#6
Looking forward to seeing the final...
-John
06/06/2006 (2:27 pm)
Hey Rubes....its looking good. And the timing may be just as good. I just read an article about the return of the interactive fiction genre....to the point that two major publishers are currently republishing the original "if you want to climb the mountain turn to page 78" books from years back. Looks like you may have an audience.Looking forward to seeing the final...
-John
#7
I was never a big fan of the CYOA (Create Your Own Adventure) genre, where you read and turn pages like you mentioned. But there was apparently a decent following. I just want to release this thing so badly just to see the reaction out there, but I still have a ways to go.
06/06/2006 (2:37 pm)
Thanks, John. I agree, I think the timing may be good, but a lot depends on the implementation. It's still a little awkward to move between the mouse and the keyboard, although the more I do it the less I notice.I was never a big fan of the CYOA (Create Your Own Adventure) genre, where you read and turn pages like you mentioned. But there was apparently a decent following. I just want to release this thing so badly just to see the reaction out there, but I still have a ways to go.
#8
06/07/2006 (4:43 pm)
I hated getting CYOA books from the library with pages missing... I REALLY wanted to go down that f*cking mountain!
#10
06/12/2006 (8:14 am)
Suzanne rocks...gotta figure out some way to get her into the game...
#11
06/12/2006 (5:11 pm)
Coming along nicely rubes! I'm eagerly watching your development!
#12
06/12/2006 (5:18 pm)
Thanks John...it's slow, but coming along. It's nice to be almost at the point where I can concentrate less on the text parser and more on the actual implementation of Vespers. I wish I could make this go faster.
#13
06/14/2006 (11:42 am)
I miss those old text games. I wonder if game players these days would embrace these types of games, but only if they can understand the joy of these games. Darn, I'm rambling like an old man O_o
#14
There was quite an audience for Myst, so they're out there. We'll see if they embrace a similar type of game only with more interaction.
06/14/2006 (11:55 am)
That's the (hopefully) million-dollar question. I guess it depends on who you mean by "game players these days"...if we're talking the typical 18-25 year old male demographic, my guess is probably there isn't a big portion that is really itching for a game like this. But I'm soft of banking on the idea that there is a group of players out there who would appreciate the slower-paced, thought-provoking, intelligent text-type game, only with more visuals and sound.There was quite an audience for Myst, so they're out there. We'll see if they embrace a similar type of game only with more interaction.

Torque Owner Jon Jorajuria