home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / rec / arts / intfict / 939 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  3.5 KB

  1. Xref: sparky rec.arts.int-fiction:939 rec.games.int-fiction:931
  2. Newsgroups: rec.arts.int-fiction,rec.games.int-fiction
  3. Path: sparky!uunet!think.com!ames!pasteur!cory.Berkeley.EDU!librik
  4. From: librik@cory.Berkeley.EDU (David Librik)
  5. Subject: Slow noun resolution in TADS
  6. Message-ID: <librik.722498219@cory.Berkeley.EDU>
  7. Keywords: tads slow noun resolution
  8. Sender: nntp@pasteur.Berkeley.EDU (NNTP Poster)
  9. Nntp-Posting-Host: cory.berkeley.edu
  10. Organization: University of California, at Berkeley
  11. Date: Mon, 23 Nov 1992 05:56:59 GMT
  12. Lines: 61
  13.  
  14. I dropped Mike Roberts, the author of TADS, a note about the problem
  15. that it takes a long time to deal with a "door" if there are a lot of
  16. "doors" in the game.  He sent this back to me: thought you would find
  17. it interesting if you are using TADS.  (I don't like either of his
  18. solutions -- I wish I had more control over the parser.  I'd like to
  19. be able to say, for specific words, how they should be matched.  But
  20. certainly the "create a floating object" method would work fine for
  21. a lot of doors -- you just keep track of their open/closed states yourself.)
  22.  
  23. - David Librik
  24. librik@cory.Berkeley.edu
  25.  
  26. -------------------------------------------------------------------------
  27.  
  28.   Unfortunately, the slow door problem is still in 2.0, since the
  29. parser is largely unchanged.  The problem is that the parser starts
  30. off by finding every object that answers to the indicated name, then
  31. calls <verb>.validDo for each one.  When you have twenty or thirty
  32. objects matching a name, it ends up calling a lot of validDo methods
  33. before it decides which objects should even be considered.
  34.   I've considered changing things so that it goes the other way - the
  35. verb would produce a list of objects that are acceptable, and the
  36. parser would run through that list looking for words that match.  This
  37. would definitely speed things up (a lot) in these situations where you
  38. have a lot of objects with the same name, but it would probably slow
  39. things down (a little) most of the time.  It might be a reasonable
  40. trade-off.
  41.   There are a couple of workarounds.  The easiest is obviously to cut
  42. down on the number of "noise" objects that use the same name.  Another
  43. is to choose slightly different objects; in "Deep Space Drifter", we
  44. intentionally had to start inventing new types of controls when we found
  45. that we had too many damn buttons; so we started using switches, levers,
  46. touch pads, and so forth.
  47.   However, if you really need to have tons of objects with the same
  48. name, there's a hack that lets you deal with it - especially when the
  49. objects are basically noise.  What you do is create an object with
  50. a non-fixed location; it shows up in any room that's appropriate,
  51. based on the player's current location.  For example, in Deep Space
  52. Drifter, the sixty-four swamp plants are all a single object with
  53. a location property defined like this:
  54.  
  55.     location =
  56.     {
  57.       if (Me.location.isSwampRoom) return(Me.location);
  58.       else return(nil);
  59.     }
  60.  
  61. The swamp plant doesn't really exist anywhere, but it will always
  62. look like it's in the same location as the player whenever the player
  63. is in a swamp room.
  64.   The same thing could be done with doors:  just define a property of
  65. each room that contains a door and check that.  Of course, this wouldn't
  66. work if the objects had to be different; however, if many are identical
  67. with a few different, you could use this trick with the identical ones
  68. to cut down on the disambiguation time.
  69.  
  70. --Mike
  71.  
  72. PS - feel free to post this note or a summary in r.a.i-f, if it would
  73. add to the discussion there.
  74.  
  75.