Five days with a sick 14-month-old at home. It’s time for something fun. I give you the 2009 NFL Predictions.

This year the goal is simple: beat the people who get paid to do this for a living.

Let’s break it down:

AFC

Playoff Teams: Pittsburgh Steelers, New England Patriots, San Diego Chargers, Indianapolis Colts, Baltimore Ravens, Houston Texans.

That’s right, I’ve got the Texans in the playoffs. Their defense is getting better and they actually have some playmakers on offense. Matt Schaub could be another Matt Hasselbeck type of QB in the making.

Indianapolis scares me with the huge turnover on their coaching staff; this team will struggle with the loss of Howard Mudd, et. al. But when you’ve got the smartest QB under center, you can’t count them out.

New England went 11-5 without Tom Brady; I don’t care how many “leadership” veterans they lost – they’re younger and faster, and with Bellichick’s X’s and O’s guiding them they should waltz into the playoffs.

Steelers seem like a lock.

Baltimore finally looks to have a legitimate QB to guide their offense (plus Ray Rice). But mostly I love their head coach, John Harbaugh.

San Diego gets into the post season by virtue of every other team in their division sucks. Hey, I just call it like it is.

As to the other teams…

Tennessee Titans : Kerry Collins turns 37. Does he strike fear into defensive coordinators? I think not. I think we saw the real Titans at the end of last year; they just don’t have enough playmakers in the passing game and now that Albert Haynsworth has moved on to Washington, I expect the defense to take a step back.

Miami Dolphins: Let’s be realistic – they rode a surprise “Wildcat” offense and a 3-interception campaign by Chad Pennington to an 11-win season. They got all the breaks; every fumble landed their way. That won’t happen again. Nine wins would be respectable, but it won’t be enough to get them into the post-season.

Jacksonville Jaguars: Um… Do they have any receivers for David Garrard to throw to? I didn’t think so. Enough said.

Jets: This will be a fun defense to watch because of Rex Ryan, the new head coach and ex-Baltimore defensive coordinator. But rookie QB’s rarely guide their teams to the playoffs. Sure, it happened last year with Matt Ryan and Joe Flacco, but those were the exceptions, not the rule. Plus, as much as I like Mark Sanchez, I just don’t see him being an elite NFL level QB. Call me cynical.

Buffalo Bills: Over-Under on number of weeks before T.O. implodes and the word “cancer” gets used in the media to describe his behavior? I’m going with three. And that might be high.

Cincinnati Bengals: Hard Knocks? They haven’t seen Hard Knocks yet. Believe me, in the same division with Pittsburgh and Baltimore. The pain is coming.

Cleveland Browns: Can we just call a 1o-run mercy rule for them right now?

Oakland Raiders: For the very first time in my life I can understand it if someone starts mentioning the word “contraction” with the NFL. Here’s the prime candidate franchise. I’m not even sure the Raiders could give a game against a top-10 college team. Those of us in Idaho, especially those of us who are University of Idaho alumni, well, we had a pretty good laugh when the Raiders announced Tom Cable as their head coach. Enjoy the circus Raider fans.

Denver Broncos: Best part about their season? Seattle has their first-round draft choice.

Kansas City Chiefs: You have to be optimistic if you’re a Chiefs fan. The addition of Scott Pioli means you finally have a leader at the top of the organization. Someone who knows how to evaluate talent, draft players and sign free agents. Unfortunately, it’s not going to payoff for a couple years.

NFC

Playoff Teams: New Orleans Saints, New York Giants, Seattle Seahawks, Minnesota Vikings, Chicago Bears, Philadelphia Eagles

Rational: Saints had the best offense in the NFL last year, and if the pre-season is any indication they haven’t missed a beat. Sean Peyton continues to be one of the most creative offensive minds in the head coaching business (honestly, as a Seahawks fan, I’d swap and our first round draft pick for Jim Mora any day). The Saints defense has improved; it’s a long way from being great, but we’ve seen, in recent years, you don’t have to have a great defense if you’ve got a great offense (Colts, 2006).

Giants are still essentially the same team that beat the unbeaten Patriots to win the Super Bowl two years ago; great defensive line and bruising running game. Eli Manning has elevated his game past two years.

