intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Jan 18, 2019 5:46 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Tue Jan 08, 2019 4:15 pm 
Offline

Joined: Wed Sep 07, 2011 10:21 am
Posts: 32
I am curious what the expectation is for a parser game in a specific situation.

Say there is a hat in a closed box in the room the player is in.

Quote:
You can see a box.

> OPEN BOX

You open the box. There is a hat in it.

> CLOSE BOX

You close it.

> X HAT

What would be a reasonable response at this point? If it says "There is no hat here." we know that is not true; there is a hat in the box!

Should the game note that the player has seen the hat? "You cannot see the hat whilst the box is closed." Should it remember that for the rest of the game, or until the player leaves the room? Or do we go with a bland "You cannot see that.", just the same as if the player typed X BANDERSNATCH?

I cannot decide what is most appropriate; what do you guys think?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jan 08, 2019 5:33 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
The default response, which just about every Inform game of the past 25 years has stuck to, is "You can't see any such thing."

Obviously this is an ass-cover -- you can't *see* it; the question of whether you remember it is ignored. But we're all very used to this circumlocution.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jan 08, 2019 5:46 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
Thinking further:

This convention goes back to the days when it would have been prohibitively expensive to track the player's recollection of the location of every object. (You don't want to include objects that the player has no knowledge of.)

It only now occurs to me that Hadean Lands *has* such a system; you can type RECALL OBJECT and get a message about where you left it. So I *could* have implemented a smarter parser error here. "You last saw the hat in the box [here / in the closet]", as appropriate.

But I didn't do that! And nobody's bugged me about it in all these years. Like I said, we're used to this.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 3:09 am 
Offline

Joined: Wed Sep 07, 2011 10:21 am
Posts: 32
Thanks, it is the "we're used to this" I wanted.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 9:39 am 
Offline
User avatar

Joined: Sat Jun 25, 2016 12:13 pm
Posts: 257
How about it should say, "you can't see a hat here."

Unless of course there's another HAT.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 11:14 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
Repeating back the player's words for an unrecognized entity is risky. You can wind up with outputs like:

Quote:
You can't see a green here. [Adjective or noun?]
You can't see a sowrd here. [Was that a typo or not?]
You can't see a LAMP here. [Do you case-normalize player input?]
You can't see a steven here. [Case normalization isn't easy.]
You can't see a rocks here. [Plurals, mass nouns...]


You can try to recognize out-of-scope objects and print their names sensibly, but again, this involves tracking what the player knows (Epistemology style). Otherwise people are tempted to exploit the parser error system to probe the game contents, which is a lousy use of your and their gameplay time.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 3:54 pm 
Offline
User avatar

Joined: Sat Jun 25, 2016 12:13 pm
Posts: 257
It's not that hard. If the word "hat" (or whatever) is recognised, the engine will definitely know how to mention it.

so,

"you can't see a hat here".
"You can't see Mr. Holmes here."
"you can't see any rice here."

Otherwise if it's not a known word or ungrammatical (eg look yellow), then it will just say so instead. "What yellow?" etc.

"you can't see any such thing". seems so utterly lame...


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 4:31 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
Quote:
It's not that hard. If the word "hat" (or whatever) is recognised, the engine will definitely know how to mention it.


Oh, I disagree. :)

Information about how to name objects (in output text) is attached to *objects*, not *words*. At the point this parser error occurs, the parser only has words. It doesn't know which out-of-scope object the player meant, if indeed the player's intention maps to any game object at all. (It very often doesn't, even if the word is meaningful elsewhere in the game.)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 5:08 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5526
Location: Burlington, VT
Also, if I understand correctly from discussions of "how did my game get to be so slow?", it's checking the words in the command against every possible game object (as opposed to the objects in scope) that gets computationally expensive. If you're going to check the command against every object you may as well do a smarter parser error to tell you where you last saw the object, or just that you've seen the object before. That's not very expensive, once you're mapping the words to the object.

Also also, this allows the player to exploit the parser error system to probe the games' contents again.

Quote:
>x gold
What gold?

>x silver
You can't see a tarnished silver teapot here. [when the teapot isn't going to show up for five hundred more turns]


This is just repeating zarf's comment three up, but still, the point is that getting to to behave at all nicely is nontrivial. Which is why it's handy to have a totally generic response.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jan 09, 2019 5:44 pm 
Offline
User avatar

Joined: Sat Jun 25, 2016 12:13 pm
Posts: 257
I think you guys are not using your parsers correctly;

I would imagine it could work like this:

* user enters text, "look hat"
* parser is applied to text. "hat" will resolve to the hats in the game, resolved by context. In this case the context eliminates all relevant hats.
* parser issues error "you don't see a hat here" based on its game knowledge of hats - notwithstanding there is no actual resolved hat.

For "silver teapots", and things with adjectives;

"look top hat" will _still_ say, "you don't see a hat here", as the error does not add in any adjectives.

You won't really get to find out what's in the game this way, except to know the parser understands the word "hat" vs not recognising it.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group