by date
Vespers3D: The Adventure Continues
Vespers3D: The Adventure Continues
| Name: | Rubes | ![]() |
|---|---|---|
| Date Posted: | Jun 01, 2006 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Rubes |
Blog post
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.
Recent Blog Posts
| List: | 03/19/08 - Vespers3D: Adventures with NPCs, Part IV 12/29/07 - Vespers3D: Adventuring Onward 09/03/07 - Vespers3D: Adventures with NPCs, Part III 08/06/07 - Vespers3D: Visibility Issues in 3D 07/26/07 - Vespers3D: Adventures with NPCs, Part II 07/01/07 - Vespers3D: Adventures with NPCs, Part I 06/17/07 - Vespers3D: Adventures in Cinematics, Part II 04/26/07 - Vespers3D: Adventures in Cinematics, Part I |
|---|
Submit your own resources!| Jon Jorajuria (Jun 01, 2006 at 05:28 GMT) |
| Mincetro (Jun 01, 2006 at 06:57 GMT) |
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!
Edited on Jun 01, 2006 06:57 GMT
| Mousey (Jun 01, 2006 at 10:54 GMT) Resource Rating: 5 |
| Ramen-sama (Jun 01, 2006 at 11:38 GMT) |
| Rubes (Jun 01, 2006 at 15:07 GMT) |
| John Jamison (Jun 06, 2006 at 21:27 GMT) |
Looking forward to seeing the final...
-John
| Rubes (Jun 06, 2006 at 21:37 GMT) |
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.
| Mincetro (Jun 07, 2006 at 23:43 GMT) |
| Frogger (Jun 10, 2006 at 14:10 GMT) |
YAAAY! For SUZANNE!
| Rubes (Jun 12, 2006 at 15:14 GMT) |
| John Seguin (Jun 13, 2006 at 00:11 GMT) |
| Rubes (Jun 13, 2006 at 00:18 GMT) |
| Pisal Setthawong (Jun 14, 2006 at 18:42 GMT) |
| Rubes (Jun 14, 2006 at 18:55 GMT) |
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.
You must be a member and be logged in to either append comments or rate this resource.



5.0 out of 5