Seahawks won five straight division titles before – get this – losing four starting receivers, their QB, and their entire starting offensive line to injuries last year. Oh, and Patrick Kerney. Matt Hasselbeck has returned and new offensive coordinator Greg Knapp has given him the shotgun formation (hey, it works for Tom Brady) to go along with new toys T.J. Houshmandzadeh and Deion Butler. Rookie linebacker Aaron Curry might be defensive rookie of the year. Don’t be surprised if Hasselbeck throws for 4,000 yards.

Vikings didn’t need Brett Favre; they were already poised for a deep run in the playoffs. Adrian Peterson is a beast (easily the first player drafted in every Fantasy league this year, and if he wasn’t, it was because the guy picking was stoned or drunk) and their defense makes it difficult for teams to run the ball. Watch out for rookie receiver/playmaker Percey Harvin; the Vikings will find multiple ways to deploy him in the offense and get him 12-15 touches a game. Kid is explosive and gives the Vikings another weapon that can create headaches for defenses.

Bears have a QB in Jay Cutler – finally. Unfortunately his best receiving weapons are both tight ends. Devon Hester still doesn’t look like a polished receiver and there’s rumor that Lovie Smith (who I think is a nice guy, but only an average coach) may not use Hester in the return game so that he can concentrate on being a receiver. Dumb move. But I like this team as a wild card.

Eagles have young weapons (what else is new) and the whole Michael Vick angle to them. But really, like every season for the past decade, their success rests squarely on the shoulders of Donovan McNabb, Brian Westbrook and the defense. With the loss of blitz guru Jim Johnson to cancer their defensive prowess is sure to take a hit. But I like them better than the other options; Wild Card for the Eagles.

As to the rest…

Green Bay Packers: Everyone is high on Green Bay, but I’m not seeing it. Yeah, Aaron Rodgers played really well last year on a club that went 6-10. But they’re transitioning to a 3-4 defense and that always takes 2 years to implement correctly. On top of that, there are reports that A.J. Hawk isn’t living up to expectations; their DB’s are aging and there is a question that Ryan Grant might have been a one-hit wonder at the running back position. With a rejuvenated Bears team and the Vikings in the same division, I’m just not seeing it.

Carolina Panthers: This comes down to a simple fact: I just don’t trust Jake Delhomme. Steve Smith I love, and same with DeAngelo Williams, but overall this just doesn’t strike me as a powerhouse playoff team.

Atlanta Falcons: Their success last year was well deserved. I loved watching them turn their franchise around and honestly, I wish I had Matt Ryan as my franchise QB. Kid looks poised for stardom. But history tells us that young teams like this have a hard time duplicating success. They might get 10 wins and be on the outside looking in come playoff time. But the real key, I think, is Michael Turner. I’m a big Sabermetrics/Moneyball guy, and the stats don’t lie: guys who rush the ball more than 370 times in a season fall off the next year. It just happens.

Arizona Cardinals: They had a magical run last year. And they have arguably the best receiver in football with Larry Fitzgerald. But history tells us that Kurt Warner doesn’t play 16 games in consecutive seasons, and the success of their team rests on his arm. Plus, he lost his offensive coordinator to Kansas City. Mostly, though, I just think Seattle is better all around.

San Fransisco 49′ers: Throwback football. Mike Singletary is going to have them run the rock a lot with Frank Gore. But here’s the problem: this isn’t the same league that Mike Singletary played in when he was anchoring the Bears vaunted defense. As Ron Jawarski is so fond of saying, “Points come out of the passing game.” And the 49′ers don’t have anyone to pass the ball with, and almost no one to catch it either.

Tampa Bay Buccaneers:
They may challenge for the first pick in next year’s draft. They have a great backfield and they got rid of some dead weight when they purged their defense of some aging veterans in the offseason. But the Bucs are relying on Byron “Windmill” Leftwich at QB so they can preserve and groom rookie Josh Freeman. With a new coaching staff and a recent firing of the offensive coordinator, this is definitely a team in transition.

