Parsing user input.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    mudlab.org Forum Index -> Design
View previous topic :: View next topic  
Author Message
Tyche



Joined: 13 May 2005
Posts: 176
Location: Ohio, USA

PostPosted: Tue Sep 27, 2005 3:31 pm    Post subject: Reply with quote

KaVir wrote:

Right, but what I was responding to was Greggen's comment about compatibility (the "Their grammar is a subset of mine" one you highlighted in bold). Merc doesn't handle the flaming sword example because it doesn't handle multiple keywords - but Greggen's parser does handle multiple keywords, and therefore Merc commands such as 'get' and 'give' wouldn't be subsets of his parser.


Why not? I'd assume that in handling multiple keywords one would certainly validate that all of them came from the same object. The fail case in absence of that and a preposition would be to check the Merc case, or vice versa.

Likewise by just adding two checks to Merc you can make it handle multiple keywords. Things would certainly be made much easier by smarter categorization and processing of keywords.

However I think there are better approaches than the extremes of building a custom parser over and over again for each command (Diku/Merc) and attempting to write an uber NLP. MOO and COOL come close with the simple pattern matching of Verbs/Prepositions. ColdCore goes a lot further by dropping the notion of Verbs altogether and providing a system where one can define custom pattern matching filters for each individual command. It's the latter approach I intend to follow. And that is to write a "little language" of generalized parsing and apply it individually to every command.

KaVir wrote:

True - the more the better - although I think you have to be sensible about it. I've tried to keep my commands fairly compatible with Diku because that's the background most of my players come from. It'd probably be worth being more LP-friendly as well, but I doubt anyone from a purely MOO/MUSH background would have any interest in my mud, so I wouldn't bother with compatibility there.


There's a great deal of overlap, and there are very few commands that work differently (that is unexpectedly different in negative ways). say is say and arguably communication centric commands on Tinys are more developed than Diku. In cases where commands have different names like @page/page == tell, and the presence of multiple aliases rarely detracts from an interface.

I think the interface issue is a cannard for other expectations. Wink

Bubb logs in.
> kill orc
Huh?
Bubba quits.
Back to top
View user's profile Send private message Visit poster's website
Author Message
kelson76



Joined: 27 Jun 2005
Posts: 30

PostPosted: Thu Sep 29, 2005 10:27 pm    Post subject: Re: Parsing user input. Reply with quote

Dunno....when I look at what you are trying to do....

If you are doing it because you think it would be cool and fun to do, have at it. If you are doing it to enhance the playing experience....

1. There are a lot of muds out there. When I log into a mud, I tend to give it about 5-10 minutes to determine if I like the feel of it. If I'm wading through a new parser interface, I'm alot more likely to move one. A mud with players is always more fun than an empty mud.

2. You are going to alot of work to create a system that is more complex.

3. As a player, if I type out a command like "get the key from the table and unlock the blue lock on the golden door", and I typo one of the "the"'s in there and have to retype it, I'm gonna be pretty annoyed. If I do it alot, I'm going to quit playing.

4. My hand and fingers hurt enough from all the typing over the years. You really want me to type more words that serve very little purpose?

Cheers!

- Kelson
Back to top
View user's profile Send private message AIM Address
Author Message
Teelf



Joined: 12 May 2005
Posts: 21
Location: Seattle, WA

PostPosted: Fri Sep 30, 2005 5:37 am    Post subject: Reply with quote

I am with Greggen on the parser issue.

As mentioned, the standard commands will work: kill orc, get food, etc. You don't have to type articles, but you can if you want to. This is a far better interface for true newbies. They aren't going to get frustrated because they can't 'get the sword', or 'kill the orc'. The main issue raised by many is the ambiguity of long commands, but KaVir pointed out that people rarely use long commands anyway. So how much of an issue is it? I would think the added flexibility of entering short to medium size commands far outweighs the confusion experienced by the 1% of people who try to type a command involving 5 nouns.

