31 Things, Day … oh forget it

31 things I'd rather be doing right now

what_happened

Yeah… guess we’re done, huh? Well, it was fun while it lasted.

So that’s another thing I’d rather be doing now, not this blog series.

31 Things, Day 20: Admiring an aquarium

31 things I'd rather be doing right now

My mom bought a 10 gallon aquarium when I was in the seventh grade. We kept a few tropical fish barely alive for a couple months, and every couple of months would replace the poor dead fish with new ones. We really had no idea what we were doing, and thus did just about everything wrong.

Fast forward fifteen or so years, and I floated (ha) the idea of owning an aquarium to my wife. I told her that I would do all the research, would get everything used on ebay (found a local pickup), and a few months later we had 37 gallon aquarium in our apartment. She was hesitant not so much for the expense, but the reason – why? Hard to say, really. They just look beautiful, even cute. Even soothing.

Vitaro Aquarium, circa 2005

The actual Vitaro Aquarium, circa 2005

But owning and and maintaining an aquarium is not a simple hobby. There’s lots of things to consider: best fish for your water pH, fish that play nice together, maintaining water temperature with the ebbs and flows of your own region’s climate, the type of filtration, chemical testing to be sure nothing is out of balance, weekly water changes, monthly tank cleaning, proper feeding so every fish gets something, dealing with ich…. it’s a lot to keep track of, and becomes more of a chore than something fun rather quickly.

And even though we were doing all the right things, no fish we owned lived longer than one year. Was it the quality of the fish we were buying? Were we too lax in our fish mixing? Should we have had a quarantine tank like the book suggested? We don’t know.

When we moved into our first house 7 years ago, the fish had all died a month before, and we agreed not to replace them, to make the move easier. The empty (smelly) tank came with us to the house, but stayed empty, in the basement, for several years. Then the kids came, and when they were toddling around, they got into everything. I kept picturing them knocking the aquarium over, and I just couldn’t bring myself to setting it up again. I wouldn’t care about the water damage and dead fish, I was more afraid of the kids getting hurt. We eventually gave the tank and stand to a friend for his bearded dragon.

Poor Gourami, we hardly knew ye

I do miss those platys, gouramis, rasboras, guppies, corydoras, and tetras we once had. They were soothing to watch. Maybe someday, when the kids are older and can contribute to maintaining it, we’ll get a nice big aquarium, and keep some larger fish like an oscar cichlid. Until then, we’ll have to settle for the local Petsmart.

So that’s another thing I’d rather be doing now, admiring an aquarium.

31 Things, Day 17: Read more nonfiction

31 things I'd rather be doing right now

Note: Amazon Affiliate links below

Although I prefer fiction over nonfiction, I find it’s good to read a couple nonfiction books every year to keep myself educated about something real. Also, it helps mix things up a bit.

Over the past few years the topics I’ve read about have been varied:

  • A lot of books about writing, so that I can becoming a better writer. The two best so far that I can recommend are Stephen King’s On Writing and Larry Brooks Story Engineering. Both have totally changed my mind about what it means to be a writer, especially in the creation and the architecture of a story.
  • Books about being a better husband and father. After all: happy wife, happy life. Seriously though, I strive to remind myself of how to be a good servant leader of my family, and these kinds of books help me do that. Recommended: His Needs, Her Needs, Bringing up Girls, and Bringing Up Boys
  • Books about understanding myself better (not exactly self-help, but has that flavor). Some notable ones I’ve read lately are Seeing Through Cynicism, and Quiet: The Power of Introverts in a World That Can’t Stop Talking
  • Books that are just interesting based on my own hobbies or career, such as software engineering (Want to learn to program Java in a fun way? Head First Java)

I’d like to read some history books and biographies, but haven’t gotten around to it.

Currently I’m reading a book that is blowing my mind apart (and scaring me quite a bit) that talks about how Artificial Intelligence will be our last invention – and then it will kill us all. That is, unless we make AI very carefully, which this book hopes to convince AI programmers to do. It’s called Our Final Invention: Artificial Intelligence and the End of the Human Era. That’s not ominous at all. But it’s also very interesting.

ourFinalInvention

So that’s another thing I’d rather be doing now, reading more nonfiction.

31 Things, Day 16: LARPing

31 things I'd rather be doing right now

LARP stands for Live Action Role-Playing, where a group of people get together to play a game by acting out characters. They dress up, and really try to be someone else for a little while. It’s like a play, only improvised; it’s like a game with rules, only people are the playing pieces.

