Jump over and similar verb phrases

Hi all,

This is a problem in adv3 proper and Adv3Lite. I was curious how people have addressed this. The example in the library is for jump over.

VerbRule(JumpOver)
    ('jump' | 'jump' 'over') singleDobj
    : JumpOverAction
    verbPhrase = 'jump/jumping (over what)'
    askDobjResponseProd = singleNoun
;
> jump over.  
You see no over here.

The correct action would be to prompt for the missing noun.

My case is the verb point which requires a direct object.

>point
What do you want to point at? 
>point at
You see no at here. 

Hereā€™s the verb rule for point:

VerbRule(PointAt)
     ('point' | 'point' 'at') singleDobj
    : PointAction
    verbPhrase = 'point/pointing (at what)'
    askDobjResponseProd = singleNoun
;

The only solve Iā€™ve found is to break the VerbRule into two rules - one for point and one for point at, and assign a badness to point by itself.

This seems a bit much when the intent is clear with the single rule.

Thanks for any thoughts.

2 Likes

Thatā€™s not the VerbRule I see in adv3lite. What are you looking at?

I only know the adv3 way without doing some investigationā€¦ :confused:

George, one of the major difference between adv3 and a3Lite is in vocabulary and verb handling.

Best regards from Italy,
dott. Piergiorgio

I think you must mean TADS 3 and Adv3. In adv3Lite the JumpOver VerbRule is defined as:

VerbRule(JumpOver)
    ('jump' | 'jump' 'over') singleDobj
    : VerbProduction
    action = JumpOver
    verbPhrase = 'jump/jumping (over what)'
    missingQ = 'what do you want to jump over'
    dobjReply = singleNoun
;
3 Likes

The core problem is the same in both libraries.

VerbRule(JumpOver)
    ('jump' | 'jump' 'over') singleDobj
    : VerbProduction
    action = JumpOver
    verbPhrase = 'jump/jumping (over what)'
    missingQ = 'what do you want to jump over'
    dobjReply = singleNoun
;

Results in

> jump over
You see no over here.

Rather than ā€œWhat do you want to jump over?ā€

1 Like

This is where Iā€™d dearly love a debugger. Are you using Workbench on Windows? You could try stepping through it (or adding log messages I guess). The code seems to be there in adv3lite but I donā€™t have a debugger here to check it. I think I need to see about getting Wine installed.

edit: I have Workbench running, and sorry I was wrong about the code I linked to in this post ā€“ itā€™s not called for ā€œjump overā€ with no object. However it is called for ā€œtakeā€ (with no object).

I tried stepping through it with the Workbench debugger earlier today (in adv3Lite) but Iā€™ve so far been unable to catch the precise point at which this is happening. The parser doesnā€™t even seem to consider ā€˜jumpā€™ ā€˜overā€™ [missing noun] as a possible interpretation of the playerā€™s input. Iā€™ll try again tomorrow, but I have a nasty suspicion that it could turn out that this is happening so deep inside the guts of the system that the only way to deal with it is to code round it.

Yes, itā€™s strange ā€“ it doesnā€™t make it out of the parsing phase.

Tried Jump over/or <noun> ?

I have these cases (adv3Lite):

>jump on sofa

You see no on sofa here.


>jump over sofa

It is pointless to try to jump over the sofa.

>jump on

You see no on here.

>jump over

You see no over here.

>jump cjs

You see no cjs here.


>jump sofa

It is pointless to try to jump over the sofa.

HTH and
Best regards from Italy,
dott. Piergiorgio.

For what itā€™s worth, in adv3 you can do this:

VerbRule(JumpOverWhat) 
    'jump' 'over' : JumpOverAction 
    verbPhrase = 'jump/jumping (over what)'
    construct() { 
      dobjMatch = new EmptyNounPhraseProd(); 
    } 
;

although it may try to pick a default dobj for you rather than prompting you to specify, unless you override an additional method regarding that.

Does that handle the case of jump <object>?

1 Like

'jump' singleDobj is part of the standard adv3 JumpOverAction grammar, so >jump fence will be handled normally as >jump over fence wouldā€¦

