home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / system / 14126 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  2.7 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!saimiri.primate.wisc.edu!ames!agate!apple!apple!NewsWatcher!user
  2. From: dowdy@apple.com (Tom Dowdy)
  3. Newsgroups: comp.sys.mac.system
  4. Subject: Re: How does Dark Side "Kitten" work?
  5. Message-ID: <dowdy-161192075138@90.10.20.25>
  6. Date: 16 Nov 92 15:57:51 GMT
  7. References: <1992Nov11.062814.6916@usage.csd.unsw.OZ.AU>
  8. Sender: usenet@Apple.COM
  9. Followup-To: comp.sys.mac.system
  10. Organization: Apple Computer, Inc.
  11. Lines: 45
  12.  
  13. In article <1992Nov11.062814.6916@usage.csd.unsw.OZ.AU>,
  14. timm@spectrum.cs.unsw.oz.au (Tim Menzies) wrote:
  15. > Puzzled about how Dark Side "Kitten" works. I thought it was simple random
  16. > number generator for the wool and another one for the kitten that
  17. > random selects one of N behaviours (sit, run, catch...). BUT, the
  18. > Kitten module is the SECOND LARGEST of all the Dark Side modules. So,
  19. > is it (shudder) replaying a set of canned scenarios???
  20.  
  21. Well, the utimate source is to look at the code (available, check out the
  22. docs for details):
  23.  
  24. But I'll give you the algorithm (as I remember it).  The kitten attempts
  25. to stay "close enough" to the ball to check out what it's doing.  The
  26. kitten will run until it gets to a point where it thinks that the ball
  27. is "close enough" (in pixels).  At that point, the kitten (satisfied that
  28. the ball won't attack it from behind, no doubt) goes through its "resting"
  29. motions (lick, scratch, lie down, sleep).  The behaviors are always in this
  30. order, but it's random which one it will start with.  If the ball
  31. exits the "safe area" the kitten will startle, wake up, and go after
  32. the ball again.  Repeat.
  33.  
  34. The ball motion is just a basic x and y velocity with a "damping" effect -
  35. plus a random wiggle each move.  After some random amount of time, the
  36. ball is given another "kick."  I suppose I could code in other ball
  37. behaviors, but this one was the simplest to do.
  38.  
  39. The reason Kitten is so large is just all those darned bitmaps.  Which
  40. brings up an interesting point.  Faders like this are mostly artwork
  41. rather than code - so if any of you out there have interesting artwork
  42. to contribute, I'd be more than happy to do a fader.  I've been wanting
  43. to do a "fishtank" and some kind of "flying kitchenware" for a long time -
  44. and I have all of the code I need to write it.  But I'm not an artist
  45. (as if you couldn't tell from most of the DarkSide pictures :-) ) so I
  46. haven't bothered to work on these modules yet.
  47.  
  48. > Can't sleep at night. Someone tell me soon. Alternatively, can someone
  49. > give me Tom Dowdy's email (author of Kitten)??
  50.  
  51. Right here.
  52.  
  53.  Tom Dowdy                 Internet:  dowdy@apple.COM
  54.  Apple Computer MS:81KS    UUCP:      {sun,voder,amdahl,decwrl}!apple!dowdy
  55.  20525 Mariani Ave         AppleLink: DOWDY1
  56.  Cupertino, CA 95014       
  57.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  58.