So yes, it’s considered incredibly nerdy, but LARPers themselves consider that a badge of honor.

LARPingMotivator

Full disclosure: I’ve never actually participated in a LARP before, nor have I even seen one in real life. And honestly most of me doesn’t want to. It’s a really weird activity that takes playing a game a bit too far, and the people who are regularly involved in it are kind of … intense.

But you know what? I’d be lying if I said I never wanted to try it… because a little part of me wants to. Makes sense, right? I like games, I like acting, I like fantasy worlds. It could be fun. But… I’m 35! You know, an adult! I’m all for imaginative playtime among children, but… adults? Really? Wow.

Yeah, I think I still want to try it.

So that’s another thing I’d rather be doing now someday. Maybe. LARPing.

31 Things, Day 15: Programming

31 things I'd rather be doing right now

There is something very satisfying for me about programming. I’m specifically referring to coding here; it’s part problem-solving, part art. The problem to solve can be small (make this mess of text into a nice table), or big (make a game).  The art part is the design of the code “building blocks” that will work together to make a computer program. The term used among programmers is “elegant code,” and I think it is an apt word. If you can create some code that can be reused for many things, both now and in the future, you just saved a lot of time. You never have to touch it again, because you know it works. I love that.

Take this example from my own game code, which I find to be very elegant, (if I do say so myself). A tile-based game is a grid where objects can move in any direction to a tile next to it. Sometimes an object can’t move for various reasons, maybe it’s blocked by a wall. In any case, a game needs to be able to handle an object moving from one tile to another.

2dgame

 

When I first made my Heroquest game, the code handled moving objects very specific to the game. I would never be able to use the code again, because it was very closely tied to only that game. Later, I discovered I could refactor that code and make it reusable. In order to do that, I had to completely generalize what was happening when an object moved from one tile to another. It doesn’t matter if the game is Heroquest or Monopoly or Sorry!

This is what I came up with:

When a pawn wants to move in a certain direction, follow these steps

  1. Does the pawn meet the prerequisites to be able to move in the first place? If no, do something else because they are not met. Otherwise, continue
  2. Are Diagonal moves allowed? If no, does the pawn want to move diagonally? If yes, do something else because diagonal moves are not allowed. Otherwise, continue
  3. Does the tile the pawn wants to move to exist? If no, do something else because the tile can not be found. Otherwise, continue
  4. Is the tile the pawn wants to move to accessible based on where the pawn is now? If no, do something else because the move is blocked. Otherwise, continue
  5. If you got this far, the move will now happen:
  6. Process/do the physical move itself
  7. Evaluate the ramifications of the move to the pawn, the surrounding area, and/or the whole game itself
  8. Do any post-move processing (clean up, things that always happen at the end of a move, etc)

Now I had a skeleton framework to make some reusable code, and I could use it any game I wanted. Here is the actual code:

public void move(TileOccupier pawn, Compass dir) {
  if (movePrerequisitesMet(pawn))
  {
    if (!(!diagonalMovesAllowed() && dir.ordinal() > 3))
    {
      AbstractTile targetTile = 
        tileMap.getAdjacentTile(pawn.getLocation(), dir);    
      if (targetTile != null)
      {
        movePreProcessing(pawn, pawn.getLocation(), targetTile, dir);
        if (tileMap.isEnterableFromOppositeDirection(targetTile, dir) ||
          ignoreTileBoundaries(pawn, dir))
        {
          processMove(pawn, pawn.getLocation(), targetTile, dir);
          evaluateMove(pawn, pawn.getLocation(), targetTile, dir);
          movePostProcessing(pawn, pawn.getLocation(), targetTile, dir);
        }
        else { processMoveBlocked(); }
      }
      else { processTargetTileNotFound(); }
    }
    else { processNotAllowedDiagonalDirection(); }
  }
  else { processMovePrerequisitesNotMet(); }
}

Not that long at all. And the way it works is that any game I make in the future will be able to use it because it is abstract. I simply have to make some concrete decisions about what happens in the particular game at the various stages of the move. (For example, one game may yell at you when try to move diagonally; another game may do nothing at all.)

For the non-programmer types reading this blog, this post may have been boring. But whenever I look at that code above – something I made all on my own – I think, “wow, that was a really elegant design.”

And then it makes me want to go code something!

So that’s another thing I’d rather be doing now, programming.