Washington Redskins: Let’s just call this one like it is: Last year was Mike Holmgren’s swan song. This year is Jim Zorn’s. As someone else put it, you’ve got Bill Cowher, Mike Holmgren, Mike Shanahan and a few other notable head coaching candidates sitting out there. It’s going to take a Super Bowl appearance to keep free-spending owner Daniel Snyder from making a coaching change.

Dallas Cowboys: Fans are mad that legendary Cowboy and now current ESPN analyst Emmit Smith predicted that the Cowboys will only win seven games. Problem? Emmit is right. This team is a perennial underachieving unit and nothing is going to change about that while Wade Phillips is the head coach and Tony Romo is reporting to camp overweight and out of shape. This season is going to provide Jerry Jones with all the ammunition he needs to clean house and start over.

Detroit Lions: At the very least, Calvin Johnson now has someone to throw him the ball. Matthew Stafford and Johnson will make this team watchable come Thanksgiving Day.

St. Louis Rams: Hey, at least their baseball team has Albert Pujols.

AFC Championship Game: Patriots over Chargers

NFC Championship Game: Saints over Giants

Super Bowl: Saints over Patriots in the highest scoring Super Bowl ever.

Moon

Where are we?

In the future, where mankind has figured out how to harvest the ore of the moon and use it as a fusion-based energy source. According to the Lunar Industries advertising campaign, this fusion-based energy accounts for 70% of the planet’s total energy consumption. And it’s all thanks to the hard work of people like Sam Bell.

Or more specifically – just Sam Bell.

Sam, played brilliantly by the versatile Sam Rockwell, is at the end of a three-year contract. His job is that of caretaker; responsible for welfare of the automated harvesters that comb the lunar landscape and process the topsoil for the precious H3 ore. Sam’s job is to handle what cannot be automated, which involves periodically rendezvousing with the harvesters when they are full and shipping their ore back to Earth. He passes his time jogging on a treadmill, carving intricate buildings into a replica of his hometown, watering plants, and listening to video messages from his wife and daughter back on Earth. With the exception of his robot companion, GERTY (voiced by the familiar Kevin Spacey in a role that strongly evokes the HAL 9000 from 2001: A Space Odyssey), he’s all alone.

Sam has two weeks left on his contract. He desperately wants to go home and see his wife and daughter. “Three years is a long haul”, he says. We see he means it with every ounce of yearning on his face. The long stretch might be a bit more bearable if it were not for the broken communication system on the lunar station that doesn’t seem high on the priority list for Lunar Industries to fix. Sam is only able to get video messages from his wife via Jupiter satellite relays on tape delay. He’s lonely. It’s time to go home.

The last two weeks on the lunar station should be as boring as the first two. But if you’ve seen the trailer then you know something happens. I will not reveal exactly what that something is, because to do so would spoil the film. The trailer does a good job of creating some ambiguity; there are a few possibilities as to what might have actually happened and keeping the audience guessing, at least for a little while, is a strength of the film.

The “surprise”, however, is revealed fairly early on (and many movie goers will be able to riddle it out anyway), but that isn’t the point: the film is not just about the surprise. The film is about reality, and more precisely our perception of that reality. And our expectations. Sam discovers things about himself that he didn’t know, and it is this discovery – and the way Sam handles this new information – that is at the heart of the film. We might not fully agree with the way Sam handles his situation or the way he reacts to things, but that is because we’re not Sam. We’re different, and our perceptions are different.

Moon is very much a throwback to the science fiction films of old. Director Duncan Jones writes that he is a big fan of films like Outland and Alien; films “where blue collar workers tried to maintain there humanity in dehumanizing, off-Earth environments”. You can feel the influence in every frame of Moon. This is a character-driven film; it’s about emotions and motives and the way people think and behave. And it is simply amazing.

If there’s a downside to Moon, it is that it has such a limited distribution right now. I had to travel two hours to Spokane, WA to see it. I doubt it will play anywhere near where I live by the time its run is over. Which is a shame, because for people who really love film and can appreciate a great story, Moon is something that should be seen. It’s certainly much better than some of the summer’s other science fiction offerings (I’m looking at you, Transformers and you, Terminator: Salvation).

