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

Friday, July 29, 2011

Evolution Game

So, yesterday, in the middle of The Blind Watchmaker, I thought to myself: "Self, someone really ought to make an evolution simulator."

Dawkins wrote The Blind Watchmaker in 1986, and there's a chapter where he "evolves" various shapes on the computer.  I did something vaguely similar later (not with shapes, but behavior).   You can get some pretty shapes from selection and random variation, and he mentions that he'd like to do a computer simulation and hopes to see if the flowers end up looking like the bees. 

Fortunately, someone else seems to be working on it.  On XNA, one of the platforms I was considering during the "oh crap what was I thinking going with IF" crisis.  It's an interesting project, and reading through the dev blog is at least two hours' worth of procrastination on deciding whether I should chuck in some non-native fish to give a little variety.

Wednesday, July 27, 2011

Grass and Fish

 Right, so exciting visual stuff first.  Here's the experiments for the ground in the winter, when grass is dead, but there's no snow on the ground.  To make it easier to see, I'm only experimenting with one layer.  The back layer of grass is far enough away that there probably won't be many changes.  Here's where I started, with some smooth curves - bare ground.

This looks sort of "Flash animation-y", which isn't really a bad thing per se, but not what I was going for.  Plus, grass doesn't really disappear in the winter - it only dies off.  So I went for a desaturated, shorter version of grass, using a single grass brush with a bit of size variation and scattering.

