Writing a video game

I’m spending my spare time writing a video game. Not for the first time, although more successfully this time than in the past, because I’m writing features instead of frameworks.

The features I’ve worked on so far are all features that I can see at work. Things like:

  • Make a little guy in the middle of the screen.
  • Make a room for him to stand in.
  • Make him walk around, a square at a time (no smooth animation).
  • Add more rooms, and portals for moving between them.
  • Make the hero move smoothly from one square to the next.
  • Make him move his feet as he walks.
  • Add a wandering NPC to one of the rooms.

But some of the features I’ve written, while visible, don’t contribute to gameplay. I have an NPC wandering around one of the rooms, but I don’t know why he’s there. He doesn’t contribute anything to the game yet. So I’ve shifted my focus. My current list of features (several pages long) is basically divided into two categories: plot-driven and geek-driven.

The plot-driven features are those that are doable in a reasonable amount of time, and that add visible value to the project, i.e., end-users could see the program doing something it didn’t used to do. I.e., user stories:

  • Make a throne room with a king.
  • Make a world map with a castle and a cave.
  • Make a cave with a bad guy and a princess.
  • Have the king ask you to rescue his daughter.
  • Show a fight screen when you reach the bad guy.

The geek-driven features are the shiny toys. They’re the intriguing challenges for me as a coder. But I have no idea when, or whether, some of them would actually become visible in the app, which means they’re sucky user stories:

  • Support bridges you can either walk across, or walk under (i.e., different walkable “levels” within the map).
  • Make rooms that you can’t see into until you walk into them (as seen in Final Fantasy I).
  • Load and save maps to/from XML.
  • Make a map viewer/editor app.
  • Implement coroutines for the hero, NPCs, and cutscenes.

What I haven’t figured out is how to balance my time between the plot-driven and the geek-driven features. The plot-driven features are essential; if I don’t keep making visible progress, I’m going to lose interest. But the geek-driven features are… well, shiny. If I don’t spend at least some time working on them, I’m going to lose interest!

My tentative plan is to spend about half my time on plot, and half my time on geek. We’ll see how it goes.

Control.Invoke, BeginInvoke, and InvokeRequired

I just ran across an article by Justin Rogers explaining Control.Invoke, BeginInvoke/EndInvoke, and InvokeRequired in depth.

This is not light reading. But there are some interesting consequences to the way these things are implemented, that I wouldn’t have expected. (E.g., Invoke doesn’t just invoke a single delegate, even if you call it from the UI thread: it actually adds your delegate to the queue, and then processes the entire queue.)

Five rules for keeping an empty GMail inbox

I was getting ready to leave work yesterday when I happened across an article that someone had been reading in FireFox. I’m not even sure who had opened the page (we don’t have individual computers), but I sat right down and read it start to finish.

Now all I need to do is do it. Here’s the article: Five simple rules for keeping an empty (GMail) inbox.

TMS component to show/emulate the Vista Task Dialog

Vista has one cool new feature, which is their Task Dialog. It can show text and standard buttons, just like MessageBox, but it can also show hyperlinks in its captions, custom buttons at the bottom (“Save” and “Don’t Save”), radio buttons, large buttons with explanations on them, a checkbox, a progress bar, and an expandable area. Basically it replaces all those custom MessageBox-like dialogs that we’ve all had to write to get a decently usable UI. Here’s detailed info on how to use the Task Dialog in Vista.

Unfortunately, the Task Dialog is only available in Vista, which means that nobody can actually use it in programs until the whole world has moved on from Windows 2000 and XP. Third-party vendors to the rescue: TMS Software has a TTaskDialog Delphi component that will show a Task Dialog when you’re running under Vista, and will create a normal dialog with the same features (though not quite the same aesthetically-pleasing layout) in XP and earlier. They’ve got screenshots. Check it out.

Anyone aware of any .NET libraries that will let you call out to a Task Dialog on Vista, and/or let you simulate a Task Dialog on XP and earlier?

Magic in the making

Wow. That Inverse Ninja Rule really got things going.

For one thing, my Humorous Fantasy novel is actually starting to be humorous fantasy. That’s what I intended when I started this year; my first novel, “The Littlest Evil Overlord“, was humorous fantasy, and it turned out pretty well; and humorous fantasy accounts for most of what I enjoy reading. But this year’s novel had, up to today, been far too serious in tone, and I didn’t know what to do to fix it. (I blame that on having too much thought and effort invested in writing an outline beforehand. That doesn’t mean I’ll never write an outline in the future, just that I’ll have to figure out how to be careful about it.)

For another thing, I just did an almost-5,000-word day. 4,823 words today, to be exact. Which brings me to a 4,823-word weekend. Sigh.

And I managed to tie in things that I had already mentioned. Architectural features that I had written about earlier in the month suddenly became important to resolving a scene. A tiny bit of conversational color I had thrown in on a whim, now served as fuel for a moment of self-doubt — and, in fact, made a good-sized part of the scene nearly write itself.

In other words, my novel is starting to reach critical mass. The magic is starting to happen. I’m glad I decided not to give up this year. It remains to be seen whether I’ll finish on time, but I’m making some pretty decent progress (if I can keep it up), and the story is really starting to fall into place.

Over breakfast tomorrow morning, I get to write about the interview with the captive busty lesbian pirate ninjas, and watch the pirate monk captian try to explain the one that got away. Stay tuned.

10,000

I just passed 10,000 words for my NaNo novel. (Of course, I’m supposed to be at 20,000 by now, but who’s counting?)

And you know, sometimes procrastination pays off. I had decided that a bunch of pirate ninjas were going to drop in and attack the pirate monks’ ship, ’cause, you know, that’s what ninjas do. But they can’t actually kill or capture the heroes, right? ‘Cause that’d mess up the plot.

But when I was surfing Wikipedia looking for info on ninjas, I discovered the Inverse Ninja Law. Hah! Not only did that save the plot, it even got me extra wordcount, because I got to explain it in a footnote!

Just yesterday, I was thinking about giving up on NaNo for this year. Even now, I have no idea whether I’ll have any chance at finishing on time, since I know there will be days I won’t be able to make the 2,215 words per day that my progress report tells me I need. But you know, when things start going right, this thing is fun!

Okay, back to finish the fight scene.

Bond villains and boiling sharks

Embrace your inner James Bond villain! Add a vat of boiling sharks to your novel!

(I Googled “vat of boiling sharks” and came up with only two results, neither of which is the page I was looking for, so I’m once again Googlebombing the mundane. So next time, I’ll be able to find the comic straight off. Today, a comic strip… tomorrow, the world! Mwa ha ha.)