Harry Potter and the Half-Blood Prince

Seeing a book come to life on the silver screen can be a blessing or a curse. The blessing comes when we’re rewarded with a faithful adaptation that manages to reach beyond our own imagination; putting visuals on the screen that leave us in awe; telling the story we’re familiar with in a way that still manages to capture the drama and suspense of the written form. Peter Jackson managed it with The Lord of the Rings trilogy: we cry when Gandalf falls, even though, as readers of the book, we know it’s coming. The flight from the Balrog down the great steps and across the bridge of Khazad Dum is a perfectly executed scene that contains an immense buildup of drama and ends in a painful and heartfelt climax.

The curse is when we’re not rewarded with a faithful adaptation; when the source material isn’t taken seriously; when we’re presented with a story that is not as visually stunning as the one conjured in our mind; when important details are left out of the story and it leaves us feeling cheated and unfulfilled; when scenes that played out dramatically in written form are left to die on the screen, devoid of any real drama or emotion.

Harry Potter and the Half-Blood Prince is a strange mix of blessing and curse; it is a film that looks good and sounds good – it is polished in every way we’ve come to expect – and we think it should be good, but ultimately it falls short of greatness by a very long way. And it is only after we – the readers of the book – have had time to sit back and really digest the film do we realize just how much we’ve been cheated; just how must went missing.

Director David Yates and his special effects crew do a wonderful job of putting us squarely in the Harry Potter universe; we are greeted with all the familiar characters and locations and enough cameo performances to remind us just how big the tale is that we’re following through these six films. But he also manages to delete just about every important detail from this particular story, which leaves the whole thing feeling sterile and (to non-readers of the book) unnecessarily confusing.

I complained about this problem in my Order of the Phoenix review:

While the director David Yates and screenwriter Michael Goldenberg wisely trim the film of many of the side stories and sub plots from the book, it could have used another twenty or thirty minutes of development for the main story. Having read the book prior to seeing the movie, I noticed several scenes in the film that were exceptionally brief almost to the point of being unclear. Some viewers are going to feel like they’re missing out on a larger story (and they are).

Apparently, Yates didn’t learn his lesson with Order of the Phoenix. Harry Potter and the Half-Blood Prince is even more condensed than its predecessor; crucial information that pertains to the main story arc is simply not even presented to the viewer. And it’s a shame, really. Because Half-Blood Prince is easily one of the best Potter books and should have been one of the best films.

Readers of the book will recognize a vast array of missing and incomplete story elements: Harry’s infatuation with the Half-Blood Prince’s potions book that borders on hero-worship; how Harry comes to learn of the qualities of the Beazor that ultimately saves Ron’s life; Harry learning about the origins of the Inferi; Hermoine’s never ending attempts to decipher exactly what “Half-Blood Prince” means and discover the identity of the previous owner of the potions book; the seriousness of Dumbledor’s hand injury; how Dumbledor injured his hand; Dumbledor attempting to figure out how to remove the locket from the water basin… All important elements of the story in the book, and all missing from the film.

And yet, like its predecessor, Order of the Phoenix, so many of these missing or incomplete story elements could have been easily handled with some very simple and effective scenes. An additional 20 minutes of film could have done wonders. I wanted so badly, for instance, to listen as Dumbledor explained the concept of the Inferi to Harry, but that teaching moment never came. I waited patiently with excitement to see Dumbledor riddle-out the answer to the locket and the water basin, but instead the answer pops out of Dumbledor’s mouth about as brutally as it must have landed on the script page.

And then there is the real crime of the film: the ending. The moment of the film when it should have been built up and set upon the audience with the grandest of climaxes, it instead is treated with irreverence. The final crucial scenes had no impact and no weight.

As a grown man reading Harry Potter and the Half-Blood Prince, I wept when I set upon the dramatic ending. I was surprised, completely unprepared for what happened, and utterly saddened. I re-read the ending more than once because of the sheer weight of the drama; it was powerful and heartfelt and it hammered me emotionally. Everything about those final pages was perfect – the build-up, the execution, the final moments. It was all perfectly done, perfectly written by author J.K. Rowling. All David Yates had to do was put it on the screen.