(That's the alpha release version.)

So from there, I want to add a little texture, a little variation.  It's not there to startle or distract, but I want a little . . . I don't know what the right word is.  Movement, maybe?  Variation.  So I added a bit of wind, and used a longer brush, and I didn't brush over a pre-existing curve.  I followed the same line, but didn't past the solid over the grass.  As a result, it feels less forced and more organic.  I am not entirely happy with the way the grass breaks about 15% from the right-hand side, but I figure a carefully placed tree will solve the problem.

Better, I think.

But there's still not much variation in the silhouette.  What if there's another kind of dead grass?  Leftover seed stalks or something.

I like this quite a bit, but I want to emphasize distance, and give a little further variation.  A few up-close clumps is a chance to vary color and shape.  I made the color variation pretty slight, just enough so I could differentiate the bigger stuff from the farther away stuff.

I'm not entirely happy with this; the wind isn't right, and I'm kind of ambivalent about the two-tone grass layers.  (And I have no idea how to treat the grass under snow-fall.)  Nor am I sure whether it will compete too enthusiastically against the other elements.  I do think the windswept look is an improvement, though.

A pretty quick mock-up, but that's the graphics front these days.  It gives me an excellent chance to play eye doctor: Better one, or better two?

Click to enlarge.  Now with upgraded cliff and fake grass on the oak tree for that "not pasted on yay" look.  Also experimental like whoa.  And adding blue and making the cliffs darker turned it strangely colored. 
A complicating factor is that it's easier to do dead grass than live grass; my experiments with greener hues have not gone quite as well. 

In equally exciting news (but with fewer pictures), I think I've ironed out the action flow for fishing.  Checks are run to make sure that the player's got the right equipment, and in the right place, and isn't being eaten by zombies (metaphorically speaking). 

Each room that the PC can fish in has some basic properties that limit the fish that are there.  Catfish like warm, slow water; trout like it cold; sturgeon like it deep.  A list of available fish is compiled (or maybe it's pre-compiled).  The odds for each fish type are modified by complicating factors: if the fish are hungry, if the PC is fishing with a kind of bait the fish eat, etc.  If the odds are nil or close enough, the action is ended with a rejection and advice. 

If they're not, the table is randomized, and the odds are checked every few minutes (10? 15?  20?) until one of the fish bites.  From there, it's reminescent of 2nd Edition AD&D saving throws: PC vs. fish. 

The outcome is created as a sentence or two, and a result is tallied: was the fish eating, hooked, landed?  A little extra time is deducted for each of these steps; if there's time left on the clock, the fishing loop will continue.

Afterwards, a summary is printed, with the specifics of one or two battles given a gloss, or the overall tallies turned into something more comprehensive.  (Did the PC get all his bait eaten with no hooks?  Did the PC's experience start bad but improve, or vice versa?  Was there a wide spread, or mostly failure/success?  Is the PC desperate for food or is this more likely to be a pleasure jaunt, and is the PC hungry *RIGHT NOW*?)  It's not a load of conditions yet, but it's enough to give a little variety to the fishing outcome, which is welcome.  (One of the sad things is that there's really never enough variety in the terms of things the program will print out, but even small variations makes it feel less dead.)

One of the things I'm trying to do as I finish actions is define when it would be appropriate for the game to suggest it as a course of action.  Based on fishing conditions, I'm thinking spring-fall around sunrise, or evening if chores are done. 

Once pre-alpha's filled in a bit, I'd like to do an auto "go to nearest fishing spot" thing, and a more sophisticated "when's fishing appropriate" thing, and definitely a "spear fishing" action and some special scenes where the PC can land a monster catfish or something, but I'm trying to skimp a little more on the detail to cover a bit more ground before circling back around. 

Thursday, July 21, 2011

Graphics - Alpha Changes

 A bunch of people were kind enough to download 30 mb worth of example graphics, look through them, and give feedback.  One of the background layers is off by a smidge; I'm having the devil of a time figuring out where the break started.  (It's likely to be unnoticeable in-game, but it's irritating me.)

There's some tree placement issues, and I noticed (although no one else mentioned it) that some of the trees were putting little semi-transparent white boxes around themselves, with the result of strange white lines running through the screen.  So I need to go in, erase all those, move some trees around, and reconstitute them into one layer.

All that's pretty straight forward fix-it stuff.

Less straight forward: the cliffs have some issues.  I took out the layer of trees on the cliffs, added some extra shadows, and experimented with a gradient to add some variation.  (Thanks to Erik's wife, and Erik, who passed on the suggestion!)  I also shifted the whole thing darker and a little bit blue-er.  It looks less like limestone now, but whatever.  I'm having some serious issues getting the gradient to fit properly over the cliffs, though - there's either a little extra overlap, creating weird shadows, or not enough overlap, which limns the cliffs with a sliver of brightness.  As a result, the cliffs look extra painted on.  I think finding the right curvature for the gradient will help; a straight vertical isn't really ideal.  I think a couple layered gradients in different directions will give the right effect; for now, it's experimentation.  (I'm pretty happy with what I've got, but before I go through to fix the borders, I want to make sure I have it right.)

Much harder are some complaints about the grass; in parts, it's a little "bald", and you can see the shape of the curve that I textured, and not everyone is thrilled with either the monocolor or the static texture or the particular color choices.  I haven't been particularly thrilled with my efforts to add color to the grass itself; the flat color recedes, but the texture pops, and given the texture of the trees, it's sort of painful.  I do think it will be possible to vary the silhouette, which will help some.  I'm wary of tacking on too many extra layers; we'll have to see how it runs, but flowers or something might also break the monotony.  It's actually kind of difficult to do a genuine layered look with various plants (see: trees),  but it's worth a try.   Preliminary results from just brushing up the shape are encouraging. 

One of the close-up trees has gotten a lot of comments, too, mostly with no easy fix.  I'm still kind of poking at it.  Some parts, like the canopy shape, are easy, if tedious, to experiment with, and probably worth doing.  But things like the trunk are much harder, since it was made using a brush and my trunk-art is near nil.  I think it's possible that the trunk is too dark/saturated, which is fixable, and I can back the contrast back some, but a complete trunk remodel probably isn't in the cards. 

I also want to try bluing out some of the distant trees a bit, and seeing if that increases the illusion of depth.

- No one complained about the clouds, which is great, because they're hours and hours of really nitpicky work.  Hallelujah.
- No one complained about the rain, which received a last minute tweak or six.
- No one suggested more tree variation, which is good, because I'm a little tired of trees at the moment.  (All in all, there's about 250 deciduous trees, all duplicated, scaled, and placed by hand.  Each of those has 11 to 13 layers, which had to be turned on or off by hand to merge the layers.  About 10% of those were given custom tweaks on top of that.  Plus there's 20+ conifers, which only have two layers.  I still have a tertiary merge to do to get things right, but if I never look at another trunk sprite again, I will die content.) 
- The general goals (season/weather info) were conveyed adequately, and in most cases excellently. 
-No one protested the snow, either the active "it's snowing" screen or the snows on the trees/ground, with the exception of the tree that's already slated for an overhaul.  (I still can't believe this, since my patented "put snow on trees" process consisted of a blurred brush and tracing with my mouse.  Yay, though, because hours of work.)
- No one commented one way or the other on the slight variations in sky color - slightly purple in the spring, green in the fall, and less saturated/lighter in the winter.  Which means that it wasn't too much of a leap.  (It's pretty obvious if you've got the animation open and can directly toggle on/off one color or the other, but it's harder to catch otherwise.)

So: overall, I feel pretty good about it, and no "back to the drawing board with you!" moment.  No one noticed that towards the end of the tree placement process, I got impatient and duplicated a bunch of groups.  It's interesting that I can see the group division lines pretty clearly still; I'm hoping once I go away for awhile, I'll lose that recall, and it'll all just become one pretty mass. 

I'll put up before/after comparisons once I've got some options I'm happy with; in the meantime, if you haven't taken a look at the alpha graphics, and want to, you can download here. Gentle criticism welcome, here or at the email mentioned in the description at the download site. Someone suggested putting the game title over the graphics line; I'm reluctant to do that, but let me know what you think. 

In other news: Fishing!  I know, I know, I really should have wrapped it up months back while it was fresh, but I didn't, so now I get to wade through a mass of uncommented experimental code.  (I did this once already, and promptly saved over it.)  The game will now put together a fishing rod for you.  It's *very* alpha - it automatically provides an earthworm for bait, even in the middle of the winter or if you're in the middle of the lake, but you know, that can wait.  I'm tweaking the Table of Fish at the moment.  The completionist in me is sort of sad there's only a handful of species, but getting info on non-sport fish species is pretty much impossible, so the player's stuck with the usual trout, bass, catfish.  (There's about 13 permutations and species, but a few of those are pretty rare.  Trout, bass, and catfish cover a good 60% of the options.)

Fun fact: I am SO glad I never figured out where I wanted to put a river in the landscape.

Friday, July 15, 2011

Design Diary, July 15

Materials is a little better, but not totally.  I'm trying to nail down the Table of Excessive Properties into just a few useful qualities.  Does it burn?  Does it break?  Does it decompose?  Those are the biggies, but plenty of minor issues are coming up.  For instance, burning implies that the material feeds the fire.  I'm basically doing this by weight - for every pound of straw or wood or cloth or paper you put into the fire, the fire will burn for X minutes.  (I considered a more complicated scheme involving BTU's, but then I got better.  This is close enough for almost everything, and the exceptions are not things the player is going to run across often.) 

I'm also struggling with the names for materials where there isn't really a material.  Glass, wood, metal, leather: all pretty straight forward.  But what about stuff like linen?  It's made of . . . linen, but there's no point in having linen be a dramatically different kind of material than cotton or silk.  Fiber?  Cloth?  Hair?  Bonus question: what is a pumpkin made out of?  (It cannot be plant or vegetable; those are taken.)  Flesh is what I'm leaning towards for animals and people, although it's a little weird.

So, basically, there's substances, which are values, and each substance has some properties which determine the qualities of the object.  This sounds crazy, until you calculate the difficulty of determining the difference between a wooden jug and a ceramic jug, and then it looks pretty nifty.  Of course, in real life, there are ways to make wooden objects less flammable, etc. 

I have not quite figured out all the coding complexities with things like candles, which should burn and feed the fire, but also be essentially non-flammable, but also be on fire sometimes and able to set other things on fire.  Original design plans called for calculating light levels for various activities, but that feels fiddly and unwieldy now.  If the PC only has one candle to read by, then by golly she's going to read by a single candle.  I would like to strongly encourage the PC to sleep at night and work during the day, or at least have a regular schedule.  If any light is as good as every light, that sort of hurts the whole schedule thing.  (Lumberjacking by the light of a single candle is where I draw the line.)  Light that isn't the sun is relatively precious, both historically and in-game.  You can make candles, which takes energy, time, and precious materials.  At some point, you'll be able to press oil from a few foodstuffs, but it requires equipment, quite a lot of the foodstuff, and time at a point in the season where it's a precious commodity.  I'd like light to be a precious resource to be carefully conserved, and without artificial constraints, that's a bit harder.  It may very well be something I need to let go of.

Also did a bit more slogging on the graphics front.  Bare ground - that is, winter ground not covered by snow - was formerly a smooth set of curves the color of dirt.  I bumped that up to dead grass.  I don't have the color balance fully fixed yet - it's a bit fiddly getting the right look - but even the current stuff is improved.  I need to do something with snow, too - the smooth curves are a little too artificial.  I keep trying to get nice snow drifts, but it's actually quite hard.  I think I need some shadows and blur, but can't quite visualize what I should be doing.  Next attempt is going to involve highlighting the "crest" of the hill, trying to get some of that crisp reflective feel, and a blurred brush to soften the edge between hill and horizon for that soft feel. 

I also did a seasonal merge with the first load of trees. Good golly, it's a lot of clicking.  (Each tree needs to be actively toggled each season, multiplied by 11-ish seasons.)  I'm also doing some cheating by leaving some trees in the season before/after the one I'm toggling to.  It provides more variation in color overall, and saves me a little time.  I've grown to appreciate conifers, which only have a "normal" and a "snow" layer.  Stupid deciduous forests, with their seasons and their leaf dropping.  But it's worth it to be able to click through the layers and see the seasonal progression. 

Thursday, July 14, 2011

So Tempting

I wonder if I have the nerve to name my game Apocalypse Plow.

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.

Tuesday, July 5, 2011

Better Living Through Design Documentation

I'm still feeling off about FTA - frustrated and reluctant to jump back in.  I wonder if it might be better as a full-on graphical game, which I think is just a sophisticated attempt by my subconscious to get me to ditch my current code, but I don't know for sure.  And looking at my documentation, a lot of it is under-detailed, incomplete, or outright missing.  This compounds the difficulty that the document is half-electronic, half-paper, and not organized in any particular fashion.  In short, shoddy work.  Which was fine, for a while.  But I can't really skate by not knowing exactly what my material or crafting system will look like.  I know the shape of the thing, but that's not concrete enough, and writing around it is just not adequate.

It's hard to know what's stress-induced depression - I haven't had more than five hours of sleep a day in more than three weeks, and I haven't had access to hot water or a functional kitchen in two - and what's good insight into what needs to get changed. I don't *want* to learn a new programming language to try to implement FTA, much less struggle with collision events and mouse clicks and save states.  I don't even know which language would be most appropriate.  Would it be a better game?  I just . . . I don't know.  I don't even know how to go about answering that question.

So I'm pulling back a little, again, and trying to locate and merge a bunch of documentation.  It's been going okay on half-assed documentation, but that's not good enough anymore.  The game's too big, and too system-based, and there's too many references between systems - it needs things laid out, and I need to be more diligent about saving all my research notes in one place.  I probably won't stop implementation entirely - I do best when switching between tasks - but I do plan to cut back, take a look at what I have, and clearly map out the underlying first draft of the game.    

(Since I first wrote this, I actually looked a bit at what it might take to implement as a non-IF game, and, uh, yikes.  C# is really, really not as appealing as Inform.  Not that I don't have wallbanger moments/hours with Inform, but yow.  Steep learning curve.  And I can make no progress at all with . . . well, with pretty much any of the helper platforms.  Graphics is hard, y'all, and so is trying to switch from action-oriented to object-oriented.  Also, I totally remember what I like about writing for IF.  50 animals do not require 100+ meshes and textures and animations and things.  No, they just require a few sentences.  Also, I got a full eight hours of sleep last night, and feel like maybe life is okay, after all.

Still, it goes in the design journal, because what is a design journal for if not existential crises and whining?

Also also: that design document: I should work on it.  Maybe at a restaurant, since my kitchen sink is still bubbling ominously.  Damn landlords.)