Joe White’s Blog

Life, .NET, and Cats


Archive for December, 2006

Writing a video game

Sunday, December 31st, 2006

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

Sunday, December 31st, 2006

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.)


Joe White's Blog copyright © 2004-2011. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS). Privacy policy