Also, the new wisdom in the UI arena is that people are willing to adapt to new interfaces. UI's do not need to be backwards compatible like an API would have to be. Hence things like Google's radically different interfaces and the completely new Office 12 UI. So I do not think people will flee a mud in terror from having to type 'get sword from backpack'.

And if you use (or write) a parser generator that accepts notation for grammar (like BNF), it becomes trivial to do special case commands or classes of commands if people find it confusing.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Author Message
Tyche



Joined: 13 May 2005
Posts: 176
Location: Ohio, USA

PostPosted: Fri Sep 30, 2005 10:52 am    Post subject: Re: Parsing user input. Reply with quote

kelson76 wrote:

3. As a player, if I type out a command like "get the key from the table and unlock the blue lock on the golden door", and I typo one of the "the"'s in there and have to retype it, I'm gonna be pretty annoyed. If I do it alot, I'm going to quit playing.


Believe it or not the user typo problem has known solutions. I'm suprised I haven't seen it integrated into muds yet.


> get teh sword form teh backpck
You get the sword from the backpack.
Back to top
View user's profile Send private message Visit poster's website
Author Message
cron0s



Joined: 13 May 2005
Posts: 34
Location: UK

PostPosted: Fri Sep 30, 2005 2:10 pm    Post subject: Re: Parsing user input. Reply with quote

Tyche wrote:

> get teh sword form teh backpck
You get the sword from the backpack.


I wonder how long before we see a parser like this...

>pwn orc
You swing your sword at the orc.

>orc r teh suk
You curse the foul orc's ancestors.
Back to top
View user's profile Send private message
Author Message
Tyche



Joined: 13 May 2005
Posts: 176
Location: Ohio, USA

PostPosted: Fri Sep 30, 2005 4:06 pm    Post subject: Re: Parsing user input. Reply with quote

cron0s wrote:

I wonder how long before we see a parser like this...

>pwn orc
You swing your sword at the orc.

>orc r teh suk
You curse the foul orc's ancestors.


Some muds allow one to pick and design color themes or skins. Ain't no reason why one couldn't allow the user to pick and design interface themes. Even *shiver* 31337sp33k or whatever it is.

I did a few experiments using two algorithms.

Similarity of backpack, backpck is 0.888888888888889 using Normalized Compression Distance
Similarity of backpack, backpck is 1 using Levenshtein Distance

Similarity of sword, sward is 0.8125 using Normalized Compression Distance
Similarity of sword, sward is 1 using Levenshtein Distance

Similarity of ssssss, zzz is 0.75 using Normalized Compression Distance
Similarity of ssssss, zzz is 6 using Levenshtein Distance

Similarity of the, teh is 0.785714285714286 using Normalized Compression Distance
Similarity of the, teh is 2 using Levenshtein Distance

Similarity of form, from is 0.733333333333333 using Normalized Compression Distance
Similarity of form, from is 2 using Levenshtein Distance

Similarity of flaming sword, flaming sword is 0.916666666666667 using Normalized Compression Distance
Similarity of flaming sword, flaming sword is 0 using Levenshtein Distance

Similarity of flumng swort, flaming sword is 0.666666666666667 using Normalized Compression Distance
Similarity of flumng swort, flaming sword is 3 using Levenshtein Distance

Looks doable. I store my commands in Tries which with a little tweaking should be able to return a set of matches under a given Levenshtein threshold.
Back to top
View user's profile Send private message Visit poster's website
Author Message
Greggen



Joined: 16 May 2005
Posts: 36

PostPosted: Sat Oct 01, 2005 9:05 pm    Post subject: Re: Parsing user input. Reply with quote

Tyche wrote:
Believe it or not the user typo problem has known solutions. I'm suprised I haven't seen it integrated into muds yet.


I like the zork 'oops' command.

> take the sward
You do not see a 'sward'.

> oops sword
You take the sword.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Design All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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 vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign