/Coffee is Hard

Coffee is Hard


Way back in the 80s, some people had a dream of combining the cutesy graphics of 80s visual games and the soul-crushing difficulty of 80s text adventures. And so Sierra On-Line created quest games.

Quest games started with a premise like “escape the wizard” or “escape the aliens” then forced you to do a series of banal and random tasks to avoid the many, many ways to die. Once you know the way, most of the games can be completed in under an hour. On the first go, it took my whole family weeks. Not the least of the horror was often having to do things several scenes before there’s any reason for having done them: in Space Quest I, the hero-janitor Roger has to refuse the first offer for his bike, so the guy will come back a little later and throw in a jetpack. Of course there’s no indication that he’ll come back with a jetpack, and no reason to think there’s a need for a jetpack until three days later when Roger exits his spaceship and floats into the void because he doesn’t have a jetpack. This leads to replaying most of the game a dozen times just looking for a jetpack, which is hidden not in a spaceship closet or a bar or a cavern, but behind a tough-but-not-too-tough bargaining strategy. It also took about ninety seconds to switch between screens, so exploration was grueling on a good day.

Most treasured memories are agonies that won’t get out of the mind and have to get turned into a character-building story to maintain sanity, so I searched hard for a modern port of these games and immediately inflicted them on my girlfriend. We got through the first two Space Quests in a few hours since I remembered about three quarters of the traps. We haven’t finished the third one. I think there’s a secret code in the credits of a game about chickens. Haven’t floated into the void yet; I assume we will.

After playing the first two, I realized I’d been programming for 17 years and could probably make my own, especially when all the art is 320 pixels wide and that’s about how many pixels I can work with before people give me a sideways look and ask if I really have a liberal arts degree. I decided to base the story loosely on my novel, for two reasons: first, if the game happens to get the kind of notoriety my novel has not, I might be able to boost sales by claiming the novel can serve as a hint book. Second, I spent nineteen years writing that stupid book, and this seemed like a good a way to manage the withdrawal symptoms. Three weeks later I’d built a rendering engine I’m quite proud of, a simple command and scene logic processor, and accidentally reinvented GIF compression.

The was only one thing left to do: come up with ways to die.

The first was an attempt to marry the arbitrary cruelty of the original quest games to the self-destructive lifestyle of the disaffected and depressed characters in my book. Jacob wakes up on the floor. If he tries to stand up immediately, he stumbles and breaks his head open on a desk.

Dead.

He needs more sleep, but if he tries to go back to sleep, he can’t because he’s having a nicotine craving. If he searches, he can find matches to light his last cigarette. Then he can go to sleep, but if he doesn’t put out the cigarette first, the apartment burns down.

Dead again.

If he smokes, puts the cigarette out, and sleeps, he can successfully stand up. As long as he doesn’t try to turn on the computer, he can even make it out of the bedroom.

Feeling confident, I decided to force the player to make a cup of coffee.

I have big plans for death in this game. I’m importing some void and sorcerer deaths directly from the old quests. In the middle of plot, Jacob’s consciousness is transplanted into a ham sandwich, and you have to eat this ham sandwich in the first scene so Jacob’s future sandwich-self reintegrates with his past-self and the game can continue. Otherwise ham-Jacob just rots away in a dark refrigerator. If you don’t put on a raincoat in the beginning, Jacob gets pneumonia and develops an increasingly irritating cough until he drops dead at the beginning of the last scene.

As cruel and obnoxious as this is, it’s simple to program. The hardest part of writing “if rain and not raincoat: jacob.pneumonia = true” is spelling pneumonia. I only have to draw the coughing animation once, and collapsing dead to the ground from pneumonia is just a minor variation on all the other collapses dead I’ve already drawn.

I’m not even going to directly kill Jacob for not having a cup of coffee. I won’t let him put on the raincoat before making it because I didn’t want to do raincoat variations of all the coffee-making mini animations. I had to rewrite parts of the rendering engine to make coffee. There are thirteen lines of code that do nothing but determine what to say when you look at the coffee maker.


'LOOK AT COFFEE MAKER': () => {
  if( State.scene.state.coffeedrunk ) {
    return "The coffee maker has done its job and mercifully drained the
            last life out of the old and savaged grounds."
  } else if( State.scene.state.brewed ) {
    return "The coffee maker has a fresh pot of what is likely coffee in it." 
  } else if( State.scene.state.brewing ) {
    return "The coffee maker is brewing."
  } else if( State.scene.state.waterinmaker ) {
    return "The coffee maker has fresh water in it, and is ready to brew
            a terrible cup of coffee."
  } else {
    return "Makes coffee. Whodathunk? There's no water in it, and you don't
            have any fresh coffee, but the grounds already in there have
            only been used twice and can't be THAT moldy."
  }
}

Does the coffee maker have water in it? Does the pot have water in it? Does Jacob have the pot? Is Jacob close enough to the coffee maker to take the pot? Is the water on? Is he close enough to sink to turn water on? Has he poured the water into the coffee maker? Is it finished brewing? These are all conditions that have to be checked and met. I’ve written more code to make coffee than I generally do to write a login form. Coding coffee is hard.

Since turning twenty-three, I’ve had a coffee-making subroutine in my brain. Writing code to get a forty-pixel character to make it made me think about the ways that subroutine has failed me. Sometimes I don’t pour the water into the coffee maker and end up with a pot of warm water. Sometimes I don’t put grounds into the maker, which also results in a pot of warm water and is indistinguishable from not pouring the water into the maker. Sometimes I forget to close the lid and the coffee maker pours water back into the well until it all evaporates. I have to trust this subroutine because I haven’t had coffee yet, but it only takes one of many potential neurological hiccups to get an error with no log report. It’s not computer code’s fault that making coffee with it is a pain; it’s inherently a pain to make a cup of coffee. I didn’t even get to the cup: I made Jacob drink it right out of the pot to save myself a few steps, and it’s still two hundred lines of code.

After coding death and coffee, this seems right. Avoiding premature death is a process of not occupying the same space as fast-moving metal or motivated microbes. Living is mostly a series of repetitive and unrelated tasks. It makes sense that the most tedious things to code are the tedious things that just have to be done. There are no life lessons or gymnastic skills involved in doing dishes, there’s no underlying theory of housework that will reveal itself after a thousand vacuum cleanings. Making coffee is a boring sequence of steps people feel stupid for getting wrong, even though they’re statistically doomed to screw it up now and then. The hard parts of of life are driving to work, eating properly, flossing, and medicating my disease-ridden yet fucking immortal cat.

I haven’t fought any aliens or terrorists, but I can relate to putting on the right outfit to survive another day in a way I can’t relate to being a bullet-resistant sniper. Sierra’s quest games traced the shape of mundane death, at once leaving out the tedious bits, and elevating simple tasks by giving them purpose in an eventually comprehensible chain of cause and effect. They even offered some decent life strategies: look at everything, pick up anything you can, avoid wizards, and always haggle for jetpacks.

Original Source