And he didn’t even come close.

Harry Potter and the Half-Blood Prince should have been the best film of the series so far. It could have been – with a few more key moments sprinkled in and an ending that would have stayed faithful to the book, it would have been.

Unfortunately, that didn’t happen.

On a recent project I worked on I had a need to create a client-server application. What I was after was real-time updating of the clients when data on the server changed. These sorts of applications crop up from time to time in one’s career, and they present a unique set of challenges. I figured I’d store the results of my work on my blog, and if it helps someone else then great.

I am not posting the actual application here because it relies on some machine-specific hardware devices, but what I did instead was to extract the core functionality out into a sample application that shows how the duplex service is constructed and how it is used. I created a simple service that contains a list of Movies. The clients have the ability to add a new Movie to the server, or delete an existing one. There’s no fancy business rules or elaborate domain objects because I’m mostly interested in documenting the duplex service usage.

You can download the application here. It was written in C#, .Net 3.5. It utilizes StructureMap for dependency injection (which I highly recommend) and I’ve included that library with the package. The executable files are included in the corresponding /bin directories so you don’t have to compile the application if you want to see it work.

Notes:

  • The server is a console application. It will write to the console when a client subscribes or unsubscribes from the service, and it will print the count of the remaining subscribers.
  • To see the real-time updating in action, open two clients. Add a new movie title to the list in one client and you’ll see the immediate update in both clients.

WCF Duplex Service Contract

A note about this service: You will notice I am passing .Net objects across the wire with this service. There are no data transfer objects and no requirements for interoperability. I have complete control over both sides of the wire; the client and server applications. And in general, when you are writing a client-server app that’s going to be the case. This is not a “web services” solution; there are plenty of those already.

There is a caveat to creating and using a WCF Duplex service: You have to keep the connection open if you want your client to respond to callbacks. With WCF, once a connection falls into a Faulted state it becomes useless, and there’s no going re-connecting. You have to re-create the connection from scratch.

Normally, when using a one-way service, you only create the connection for as long as it takes you to call the service. But here we want our client to actively listen to callbacks from the service (as opposed to polling the service, which puts the burden for updates on the client and can leave the client with stale data). To make that happen we have to utilize a keepalive call with a timer, so that we ping the service frequently enough to maintain the connection. WCF will timeout a connection after 10 minutes of inactivity due to the way the underlying timeout scheme is written, and I have yet to find a single configuration knob that will allow a connection to live longer than that in a reliable fashion. The keepalive, however, works and is rock solid.

My service implements two interfaces. One is for the plumbing associated with subscribing and unsubscribing to the service, and using a keepalive to maintain the connection to the service. The second interface is the one the client is really interested in, and has all the calls to deal with the data. You don’t have to separate these interfaces; I did because it shields the client from having to see those plumbing methods (they can still get to them if they cast want to it).

The plumbing interface looks like this:

[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof (IMovieServiceCallback))]
public interface IDuplexService
{
    [OperationContract]
    bool KeepAlive();

    [OperationContract]
    void Subscribe();

    [OperationContract]
    void Unsubscribe();
}

The second service interface looks like this:

[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IMovieServiceCallback))]
public interface IMovieService : IDuplexService
{
    [OperationContract]
    IList<Movie> FindAll();

    [OperationContract]
    bool Exists(string title);

    [OperationContract]
    void Add(string title);

    [OperationContract]
    void Delete(Movie movie);
}

In both cases I’ve decorated the service interface with the [ServiceContract] attribute and specified the [CallbackContract], which looks like this:

public delegate void MoviesChangedEventHandler();

public interface IMovieServiceCallback
{
    event MoviesChangedEventHandler OnMoviesChanged;

    [OperationContract]
    void MoviesChanged();
}

The only thing that’s left to do on the client side is setup the configuration file where we specify the WCF settings and then implement the interface. I’m not going to post the XML here (you can download the sample app to see it, basic WCF stuff). What I will do is post the relevant code inside the service that deals with subscribers.

Service Implementation

The service maintains a list of subscribers which take the form of the IMovieServiceCallback. The three key methods for dealing with the subscribers are thus:

