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

Monday, July 11, 2011

A Matter of Time

Okay, first of all: sleep is awesome, y'all.  Does everyone know about this?  Everyone should know about this.  Life is SO much better when there's sleep.  The game-related depression isn't entirely gone, but it is much diminished, along with the tick in my right eyelid.  And the vestiges of sleep deprivation feel strangely like motivation.

So the issues with the time mechanic don't look so bad from here.

Right now, I'm using a modified version of Weather, by Ish McGravin, to give structure to time.  Weather gives you a Day, Month, and Year variable, and then pulls necessary information for a given date from a table.  It's not bad at all, and have let me just drop in a calendar with no real adjustments needed.  I've got a whole load of scenes, as well, like During September and During Spring.

What it *doesn't* do is track actual dates.  There's no easy way for me to compare Day 1, Month 5, Year 1 with Day 6, Month 6, Year 1.  So if you're trying to compare distances between times (days to harvest, days to Christmas, days since you last ate), things are really, really awkward. 

There are workarounds.  Instead of giving food a literal date as an expiration date, I can just count down the amount of time until it spoils.  I have a lot of reference tables holding statistical data, so I can actually tell you what rainfall has been like in the past week or so, the last month, the last year, etc.  But it would still be nice to compare dates, and to be able to measure how long before or after Date A is from Date B. 

The other sticky bit is that Ish had to do some workarounds with the code, so Month 1 is December.  Which is not the usual assumption I go on, and means that you can't just write a phrase that easily measures time between dates.  I think the Month 1 = December choice came from the moon phase code, which I haven't fully unpacked yet.  (Okay, I only sort of glanced at it once.)  You can write that phrase, of course, but every time I sit down to do it, I can't quite fully wrap my head around the implications. 

Ideally, I would want an actual date value: X/Y/Z, which would make comparing dates considerably easier, and make it trivial to give things dates, or put dates as triggers.  I'm not sure whether it would be possible to literally trigger events ("Now the lamb grows up in one year from now;"), but "Now the maturity date of the lamb is 5/5/2" is easier to read than any of the alternatives. 

Replacing the current date system would mean having to change the triggers for pretty much every seasonal scene, plus a lot of other weather code.  The introduced bugs could be non-trivial.

Of course, I could mesh a date system *over* the current one.  I am not sure it's the smartest option, but it would allow me to the current meta stuff in place, and use dates for the everyday object interactions.  And it would let me move forward, retrofitting all the weather/scheduling stuff as necessary.

1 comment: