Sunday, December 7, 2008

Red, White, and Blue


It can be found here.

I feel comfortable with Silverlight now and will be releasing a few "How To" articles for people interested in the technology. That said, the actual game didn't turn out as well as I had hoped, but I do think the map control, the one that features the zooming of the States, came out pretty slick.

So do I continue on this project, or move on to another one? Normal d-roc fashion would have me bury yet another failed project, and tackle something new. What will happen this time?

Wednesday, December 3, 2008

Regarding Coding Tutorials on Blogs

I was reading an article about the Model-View-ViewModel design pattern when I noticed a comment which sparked my rage against an all-too-common pattern I've observed in recent years:

If you're doing WPF development, you really need to check out Dan Crevier's series on DataModel-View-ViewModel. Right now there is no easy way to read through all his posts on the subject without navigating through them using the calendar control on his blog.

With the prevalence of increasingly easier blog services like Blogger or Wordpress, anyone can be a publisher.  Unfortunately some have used these services (with little additional customization) for purposes they are not well-suited for.  While we may likely contradict this post at some time in the future, I'd like to express my increasing annoyance with blogs that post coding tutorials.  A blog is a much-less-than-ideal medium for hosting coding tutorials. 

Why?

For one, when I'm looking for coding tutorials, I want them categorized.  I want to be able to easily sort through XNA Game Studio SpriteBatch tutorials or WPF TabControl tutorials.  With blogs, your posts are time-based.  They are generally consumed in much the same way a newspaper or magazine is; you don't often reach for an old issue of a magazine or a newspaper from a few months or years ago.  You use them to get recent information about topics of interest.  Blogs are designed around this assumption as well.

Now admittedly, a blog is orders of magnitude better for retrieving archived information, but the filtering mechanism is still subpar.  The best that you can reasonably hope is that the blog author applied an extensive and thorough use of tags, which certainly isn't something you can count on, and is often completely arbitrary.  (I can write an entire article about the problems with the hacky "tags" system so prevalent these days.  In fact, I'm struggling to come up with an adequate set of tags for this post.)

Instead, developers should separate their tutorials and their blog posts.  Perhaps services like Blogger should (if they don't already) easily facilitate categorized articles.  Google seems to be on to something with their Knol system, but I imagine there's a better way.  Speaking of Google, it seems that currently most tutorials are found by searching for a particular topic, and trusting that relevant archived developer blog entries will appear in the search results.  Thankfully, Google tends to pick up the slack where the blogging system falls short.  But it shouldn't have to be this way.

Tuesday, November 25, 2008

Coding Vacation '08: Bad Timing

Several weeks ago I took the initiative and committed to something that went against my conventional patterns of behavior.  I decided that I would spend some vacation time devoted primarily toward developing software -- my personal projects, of course.  In the back of my head, I heard voices telling me that this was not an acceptable justification to take vacation time.  Vacations are for trips or visiting family, they said.  But, much like the thought processes that steered me toward the video game industry rather than business apps, the thoughts compelling me to take this vacation won in the end.  I announced my plans confidently to my friends and family, as if asserting it this way would protect against any criticism.  And, well, I didn't receive any.  In fact, I only received support.

My girlfriend, of course, saw this as an opportunity to spend more time with me every day.  She is currently unemployed, so she has a lot of free time.  It's very difficult to make the argument that I need to spend so much time doing things alone on my computer when I have a rare opportunity to spend extra time together, but she seemed to understand.  Of course, that didn't stop her from coming over often, inevitably leading to a lot of time spent away from coding.  Much of this time was spent with her playing the newly released World of Warcraft expansion: Wrath of the Lich King.

I can't blame her for this; I always want to play, and I have to keep myself at least somewhat disciplined.  It just makes it so much easier to play when I have someone to play with.  Between my uber druid and my hopelessly gay mage, there's so much fun to be had; so many hours to lose.

image image

For the past week it's taken all my energy to avoid getting completely sucked into the grind.  I have to reach level 80.  I have to purchase an epic flying mount.  I have to obtain uber gear, etc.

To make matters worse, I'm leaving to visit my brother for Thanksgiving tomorrow.  Don't get me wrong, I love visiting him, but it's more time spent away from coding.  Compounding this is the fact that he plays World of Warcraft as well, and I'm giving him the new expansion pack as a gift.  Nevertheless, I'm bringing my Mac Mini and an LCD monitor with me tomorrow.  Yes, I'm a little bit crazy.

Despite all of this, I have made significant progress on my app, but there's much to be done.  I will talk more about it later when I feel less reserved about it.

Thursday, November 20, 2008

Red, White, And Blue Logo


Some say, it's amatuer. Screw those guys.



Tuesday, November 18, 2008

Oct 31st == Nov 30th && Shared plans == win!

So much for that beta by Oct 31st. I've had a lot of petty life things distract me from what's important: Red, White, And Blue! It is coming together though and I have high hopes. There are some interesting obstacles involved with keeping many clients in sync (quasi sync at least), and all the bugs that can occur when you have a client that loses sync with the db.

I have a really annoying issue where a browser's cache will prevent users from downloading a new client, so should I rename my client on every update just to trigger a download? Sounds clumsy. I don't think I would like old silverlight clients pinging my services either, so will I have to check a version string on every login? Seems so.

I am relying on the fact that all of my WCF sessions will exist in the same AppDomain, so I can use a single static to keep track of users. Risky and clumsy, I know, but I'm already stretching the capabilities of a shared hosting plan about as far as possible. I don't know many websites on shared hosting plans using WCF services, Ajax style PollingDuplex binding, Linq2Sql , hosting silverlight. This stuff came out last night (pretty much), so I've been happy with how much I can get away with on a shared hosting plan.

It really is a tribute to the computer industry when you can get so much power for a measly $100 / year hosting plan. This is our one up on any other industry: the low barrier of entry. Can you even imagine something similar in the auto industry? Investment banking? The factories, connections, and brown-nosing needed to do the most trivial things in other industries makes me love my field that much more.

See you next Sunday and have a happy thanksgiving!

Sunday, October 12, 2008

Red, White, and Blue

The final title for my web game, slated for an oct 31st beta. Three parties, three colors: red, white, and blue. I decided to pull back on the plot in an effort to stay out of politics, we don't need half-assed political dialogue in a budget web game prototype (v2?).

The next piece of tech I would like the exploit is Silverlight's Polling Duplex support. Similar to the "AJAX Push" or "HTTP server push", this technique, coined Comet by the web community, allows one to emulate packet "Pushing" in the browser, without having to face the hurdles of socket programming, policy files, and blocked ports. I'm pretty excited about it's capabilities and it's ease of implementation with WCF and Silverlight. Although it won't be enough for any serious real-time multiplayer communication, it'll be "good enough" for most scenarios, especially those found in a turn-based world.

As a side note, does anyone have a problem with dandruff dirtying up their keyboard?

Tuesday, October 7, 2008

XNA Game Studio Coding Jam, Fall '08

I recently signed up to attend an event for developers and artists which allowed them to collaborate on an almost-released build of XNA Game Studio 3.0 and build a game in a short amount of time. When I signed up, I was under the impression that this event took place on a Saturday and lasted all day long. It wasn't until last Friday afternoon that I got an Outlook Calendar reminder which corrected this false assumption, informing me that in fact it was an all-weekend event.

Reluctantly, especially given the time and energy I've been devoting to iPhone development recently, I bit the bullet and told myself that this was an opportunity that I didn't want to pass up.

The event consisted of an Iron Chef-style "five ingredients" challenge (also similar to gamedev.net's "elements" programming contests), in which we picked from randomly generated lists of game elements from which we derived a game concept. We quickly formed into groups, each containing (thank the Lord) an artist, and tried to pick the most appealing set. The elements we chose were Doom, Clock, Robot, Pirate, and Defense. Our game: Doom Clock Robot Pirate Defense.

DoomClockRobotPirateDefense2

As an aside, it's funny what goes on in my head when I have to choose team members in a short amount of time. Ultimately I'm looking for enthusiastic, motivated, skillful people who are also mellow (i.e. no Prima Donnas). Obviously it's impossible to gauge this in such a short amount of time, but I was fortunate with my group.

We ironed out the basic details of the gameplay Friday evening, and began our implementation bright and early Saturday morning. (Seriously, it still amazes me that I was able to show up on time at 9am on a Saturday.) Much to my great concern, we opted against using source control, and instead agreed to use a memory stick as our repository. Yikes. In retrospect, I bet I could have created an actual SVN repository on that thing. It wouldn't have been perfect, but it would have likely eliminated many headaches.

It quickly became apparent that our lack of source control was a very bad idea. Nearly all of our changes involved multiple shared files, and the process of merging was very manual, and very confusing. We essentially had four different versions of the code floating around at any given time, and it became difficult to tell whose changes were the newest. Instead of merging to the USB stick, team members would often just copy the changed versions of their files to a separate folder on the stick, making it nearly impossible for me to tell when a line from the USB stick's code was newer or older than what the programmer had copied to the new folder. Suffice it to say, it was a big mess, and I'll write it off as a reminder of why source control is so crucial.

Our artist, Chris, was hard at work from the very start. I regularly glanced over at his drawings and wished I had that ability. I also envied his lack of need for any sort of source control solution. We'd call out when we needed art assets, and I was tempted to ask for something completely ridiculous just for the fun of it, but I restrained myself. I really like the opportunity to work with an artist on a project for several reasons. First of all, I'm much more inspired to work on a project when I have visual gratification at regular intervals. I may be able to create intriguing gameplay without an artist, but I don't really believe it until I see it. As soon as I see appealing illustrations and animations, that's when I first start to feel the real potential of my project. Second, it's a great experience to discover the processes needed for a functioning content pipeline. What format should my images be in? What size? Should each frame of an animation be a separate image or a large composite image? What if the composite image isn't a square; will the texture importer complain? Questions I may not have even considered are suddenly an important part of the process, and this experience makes future projects go much more smoothly.

DoomClockRobotPirateDefense

After a couple full (but not overly burdensome) days of coding, we ended up with a fairly playable prototype. It contained several types of enemies with AI, three different types of towers, several levels, a controllable player, collision avoidance, a snazzy menu system, support for the Xbox 360, and even same-box multiplayer. I added all the code to a repository which I shared with the team, and I've even seen significant updates from one of the developers in the past couple days. I am tempted/eager to clean up the code, since ours was inevitably very messy and arbitrary, and just enough to "get the job done." I am almost as much a Code Nazi as I am a Grammar Nazi. (Although seriously, I don't think that avoiding "u" in place of "you" and knowing the difference between "your" and "you're" qualifies me as a Grammar Nazi; that just means I have at least a third-grade education.) I just think there's something inherently selfish about writing bad code if you're on a multi-person team, but I'll save that soapbox rant for later.