bool IDuplexService.KeepAlive()
{
    return true;
}

void IDuplexService.Subscribe()
{
    var callback = OperationContext.Current.GetCallbackChannel<IMovieServiceCallback>();
    if (!_subscribers.Contains(callback))
        _subscribers.Add(callback);

    RemoveDeadConnections();
}

void IDuplexService.Unsubscribe()
{
    var callback = OperationContext.Current.GetCallbackChannel<IMovieServiceCallback>();
    if (_subscribers.Contains(callback))
        _subscribers.Remove(callback);

    RemoveDeadConnections();
}

The KeepAlive is the simplest thing; just return a boolean. All we really care about is hitting the service to keep it open, and we do that with the aid of a timer in the client’s proxy (which we’ll get to later on).

Where things get interesting is how we handle the manipulation of data. In a one-way service the client would ask the service to create a new Movie and persist it. Once that operation was complete, the client would then proactively ask the service for an updated list of Movies. The client does all the work in this situation, making the requests. That’s fine for one client, but if other clients want to know when the data changes, they have to poll the service.

With a duplex service we tend to make a request of the service and then forget about it; the service will update us (and every other client) when its ready. So deleting a Movie looks like this:

public void Delete(Movie movie)
{
    _repository.Delete(movie);
    _movieCache = _repository.FindAll();
    UpdateSubscribers();
}

The service delegates to a Repository to handle the delete, updates its internal cache, and then makes a call out to all the subscribers, in essence telling them, “Hey, the data has changed. Update yourself”.

Updating the subscribers then becomes a matter of looping through them and calling the method on the callback interface:

private void UpdateSubscribers()
{
    for (int i = _subscribers.Count - 1; i >= 0; i--)
    {
        if (((ICommunicationObject) _subscribers[i]).State == CommunicationState.Opened)
        {
            _subscribers[i].MoviesChanged();
        }
        else
        {
            ((ICommunicationObject) _subscribers[i]).Abort();
            _subscribers.Remove(_subscribers[i]);
        }
    }
}

We are doing one extra step here: getting rid of delinquent subscribers. You see, there’s no easy, event-driven way to determine when a client has faulted or disconnected in a non-nice way. So the best plan is to periodically prune off bad subscribers. In my service, I do this whenever the data changes, and whenever a client subscribes or unsubscribes. It helps keep the subscriber list clean.

Client Proxy

With the service side of things mostly out of the way it’s time to move on to the client. Here I’ve manually created a client proxy (not using svcutil.exe). The proxy class implements the methods from IMovieService. Beyond the methods on the IMovieService interface, the proxy has a few responsibilities:

  1. Create the DuplexChannel and establish the connection to the service.
  2. Subscribe to the service.
  3. Create a Timer and fire the KeepAlive periodically.
  4. Unsubscribe from the service when shutting down.
  5. Respond to callback events from the server and re-fire them in a chain-of-command style pattern to the client.

Connect handles the first three responsibilities:

public void Connect()
{
            _movieServiceCallback = new MovieServiceCallback();
            _movieServiceChannelFactory = new DuplexChannelFactory<IMovieService>(_movieServiceCallback, _movieServiceEndpointConfigurationName);

            _movieService = _movieServiceChannelFactory.CreateChannel();
            ((IContextChannel) _movieService).OperationTimeout = new TimeSpan(0, 0, 0, 30);
            _movieService.Subscribe();
            _movieServiceCallback.OnMoviesChanged += MoviesChanged;

            _timer = new Timer(60000);
            _timer.Elapsed += TimerElapsed;
            _timer.AutoReset = true;
            _timer.Start();
}

A Disconnect method handles the fourth responsibility. Responding to the service is handled by the MovieChanged event, which simply re-fires it:

 private void MoviesChanged()
{
    if (OnMoviesChanged != null)
        OnMoviesChanged();
}

The other thing that I have the proxy do is make asynchronous calls to the service for methods that I know should be asynchronous. An example is Delete():

private delegate void DeleteDelegate(Movie movie);

