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

Friday, April 22, 2011

Main weapons: Fear, surprise, and unflinching determination to get done

Finished sunsets!  I even solved the mysterious bug where occasionally the sky would turn bright white for a couple turns.  Or an hour.  (It turns out that my algorithms for color work very well within parameters, but trying to blend 147% of one color with another borks it proper.)  I also weeded out testing comments that hadn't gotten taken out before.  By all means, add testing comments, but a reference as to which extension they're in, or where they're running from, is a *really* good idea.  Especially if it's just printing a random variable that you can't directly search for.

Also, you know how everyone tells you to comment your code?  Turns out that it can indeed be helpful.

Not so good stuff: I've been trying to layer sprites in on the Canvas Editor that comes with Glimmr.  Unfortunately, the screen is too small, and the control is sort of fiddly - it's tough to get things lined up, or get a good feel for what things will look like in-game. 

Now that it's down to hand-placing individual sprites, I'm reconsidering my options, because typing out code and adjusting the placement via coordinates for hundreds of trees is slow, tedious, painful, boring, and just not very compelling on either a process or a results level.  (It's boring to do, and looks bad when I'm done, basically.)

What to do?

- Create view in Photoshop, and import umpteen individual sprites from there.  (Super convenient on the "I don't have to place stuff via coordinates front, but incredibly wasteful spacewise - each 50-100 px sprite would carry with it tens of thousands of empty pixels.
- Create view in Photoshop, randomly glom trees into a couple layers of full size, and go from there.  (Still convenient, although the glomming bit would require some care.  Less space wasted.  Less uniqueness, since we'd be down to however-many layers rather than individual trees.  Less flexible - if I change the shape of a hill or something, I'd probably need to redo a layer of trees entire, rather than just bumping individuals down or up a bit.)
- Screw the trees - people like grasslands, right?

I'll probably do a mix of the above - a few trees will get handplaced, but most will probably be lumped together into layers, and those'll probably be less central than they were.  I wish I knew more about artistic principles of composition.

Take 2 this weekend.


  1. The plan of having some trees conglomerated into single sprites, combined with some individual floaters to add variety, sounds like a good one--both for performance and labor investment reasons.

    I wouldn't even consider wasting acres of empty pixels just to have an origin of 0,0 for every element, though. I'd encourage you to take another look at the Glimmr editor. I honestly think that it is a much better tool for this particular purpose (compositing coordinates) than Photoshop. Of course, it's not a native app and bumps up against major UI limitations in Glulx, but it will ultimately save you a lot of time. I'm willing to bet that you will get past the fiddliness as you get used to using the tool.

    More concretely: Did you notice that you can zoom the editor to a 1:1 scaling ratio at will? (There's a little magnifying glass icon by the tabs in the control panel.) I find that this, plus using the nudge keys, really helps in placing things quickly.

    Also, as far as lining things up goes--if you actually want to abut things, there are commands for automating that operation. Probably not what you're after in this case, but available nonetheless.

    If that still doesn't work for you, you *can* grab the coordinates from Photoshop, but it's much more fiddly, as you have to hover your mouse over the upper left pixel of each sprite, regardless of whether or not that pixel is transparent.

    If you have Illustrator, though, grabbing the coordinates from a composition there can be easier than in Photoshop, since you can select the imported PNG and see its outline. You won't get a nice table at the end that's ready to plug into your source code, but it's better for this purpose than Photoshop.

    Anyway, it sounds like most of the hardest work is behind you. Good luck finishing up the rest!

  2. Hmm. No, I didn't notice that. And I hunted for one! Oops. I'll take another look.