Design and documentation journal for my interactive fiction (text games); also reviews and other miscellaneous stuff.

Monday, February 14, 2011

Recursive Loop in Three, Two, One . . .

Took me five minutes to write an infinite loop, and twenty to write in a serious bug that took me an hour to iron out completely. 

Early findings: an hour is not a long enough time to go hunt something.  With that, there's only time to go one or two places.  The default is two hours now, and I might bump it up to three.  Looking and moving around are the big time sinks - actually fighting is essentially timeless. 

Rates for encountering fairly frequent creatures like deer are around 1 per 3 hours, which is a bit high, since I haven't implemented all the trail checks I'd like to.  (As of now, the game runs the odds for finding an actual animal, followed by the odds of finding tracks, followed by the odds of finding a den, followed by the odds for finding other evidence.)  I could fix the issue by implementing a simple "check to see if the PC finds some evidence", followed by deciding what kind of evidence is found.

The numbers I'm getting are a *little* difficult to match up to real world data, since the game picks prey instead of just sending the PC randomly through the forest to see what's encountered.  (That is, the sort of animal you run into is set before you start out.)  On the surface, at least, that's not an insane proportion; the Wisconsin Deer Hunter Survey of 2009 (pdf) indicates that a range of .14 to .31 deer per hour is normal.  So I might need to ratchet the numbers down a bit, but it's not terrifically awful.  Northern forest areas have less deer, less farmland, and more wolves, which suggests that deer might not be quite so numerous in places where there's no free lunch, so that might be the number to aim for.  Also, because of the way prey is picked in-game, there's fewer encounters of deer than usual, which may well balance out the higher results when the game goes looking for one.

It's kind of amazing how quickly a few combinations of random numbers obscure actual stats.  There is an actual, hard-coded chance to find and kill a deer, but it would be a real job figuring out what those actually are.  Mostly, I collect data via the Recompile and Recount Method (tm). 

Also, the Deer Hunter Survey reminds me that I totally forgot about gamebirds.  I remembered turkey once, absently, weeks ago, but I've been really caught up in mammals.  Hunters were spotting just about as many turkeys as deer. 

What really surprises me are the other animals.  Overall, the odds of spotting a wolf are about 1/100 hours, which seems really high.  I'm not a biologist, but I would have guessed that wolves are rare, relatively shy, and sneaky.  The data could be inaccurate, of course - wolf-like dogs aren't that unusual, and beer is consumed on these trips, but still.  To put this in context, you're about as likely to see a wolf as you are to see a red fox, ten times more likely to see a wolf than a possum, and three times more likely than a raccoon. 

That just seems . . . off.  Have I done too much mythologizing of the rarity of wolves?  Was there some pack who followed a bunch of hunters around all season and skewed the data for the rest of the state?  The data hasn't been adjusted to account for size, mobility, or diurnal habits, but . . . yeah.  Huh. 

But in good news, I've got the beginnings of a framework to hang text on.  (I need to do attacking and clean up non-tracking clue finding.)

No comments:

Post a Comment