Zarfplan: And that was November
Saturday, December 1, 2012
Tagged: interactive fiction, zarfplan, zarf, if
Plan for the month: get all the shortcutting code finished, before the end of the month. Result: it's 11:59 pm on November 30th. Drat! But it is finished. Pretty much finished.
Sometimes code is painful. Sometimes code don't want to be written. That is to say, sometimes you just don't wanna write it. I am no more immune to this than the next hacker. Maybe the next hacker has a better strategy, but I try to get some progress made every day, and not think about the looming mass of progress I haven't made. Eventually the looming mass shrinks, and that's what's happened this month.
Why was this painful? Just an annoying collection of cases, all of which have to be handled differently, with guards against infinite loops and other such game-creating failures. See, there are shortcuts for going places, finding objects, and creating objects. Sometimes finding an object means creating it; sometimes it means going to where it is. And then there's the distinction between checking if a goal is possible, and actually carrying out the goal. None of this is conceptually difficult, but I have to get the code structure right, which means some false starts and then rewriting once I have a clearer idea of all the requirements.
The "pretty much finished" qualifier is because I haven't polished the output of this module yet. I type "CREATE IONIZER", and the game replies:
You open the beta-door. You make your way to the Maze-Alpha. You take the phaser. You shot the alien! You make your way to the Maze-Delta. You take the ion widget. You tinker together an ionizer.
This is perfectly readable but it's inelegant. I'd rather display this in paragraph form, skipping the less-important details:
"You open the beta-door, shoot the alien, take the ion widget, and tinker together an ionizer."
Stitching together sentence fragments in I7 is moderately tedious. The mutable-string operations you expect in a modern language are possible in I7, but inefficient. (The leaden weight of Inform's history, which dates back to Infocom's Z-machine, which had no dynamic allocation at all). So I prefer to avoid that and instead muck around with a lot of state variables: have we just had a period or a comma? Hokay, capital letter time. Tedious. Not difficult. I'll get it set up eventually.
All of that business with the ionizer and the phaser is a test case, of course. The system works for the actual game objects too, and I have a bunch of those implemented. But since none of the game locations exist, I can't finish those shortcut rules yet.
Thus, the goal for December: create the map. Scary! Of course I've had a map drawn out for months, but it's slightly abstracted. (I may wind up splitting some rooms to improve the pacing, for example.) And a lot of the less-critical game objects are vaguely labelled "in quarters" or "in one of the labs" -- these are things which are easy to find, but the exact location is a matter of pacing, not puzzle gating. So I haven't nailed them down yet.
December will be a month of nailing. Hopefully by New Year's Eve, I will have an actual game structure to walk around -- rooms, locked doors, and puzzle barriers. There won't be any descriptions or game text; that will take much longer. But, even walking around the house-of-cards will be exciting.
I have another secret IF-ish project which should appear December as well. It's very small, but hopefully will amuse some people. More news when it's less secret.