1 Like

Iā€™ve been poking at this in Workbench with adv3lite, and wondering if ā€˜overā€™ needs some special handling like other prepositions in grammar.t. But then I noticed you see the same behavior in a drop action if you modify the VerbRule like,

VerbRule(Drop)
    ('put' | 'drop' | 'put' 'down' | 'set' 'down') multiDobj   //  <-- adding 'put'
    | ('put' | 'set') multiDobj 'down'
    : VerbProduction
    action = Drop
    verbPhrase = 'drop/dropping (what)'
    missingQ = 'what do you want to drop'

The Starting Location

Add your description here.

You can see a cow here.

>put down

You see no down here.

>put

What do you want to drop?

>

So short of messing with prepositions, what if we give a hint to the parser, like @Harlock said in the original post, but just in one rule?

VerbRule(JumpOver)
    ([badness 500] 'jump' | 'jump' 'over') singleDobj
    : VerbProduction
    action = JumpOver
    verbPhrase = 'jump/jumping (over what)'
    missingQ = 'what do you want to jump over'
    dobjReply = singleNoun

>jump

You jump on the spot, fruitlessly.

>jump over

What do you want to jump over?

>jump over cow

It is pointless to try to jump over the cow.

>jump cow

It is pointless to try to jump over the cow.

>jump over

What do you want to jump over?

>cow

It is pointless to try to jump over the cow.
>

If this is actually whatā€™s needed, honestly Iā€™m surprised it hasnā€™t been done before? Which makes me think Iā€™m not correct ;), but it does seem to work?

However I donā€™t think this fully answers the original question about a point action, since we still end up with more than one jumping rule. But it seems like multiple VerbRules is how things are done in grammar.t anyway.

3 Likes

Thanks for this. I thought I had tried pretty much the same thing and it hadnā€™t worked, but I must have put the [badness] in the wrong place. It worked when I tried it again after reading your post, so thatā€™s what Iā€™ve now done in the adv3Lite library (having previously tried out a couple of more elaborate solutions that also worked).

I guess the reason it hadnā€™t been done before was that this particular case hadnā€™t come to light before.

4 Likes

Thanks George and Eric. This is the conclusion I came to as well.

ps - I edited my original post to say adv3 and adv3lite instead of tads3 and adv3lite since google seems to pickup these threads and index them.

1 Like

Here are some additional problem phrases. Some are silly, others a bit more realistic.

> set down  
You see no down here 
> dig in  
You see no in here
> look at  
You see no at here
> look in  
You see no in here
> look inside  
You see no inside here
> look up  
You see no up here
> look through  
You see no through here
> look out  
You see no out here
> search under  
You see no under here
> look under  
You see no under here
> look behind  
You see no behind here
> take off  
You see no off here.
> l through  
You see no through here
> throw down  
You see no down here
> say goodbye to  
You see no to here
> say hello to  
You see no to here
> enter into  
You see no into here
> search for  
You see no for here
> turn on  
You see no on here
> switch on  
You see no on here
> flip on  
You see no on here
> turn off  
You see no off here
> switch off  
You see no off here
> flip off  
You see no off here
> set fire to  
You see no fire to here
> climb out of  
You see no out of here
> get in  
You see no in here
> get out of  
You see no out of here
> get down from  
You see no down from here
> get on  
You see no on here
> get on to  
You see no on to here
> climb on  
You see no on here
> climb onto  
You see no onto here
> buckle up  
You see no up here
3 Likes

Thanks for catching all these. Iā€™m now working through them to fix them in the adv3Lite library.
LOOK UP, LOOK IN, and LOOK DOWN are all particular cases of LOOK direction, which will need special handling, not least because the next release of adv3Lite will include an extension to handle commands of that form, so any solution I add to the main library will need to be able to work with that extension. Also a previous discussion indicated that some game authors may want to leverage the fact that LOOK UP (for example) is interpreted as EXAMINE UP to include ā€˜upā€™ (or another direction name) in the vocab of an object (such as the sky) they want to be described when the player looks that way. I think I know how I want to handle this, but it may take some experimentation to get right.

4 Likes