public void Delete(Movie movie)
{
    DeleteDelegate deleteDelegate = _movieService.Delete;
    AsyncCallback callback = AsyncCompleteMethod;
    deleteDelegate.BeginInvoke(movie, callback, null);
}

private void AsyncCompleteMethod(IAsyncResult ar)
{
}

When the client makes a call to delete, it’s made asynchronously, and the client can immediately return. The UI doesn’t lock up and life goes on for the client. When the service is done processing the delete it will update the subscribers. That’s when they’ll have to respond in a way that doesn’t lock the UI or crash the program.

Client

In my view’s presenter class I take a dependency on the IMovieService interface. By way of StructureMap, the presenter gets the MovieServiceProxy, and we wire up to it’s OnMoviesChanged event:

private IMovieService _movieService;

public ShellPresenter(IMovieService movieService)
{
    _movieService = movieService;
}

public override void OnViewReady()
{
    base.OnViewReady();
    ((IMovieServiceProxy) _movieService).OnMoviesChanged += MoviesChanged;
    MoviesChanged();
}

The MoviesChanged method just queries the service for the list of Movies (which are conveniently cached in the service, so the service isn’t hitting the database every time a client requests the list).

private void MoviesChanged()
{
    View.Movies = _movieService.FindAll();
}

And this is where the trouble occurs if you don’t handle it correctly. We’ve just had what amounts to a background thread inform us to update our view. If we try and do this directly we’re going to get some unpleasant behavior in our UI. So we let the View handle this properly:

public delegate void UpdateMovieListDelegate(IList<Movie> movies);

public IList<Movie> Movies
{
    set
    {

        if (InvokeRequired)
        {
            var args = new object[1];
            args[0] = value;
            BeginInvoke(new UpdateMovieListDelegate(UpdateDataGridView), args);
         }
         else
         {
             UpdateDataGridView(value);
         }
     }
}

 private void UpdateDataGridView(IList<Movie> movies)
{
    _dataGridView.DataSource = null;
    _dataGridView.DataSource = movies;
}

InvokeRequired is a property on Controls, and it’s a convenient way to determine if the update is coming from another thread. If so, we can launch the operation asynchronously on the proper thread, in this case, the UI thread, since controls in .NET can only be updated by the thread they were created on.

Real-time, client-server type applications aren’t terribly difficult to deal with, they just require a different mindset in regards to when things get updated. And then one just has to utilize the asynchronous tools that the .NET framework has provided to make sure things get done in a way that doesn’t cause your application to hang or crash.

The Ruins

When I was first introduced to Dungeons & Dragons (second edition rules) I created a Ranger. I identified with that particular class because in real life I’m a bowhunter, and the two share many similarities. I thought the idea of a character that could survive in the wilderness, use a bow or swords effectively in combat, and had the ability to track creatures was a neat idea. When I played pencil and paper Dungeons & Dragons, I played rangers. Then the Baldur’s Gate and Icewind Dale games hit my computer, and it didn’t take long for me to realize that the ranger was a completely useless class.

Computer games have inherit limitations in them that make some of the more flavorful classes, like the ranger, more difficult to implement, and thus less attractive. In computer Dungeons & Dragons, rangers became nothing more than weak warriors. The skills that made them unique, like their ability to navigate the wilderness, or track game, couldn’t be properly implemented, and so they were removed from the computer games or severely weakened. This impacted the way I played those games, and thus I never created another ranger. Why play a weak ranger when you could play a strong warrior?

I’ve often wondered what a game might look and play like if it were to do justice to a ranger’s abilities. Now I know. Storm of Zehir is that game.

Storm of Zehir is an expansion to the Neverwinter Nights 2 game. It boasts two new important features:

  1. The ability to create an entire party of characters, a la Icewind Dale.
  2. An overland map that is used for travel, and which makes use of many ranger/druid skills.

Storm of Zehir leans heavily on these two new features. It succeeds because of them, but it is also dragged down by them. This is a game that doesn’t play nearly as well as it should.

