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