MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Text Parsing
Albert wrote:
> I'm currently building a text adventure game, with intentions of expanding it into some sort of
> mud server once I master network programming. In any case, I was
Well, you'll probably end up having to rewrite the code nearly from
scratch and heavily overhaul the gameplay to make a mud out of it. But
that's ok, most of us approach our muds as iterative processes anyway.
> Then say the player enter a command like: buy the biggest ball from the 3rd shopkeeper
> The convoluted pseudocode would be:
>
> void Parse(string & rhs) {
> ParsedCommand pc;
> string word;
> while (1) {
> word = GetNextWord(rhs); // Would magically keep pointer position
This'll likely be a problem once you build a mud server due to
reentrancy issues. You have to either make it reentrant or parse the
entire sequence of commands without allowing other player commands to go
through.
> if (word.empty()) break;
> switch (GetKind(word)) {
This is another problem. What if you want to allow "get the knife" and
"knife the innocent victim"?
> I know, this system is hugely inefficient. But I believe it allows the
The biggest inefficieny being that you store everything as strings. A
better approach would be to analyze each word independently first for
classification and tokenization.
--
http://www.classic-games.com/
President Clinton was acquitted; then again, so was O. J. Simpson.
*** NEWBIES: Limit signatures to four lines! No HTML mail or posts! ***
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- Re: [MUD-Dev] Re: Re: [MUD-Dev] Text Parsing, (continued)
- [MUD-Dev] Text Parsing,
Albert thecheezeman#earthlink,net, Fri 28 May 1999, 18:51 GMT
- Re: [MUD-Dev] Text Parsing,
Kylotan kylotan#kylotan,force9.co.uk, Fri 28 May 1999, 21:08 GMT
- Re: [MUD-Dev] Text Parsing,
Greg Miller gmiller#classic-games,com, Sat 29 May 1999, 00:51 GMT
- Re: [MUD-Dev] Text Parsing,
Mik Clarke mikclrk#ibm,net, Sat 29 May 1999, 21:14 GMT
- Re: [MUD-Dev] Text Parsing,
Travis Casey efindel#io,com, Mon 31 May 1999, 03:34 GMT
[ Other Periods
| Other mailing lists
| Search
]