For starters, while the game is billed as allowing you to create a full party of characters, similar to the Icewind Dale series of games, it doesn’t quite deliver on that promise. In Icewind Dale you could create a party of six characters. Six slots turns out to be just about the right size, allowing you to create a robust team of adventurers, complete with the necessary rogues, wizards, clerics and fighters. But Storm of Zehir limits your custom party size to four. Any experienced player will tell you that four just isn’t enough.

You are allowed one extra NPC follower. Two if you blow a precious feat slot on a “Leadership” ability. Unfortunately, unlike NPC characters in previous games, the NPC followers in Storm of Zehir are rather bland, and lack any fun or meaningful dialog. There exists no reason bring them into your party other than to fill a character slot, and most players are going to want to create their own characters anyway. Fortunately, there is a simple configuration fix that will allow you to create a full, six-character party. But that it something that should have been available out of the box.

Then there’s the overland map. This is Storm of Zehir’s greatest strength, and also its greatest weakness.

The overland map achieves something that no previous Dungeons & Dragons game has really been able to do. For the first time, abilities like Survival, Spot, Listen, and Move Silently are not confined to the realm of rogues and thieves. These skills are used extensively while your party is on the overland map. They allow your adventurers to avoid dangerous encounters, find hidden treasures, or discover important locations. Finally, it pays to have a Ranger in the group.

On its own merit, the overland map is a successful new feature. The problem with Storm of Zehir is not the overland map itself, but what the developers did with it. Or more precisely, what they did not do with it.

What they did not do is create a big, vibrant world. There are no large cities to frequent, no majestic ruins to explore, no labyrinthine dungeons to plunder. Everything in Storm of Zehir is small and absent of grandeur (or fun, for that matter).

The game plays very much like a Final Fantasy game. And that’s a shame, because the Neverwinter Nights 2 engine is capable of so much more. Like Final Fantasy, your party spends most of its time wandering the overland map, and when it finally does encounter a ruin, dungeon or random group of bandits, the encounter is small (a single zone), and is over in seconds. In fact, I have yet to encounter one dungeon that is larger than a single zone.

The cities are equally pointless. The main storyline sets your party up as a group of traders (a flaw in itself, since you should be adventuring, not establishing trade routes) and so the cities you encounter along the way are nothing more than trade points on the overland map. You can visit the pub or temple of a city directly, but that’s it. There’s no actual “city” to wander around in; there are no NPC’s to talk to, no quests to be had. The cities exist only to act as points of trade. Even the grand city of Neverwinter, a many-zoned metropolis from previous games, is limited to a single zone, and only a portion of that.

On top of the poor utilization of the overland map, Storm of Zehir turns out to be the most bug-ridden of the Neverwinter Nights games. It is overflowing with glitches and broken code, to the point that there is a 29-page post on the official forums full of complaints.

One of the biggest bugs you’re likely to encounter is watching your characters get stripped of their buffs each time they enter the overland map. This presents a problem when you run into your next random group of trolls or bandits, as you will only have enough time to cast one spell before your enemies are upon you. The four or five spell buffs your character might need to be efficient in combat will be missing. Fortunately, there is a player-created fix available. But this is such a huge flaw that it speaks to the quality (or lack thereof) on the Storm of Zehir development team. It’s the type of bug that should have been discovered in play testing and fixed long before the game came out.

The end result is a severely flawed game. Many of the new features, while welcome, are overshadowed by flaws in the game. The trading mechanism is dumb and boring; crafting was “simplified”, making it more of a money sink than anything else; the plot is thin; the cities are vacant entities; the overland map is relied upon too heavily; the encounters are too small and simple.

Storm of Zehir shows that it is not enough to create a cool, new game mechanism, but you have to actually utilize that mechanism to its fullest potential. Final Fantasy VII was released in 1994 and contained pretty much the same gameplay as Storm of Zehir. Hard to believe that after 14 years, we haven’t advanced the genre any further.

There is hope, however. The overland map gives us a glimmer of what is possible with this sort of game engine when used in conjunction with a lot of previously ignored character skills. Here’s hoping that if there ever is a Baldur’s Gate 3, or even another big expansion to Neverwinter Nights 2, that the developers learn their lessons from the failures of Storm of Zehir and build a better game next time. It would be a shame to have to put the Ranger back on the shelf.