Archive for February, 2007

This post is going to be longer than it needs to be. If you want to skip the backstory, just jump down to the section labeled How To Build XNA Games With Regular Visual Studio.

I originally started college as an Electrical Engineering major. That didn’t happen because I had affection for EE, I just happened to be good at understanding that sort of stuff and I figured the degree would get me a good paying job.

Then my mom bought a 486 DX2/66 and installed X-Wing from LucasArts. I was enthralled by the game and what computers were becoming capable of doing. About a year later I had to take an intro to programming class as part of my base curriculum as an Electrical Engineering major, and I was hooked. I instantly “got” programming. While people in my class floundered to understand the concept of a fixed array I was trying to figure out how to make Tie Fighters appear on my screen and blow up. I switched my major immediately to Computer Science.

A couple years later I tried to recreate the isometric engine from Diablo with (at the time) the latest version of DirectX (6). I was mostly interested in learning the API and graphical programming, but building that engine also taught me a lot about isometric games, 2D sprites, drawing algorithms, optimization and things like the “A-Star” algorithm (which I used for pathfinding so my little barbarian could walk around the screen).

I desperately wanted to be a game programmer. But life happens, and we make choices based on things that are really important to us. I knew what it would take to be a game developer; I’d have to move to a bigger city, my wife would have to leave her family and the job she liked, and I’d have to start at the bottom and work my way to the top. I wasn’t certain my marriage would survive such a thing; my wife is very attached to her family and our living location. With everything else that goes on in life it just wasn’t the kind of decision I could make. And so my career as a game developer died quickly and with little fanfair.

XNA Appears….

A week ago I learned that Microsoft has released a new framework called XNA. It’s designed to make developing video games for the PC and XBox 360 easier, especially for “hobbiest” developers. I’ve spent the past week examining XNA and working through some very good tutorials on the internet. XNA is a neat thing. It has completely renewed my interest in game programming.

There’s just one problem: Currently, the XNA Game Studio Express only works with Microsoft’s Visual Studio Express. You cannot write XNA Games on Visual Studio Standard, Pro or Team System. Joe Nalewabau of the XNA team explains the reasons for this decision.

This bothered me on a few levels.

My biggest gripe is that you can’t install a lot of 3rd party tools with Visual Studio Express, like ReSharper. I can’t imagine any professional developer today who wouldn’t have a tool like ReSharper plugged into their IDE. I was blown away when I read Dave Weller’s blog, the Game Developer Community Manager for Microsoft, and found out he only has Visual Studio Express installed on his machine.

I’ve had ReSharper installed for several months now at work, and like the wheel, television and the internet, I simply can’t live without it. Writing code without ReSharper is like trying to watch TV without a remote control, or trying to drive a vehicle without power steering, or trying to plan a cross-country trip withoutYahoo Maps. Sure, you can do all of those things given enough time, patience and Advil, but why?

The other major gripe I had was that I didn’t know this before I went out and spent $250 on Visual Studio Standard edition. As soon as I found out Visual Studio Express wouldn’t handle ReSharper I had to go get a real IDE. It arrived today in a nice Amazon.com box (side note: can Christmas compete anymore? I get more thrill from the Amazon.com boxes that arrive at my house than I do from Rudolph wrapping…) But it wouldn’t open or compile my XNA game.

But that doesn’t mean you can’t make it work.

How To Build XNA Games With Regular Visual Studio



The culprit here is the .XNB file. For every piece of “content” you need to load in your game, you need a corresponding .XNB file. When you compile a XNA game with Visual Studio Express, the .XNB file is created. Without it your game will throw an exception when you try and run it. Compiling with any other version of Visual Studio won’t do the trick, so we have to generate those files in another way.

First thing you have to do is install Visual Studio Express. Yes, you still have to install it on your machine, mostly because XNA utilizes some aspect of the .NET Framework that deploys with the Express edition of VS. But that doesn’t mean you have to be handicapped by that IDE.

Next thing you need to do is download the XNA ContentBuilder, a project on CodePlex. It comes in source or msi installer versions. The XNA Content Builder is what we’ll use to make our .XNB files.

Go ahead and create a Windows project in Visual Studio Standard, Pro, or whatever version you enjoy. Reference the XNA libraries in your project (Microsoft.Xna.Framework & Microsoft.Xna.Framework.Game). Write your XNA game code. Riemer’s XNA Tutorials are a good place to start.

After you’ve added the necessary content files to your game project, open the XNA ContentBuilder application and set the Intermediate, Output and Root directories to point to the correct directories of your game build (hint: the Root and Output directories should probably point to your bin/Debug directory). Then use the “Add” button to add the content files to the XNA ContentBuilder project. Hit the “Build” icon on the toolbar and the XNA ContentBuilder application will build a .XNB file for each content file added.

Bingo – you’re good to go.

Go back to Visual Studio Excellent Edition (whichever version you’re using) and build/run your game. It should work.

The whole process is painless and will only take a few minutes. If you’re like me and can’t stand the thought of having to code with an inferior IDE like Visual Studio Express, have no fear. You can still write XNA code with your powerful Godmode IDE thanks to the nice folks who wrote the XNA ContentBuilder project on Codeplex.

Happy game building!

Brad Wilson and James Newkirk posted a few thoughts today, and a question, concerning code coverage. Brad specifically asks:

Are you on an agile team? Do you do code coverage? What does it mean to your team?

We use code coverage, but not at a regular interval like I’d like us to. Part of the problem is that we still can’t get CruiseControl.Net to work. After a couple of weeks fussing around we finally managed to get it to work with Vault, but now that it correctly gets the latest source code from Vault we can’t get it to fire off the build. Go figure.

That said, we do try and make ourselves aware of our code coverage.

I like James’s analogy to a barometer. He says:

The answer lies in a metric that can be used to predict the weather, barometric pressure. Today, weather.com says the barometric pressure in Seattle is 29.66”Hg and falling. More important than the absolute measurement is the trend: it tells you that the overcast and drizzling rain outside is going to get worse, not better. The two pieces of information – value and trend – are used to predict what will happen next. The same can be said for code coverage. You can determine the relative health of your tests by using the value and the trend to determine the appropriate action. That’s the important bit: code coverage gives you relative measurements against itself, not an absolute measurement against a target value.

I agree. Somewhat.

While people may look at code coverage as a metric, I look at it more as a tool. I like to use code coverage as a way to help me ensure that I’m writing proper unit tests. When I look at the analysis for a class under test and find a method uncovered, or an else statement uncovered, that prods me to think of a unit test to exercise that code. And that prodding – that process of thinking about how to test something – is the real value of code coverage (at least to me). Because nine times out of ten, that process causes me to rethink that particular line of code, or that method. It makes me question. Do I really need that else statement? Is there a refactoring I can do to get rid of it? Is there a better way to write that method? Is this a method that doesn’t belong in this class to begin with?

I like tools, techniques and coworkers that make me question my code writing abilities. I like it when a tool makes me question my design. Code coverage is a great way to initiate that process, and to me that’s its greatest benefit.

When it comes to actual coverage numbers, I prefer to shoot for 100%. But I have to qualify that: 100% for classes that matter. James brings up the same point when he writes:

It is inevitable that code is written which isn’t covered by a unit test. A few examples of acceptable code without tests might include: web service wrappers generated by Visual Studio, views in a Model-View-Presenter system, and code for which failure is only possible because the underlying platform fails (like helper methods that pass default values into more complex .NET CLR methods).

I don’t really care about a number like 75% code coverage for the entire solution file. That doesn’t tell me anything useful. I care about 100% for a class that matters. I expect presenters and use case classes (workitems, etc.) – classes that do business logic work – to be tested thoroughly and have 100% coverage. If they don’t, then there has to be an explanation, and usually it’s because someone forgot to write a test, or because the design is bad and needs refactoring.

So to answer Brad’s question: What does it mean to our team? It is another “entity” watching our backs, ensuring that we’re doing all we can to write the best code we can. It’s like calling pair programming “real time code review”. Code coverage for us is a way to guide us, to let us know that we’re really thoroughly testing the important classes in our architecture, and we feel secure in knowing we’ve covered all our bases.

It’s another pair of eyes, in a way. And I like that.



For a long time I thought this behavior was unique to my computer. But a few days ago a coworker informed me that his version of Visual Studio is doing the same thing. It seems that over time, for whatever unexplained reason, the toolbox icons start to go whacky.

What’s weird is that the icons for the Infragistics controls don’t have this problem. Same goes for a few other folders in the toolbox. But the Common Controls and some other control sections are affected.

The icons change every few weeks and I haven’t been able to determine a trigger yet. Anyone else had this prroblem?


Note: The code has been updated. You should download the Version 2 code here. Links on this website have been changed to point to the new code.

CabSample_v2.zip

Note: I’ve included the complete source code in the zip file attached to this post. It is a complete, working CAB application built with the SCSF. Full source for the DialogBox class and the PopupBox class are included. The unit tests are written with NUnit 2.2.8.

There are two modules: (A) MessageBoxModule and (B) PopupBoxModule.

The MessageBoxModule makes use of a standard MessageBox for one feature and a standard Windows Form dialog for another feature. When you run the unit tests you’ll be interrupted by MessageBox and DialogBox popups.

The PopupBoxModule makes use of my custom PopupBox class (which mimics a MessageBox) and a custom DialogBox class for CAB. When you run the unit tests for this module no popup windows will appear, yet the tests will pass and the data will be correct.

The MessageBox can be a handy little device in a Windows Forms application. It’s cousin, the Dialog box, can be even more handy. There are a lot of occassions when you need to prompt the user for a yes/no type of answer, or notify them of some important event, or get some trivial piece of data from them before proceeding.

Unfortunately, the MessageBox and Dialog box are nightmares when it comes to unit testing. You don’t want to trigger a MessageBox popup when you’re trying to run automated unit tests against your Presenters, or you end up with this situation:

This problem only becomes compounded when you consider that in the Component UI Application Block you typically use a WindowWorkspace to show Dialogs. This is a much different way for showing popup windows than the typical Windows Form methodology which involves creating a Form control and calling ShowDialog() on it. The WindowWorkspace doesn’t return a DialogResult, for one thing. For another, you’re using a UserControl instead of a full-fledged Form control.

So how can we get the functionality that we’re used to using with classic Windows Forms technology and still utilize the CAB framework, all the while appeasing our desire to utilize Dependency Injection so that we can easily mock objects and input for use in automated testing?

I’ll show you my solution.

Injecting A DialogBox

The first thing to understand is what we’re trying to accomplish: We want to be able to inject a MessageBox into a Presenter or other WorkItem. The reason we want to inject the MessageBox is twofold: (1) so we can control the input and output of the MessageBox object in a unit testing scenario and (2) so we can prevent it from being displayed when the calling code executes. Preventing the MessageBox/DialogBox from appearing when it is called is the key to making things work in a unit testing environment like NUnit.

There’s one other glaring problem when attempting to emulate a MessageBox/DialogBox in CAB: There is no DialogResult when you use a WindowWorkspace.

Making the MessageBox or DialogBox close is easy enough if you’re using the Smart Client Software Factory; you can just call Presenter.OnViewClose() and the framework will handle the rest. The WindowWorkspace will close itself and the SmartPart. But that actually causes the Workspace to attempt to Dispose() of the SmartPart, which is not what you want in a Dialog scenario. What you really want to accomplish is a two-step process: First verify that the user has selected a specific button (OK/Cancel or the like) which is typically done with the DialogResult, and then fetch output off the Dialog object. To do that you need a Dialog that hangs around after the WindowWorkspace has closed itself. This means hiding the MessageBox or DialogBox instead of having the Workspace close it.

But how do we have a Dialog tell the Workspace to hide it? That’s where our DialogBox base class comes in.

The DialogBox Base Class

The first part of the solution is the DialogBox base class. It is an abstract class derived from a UserControl and implements an ISmartPartInfoProvider interface. This base class is responsible for the difficult part of this solution: handling button clicking and setting a DialogResult.

Normally, when you create a Dialog object in .NET you use as a Windows Form, create your buttons and set the DialogResult property on those buttons. Then, when a user clicks on one of those buttons the DialogResult for the Form gets set.

Our base class, DialogBox, does the same thing when you make a call to the InitializeClickHandlers(). It loops through the Controls of the subclass and looks for Button objects. When it finds one, it wires up an EventHandler to that Button’s Click() event. This is what the DialogBox base class will use to help send a message to the WindowWorkspace that a Dialog button has been clicked and the WindowWorkspace needs to Hide() the Dialog UserControl.

The WindowWorkspace

The next step is to augment the WindowWorkspace. The Smart Client Software Factory provides a subclassed version of the standard WindowWorkspace which has a couple enhancements to it. We’re going to add some code to the Show() method and include one additional method:


code in Show():
if (smartPart is DialogBox)
{
    DialogBox box = (DialogBox)smartPart;
    box.OnDialogButtonClick
        += new DialogBox.DialogClose(DialogClose);
    box.InitDialog();
}

add this method:
private void DialogClose(Control c)
{
    OnHide(c);
}


The Subclassed DialogBox

Once we’ve altered the WindowWorkspace and built our base DialogBox class, it’s time to actually use it. We start by creating a new UserControl and having it subclass from DialogBox instead of UserControl. Add buttons and controls, making sure each button has a DialogResult property set.



In the code for the dialog we have to make a couple alterations:


    [SmartPart]
    public partial class StringFetchDialog : DialogBox
    {
        public StringFetchDialog()
        {
            InitializeComponent();
            InitializeClickHandlers(this);
        }

        public string String
        {
            get { return _stringTextBox.Text; }
            set { _stringTextBox.Text = value; }
        }

        public override void InitDialog()
        {
            base.InitDialog();

            _stringTextBox.Text = string.Empty;
        }

    }

Notice the bolded lines of text. InitializeClickHandlers is a base class method that is used to wire-up the Click event for any button on your Dialog. This saves you from having to perform the DialogResult logic on every Dialog you make. The other thing we’ve done is override the DialogBox’s InitDialog() method. This method gets called by our altered WindowWorkspace when it shows a Dialog. You should perform any initializating on your Dialog in this method. In this case we’re setting the TextBox value to String.Empty so that each subsequent time the dialog is shown you do not have the previous text still in the field.

Now our dialog is ready to use.

Presenter Injection

Typically you’ll have some Presenter object or WorkItem that needs to interact with the user in some modal way. Your DialogBox is a dependency that your Presenter is relying on, so you need to provide your Presenter with a DialogBox either through constructor-based injection or property-based injection. Here is a snapshot of the Presenter code:


private IStringService _service;
private PopupBox _popupBox;
private StringFetchDialog _dialog;

[InjectionConstructor]
public PopupBoxViewPresenter(
[ServiceDependency] IStringService service,
[Dependency(Name = SmartPartNames.PopupBox)] PopupBox popupBox,
[Dependency(Name = SmartPartNames.StringFetchDialog)]
   StringFetchDialog dialog)
{
    _service = service;
    _popupBox = popupBox;
    _dialog = dialog;
}

Take note of the use of the [Dependency] attribute here with a strong name on the StringFetchDialog. By default, ObjectBuilder will look for a StringFetchDialog with the same name in the hierarchy of WorkItems. If it cannot find one it will create a new one, much as if you had specified:


[Dependency(NotPresentBehavior = NotPresentBehavior.CreateNew)].

This behavior works to our advantage.

In our unit testing class we will build a new StringFetchDialog and add it to our TestableRootWorkItem prior to adding the Presenter under test. This will cause the Presenter to get a reference to our prebuilt StringFetchDialog which we can manipulate for testing purposes. However, in the real WorkItem we will not create a StringFetchDialog. Instead, we’ll let the ObjectBuilder do it for us when it can’t find it.

The Unit Test SetUp


[SetUp]
public void SetUp()
{
    _workItem = new TestableRootWorkItem();

    _dialog = _workItem.SmartParts.AddNew
        (SmartPartNames.StringFetchDialog);


This is the beginning of our SetUp method in our TestFixture. Notice how we’re adding a new StringFetchDialog and maintaining a reference to it locally in the TestFixture. This allows us to do the following in a test:


[Test]
public void AddString_UserSelectsOK_AddsStringToView()
{
    _dialog.String = "Enchant";
    _dialog.DialogResult = DialogResult.OK;
    _presenter.AddString();

    Assert.AreEqual(1, _view.AddNameValues.Count);
    Assert.AreEqual("Enchant", _view.AddNameValues[0]);

}

Here we set the expected DialogResult and data properties. Our presenter has been injected with this dialog so whatever values we set it will make use of. This allows us to control the state of the DialogBox for testing. The question you may be asking now is, “How do you prevent it from being shown during a unit test?”

Preventing Dialog Display During Unit Testing

There’s two parts to this solution. The first part is to create a MockWorkspace that does nothing when Show() is called. We can do this by implementing the IWorkspace interface.


class MockWorkspace : IWorkspace
{
    public void Show(object smartPart)
    {
    }

    public void Show(object smartPart, ISmartPartInfo smartPartInfo)
    {
    }
}

The second part is to use this Workspace instead of a real Workspace in our TestableRootWorkItem:


[SetUp]
public void SetUp()
{
    _workItem = new TestableRootWorkItem();
    _workItem.Workspaces.AddNew
        (WorkspaceNames.PopupBoxWorkspace);
    _workItem.Workspaces.AddNew
        (WorkspaceNames.DialogBoxWorkspace);


Now when we run our unit tests the StringFetchDialog will not popup on the screen. This is the behavior we’re after.

Using The Dialog In A Presenter

So we have a DialogBox that works with CAB and doesn’t popup when we unit test. How do we actually call this code?

First, I’ll show you the Windows Forms way, which we’re all pretty familiar with:


StringFetchDialog dialog = new StringFetchDialog();
if(dialog.ShowDialog() == DialogResult.OK)
{
     _service.AddString(dialog.String);
}

The new way isn’t much different:


WorkItem.Workspaces[WorkspaceNames.DialogBoxWorkspace].Show(_dialog);

if (_dialog.DialogResult == DialogResult.OK)
{
    _service.AddString(_dialog.String);
}

The main difference is that we don’t have to new-up a Dialog each time we want to use it. Instead, our Presenter has been injected with a StringFetchDialog already, and we juse reuse it each time we need to query the user. Instead of making a call to ShowDialog() we ask the Workspace to show it.

The PopupBox

The other thing I’ve written is the PopupBox class, which is a special implementation of the DialogBox base class designed to mimic the behavior and usage of the standard MessageBox class. The main difference between it and a MessageBox is that the PopupBox is not static. Like the StringFetchDialog it is an instantiated class that is injected into the Presenter. Since it’s a fairly common control it may be best to add it at the Shell level, so all WorkItems have access to it.

MessageBox Way

In the sample project I use a MessageBox to query the user to determine if they really want to change the background color of the form. The calling code looks like so:


DialogResult result =
    MessageBox.Show(
    "Do you want to change the background color of this form?",
    "MessageBox",
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Question);

   if (result == DialogResult.Yes)
       View.UpdateBackgroundColor(true);
   else
       View.UpdateBackgroundColor(false);

The CAB-friendly version looks very simliar:


_popupBox.Initialize(
    "Do you want to change the background color of this form?",
    "Change Background Color",
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Question);

    WorkItem.Workspaces[WorkspaceNames.PopupBoxWorkspace]
        .Show(_popupBox);

    if (_popupBox.DialogResult == DialogResult.Yes)
        View.UpdateBackgroundColor(true);
    else
        View.UpdateBackgroundColor(false);

Instead of making a call to MessageBox.Show() you make a call to PopupBox.Initialize(), passing in the parameters you want to format the box correctly.

Note: The MessageBox class has several overrides and many parameters you can pass to customize the box when showing it. I’ve only provided overloads for the four most common parameters: text, caption, buttons and icon.

These two classes are contained in the Infrastructure.Library project of the CabSample application attached to this post. To use these objects in your own project you can just copy and paste them. You’ll also need to adjust the WindowWorkspace accordingly, or copy the class from my file.

With these two objects in hand, the PopupBox and DialogBox, you can get around one of the major hurdles in unit testing CAB applications. Prior to having these objects I would have to skip any subroutine that used a MessageBox or DialogBox. That’s disappointing, because I like to have 100% code coverage in the classes I’m testing. I especially like to be able to simulate user input for Dialog situations. Now I can do that.

Enjoy.

CabSample_v2.zip

Madden 2007 drives me nuts. From the cheating Artificial Intelligence to the instant replay that doesn’t work, it can be a (no pun intended) maddening affair.

It’s also the only NFL game going, and at times it can be incredibly fun.

During my time with the game I’ve come up with a few things the development team could focus on to make the next iteration of the game more fun and realistic.

1: More Accurate Playbooks Or Better Custom Playbooks

Just like the real NFL, playbooks are a big part of what makes a team unique. Half of the fun of playing Madden is taking your favorite real life team and replicating what they do on Sundays. Or taking your favorite time and ditching the coach you hate and hiring someone you like and running their offense/defense. But these things are hard to do when the playbook in the game doesn’t match the one you see on TV every Sunday.

Take the Seahawks for instance. In Madden 2007 there’s a formation called Singleback Flips Trips. It’s a four-wide receiver set with three wide receivers to one side, but two of those receivers are bunched close to the line of scrimmage. The Seahawks in real life run that formation about a half dozen times a game and it seems to produce some of their best and most effective passing plays. But in Madden 2007 that formation isn’t even a part of the Seahawks playbook.

Another glaring omission is the “stretch” play. Just about everyone in the NFL runs some version of the “stretch” play that the Indianapolis Colts have made so famous. Seattle runs the stretch play out of singleback formations about three or four times a game, but you can’t find one stretch play in the Madden 2007 playbook for Seattle.

In short, the playbooks don’t come close to matching their real NFL counterparts. Part of that is the failing of the developers to devote the necessary time to make the playbooks accurate. But that could be fixed… With a custom playbook.

It turns out the PC version of Madden 2007 has a custom playbook editor, much like the 2006 version. Only there’s a couple of huge problems that make this option worthless.

For starters, the playbooks on offense and defense are limited to a scant 11 formations and a total of 78 plays. The limitation on the number of formations is crippling enough, but limiting the book to a total of 78 plays makes it even worse. There’s barely enough room to get in a decent mix of plays.

The problem with a playbook that small is that during the course of a typical game you may run anywhere from 50-70 offensive plays. Repeating an offensive play is bad. Calling the same play more than once in the same game is a bad idea. The computer defense will account for repeated playcalls; it will counteract you by calling tougher defenses or it will just outright cheat and have it’s defenders beat your offensive players so you don’t gain yards. It’s the computer’s way of keeping you from running the same play over and over. This is a good thing (even if the CPU cheats to make it happen) because the computer shouldn’t allow you to call the same play over and over. But with a 78-play playbook there aren’t enough plays to go around.

Calling plays is about down and distance. And you cannot dictate down and distance during a game. You have no idea if you’re going to be facing 3rd-and-long all day or trying to eat away the clock with a lead, and thus calling a lot of running plays. A good playbook will have a mix of plays in it, and the better the mixture the more likely you’re going to have to repeat some plays during a game. And as I’ve said, repeating plays is a bad thing.

This could all be fixed if the developers of Madden would allow playbooks to have more formations and more total plays. The default playbooks have a LOT more formations and plays. Why not the custom ones?

Still, even with the limited formations and small number of total plays, my preference would be to use a custom playbook, but there’s one glaring bug in the PC version that causes custom playbooks to become totally useless: If you use a custom playbook and score in the final two minutes of the first half and have to kick an extra point or field goal, the game locks up. And not the nice kind of lockup where you can CTRL-ALT-DELETE to kill the game. No, Madden 2007 locks up with the really bad kind of lockup. The kind where you can’t get back to your desktop. Your keyboard and mouse become useless and you’re left with the last resort: turning the power off.

This is all sorts of bad.

The solution to all of this is to simply provide a much better custom playbook editor. CPU’s have a lot more memory now. There’s absolutely no reason you can’t bump the formations up to 15 or 20 and the total plays up to 150 per playbook. Give users the power to make their playbook what they want it to be. And fix the lockup bug.

Barring that….

2: Playbooks For Coordinators

Currently in Madden 2007 hiring your offensive and defensive coordinators is pretty much pointless. The playbooks for a team are defined by the head coach. Yet, in the real NFL, playbooks are often the product of the coordinators.

Take the Washington Redskins of 2006. They hired Al Saunders and his 700-page playbook to run the offense. But in Madden 2007 the playbook for the Redskins is based on Joe Gibbs. Same goes for the Patriots during their Superbowl runs: Charlie Weiss was the architect of that offense. Mike Martz is the guy running the offense in Detroit, yet the head coach is the guy credited with the playbook in Madden 2007.

I’d like to see certain offensive and defensive coordinators have their own playbooks. Sure, some head coaches call plays on one side of the ball, like Mike Holmgren in Seattle or Andy Reid in Philly. But a lot of coordinators bring their own playbooks to the team when they’re hired. If offensive and defensive coordinators came with their own playbooks it would make the offseason hiring phase of a franchise mode a lot more interesting and fun. It would make it more meaningful, which would be a good thing.

3: Fix The Passing Game

The running game got a huge makeover with Madden 2007. The developers added a feature to allow you to control the fullback or an offensive lineman on running plays, thus potentially improving the blocking. But more than that, the developers really worked on the blocking and tackling so that it is easier for runningbacks to find lanes in the middle of the field, making the running game slightly more realistic.

Unfortunately, while the running game has recieved a lot of attention, the passing game has suffered.

Madden 2007 has a couple of really annoying features that negatively affect the passing game, and these have to get fixed in the next iteration.

For starters, defenders covering recievers on a “corner route” have this superhuman jump-swat that they use with amazing regularity to knock down a pass intended for the receiver. For whatever reason it is basically impossible to throw a pass over the receiver’s shoulder to a point where the defender can’t get to it, and the jump-swat is a large reason why. What’s annoying about this is that I have yet to see this superhuman feat performed in a real NFL game. Linebackers who get beat downfield by a TE or WR, especially on a corner route, do not have the recovery speed, nor the vertical leap to make this move. It is a physical impossibility. They also don’t have eyes in the back of their head.

Another incredibly annoying feature, at least played on All-Madden mode, is that some routes are simply impossible to complete passes on because cornerbacks react unrealistically to the ball. You see, there’s this thing in the real world call “momentum“. Physics and the limitations of the human body dictate that a person cannot simply switch direction and accelerate at maximim speed without first slowing down and overcoming the momentum they have already generated. This reality is not reflected in the game, however.

A common and oft-used route in the NFL is the “deep in” route or “dig” route. It’s a simple route: the receiver runs several yards downfield in a fairly straight line, and then cuts “in” toward the center of the field. Against man-to-man coverage the receiver’s job is to convince his defender that he is going to run downfield on a fly or “go” route, forcing the defender to turn his hips and commit to running the length of the field. At that moment the receiver cuts sharply ninety degrees toward the center of the field. The advantage here is that the receiver knows where he is going, but the defender does not. There’s a split-second in there where the reciever is cutting and gaining separation on the defender, while the defender is attempting to stop his momentum and reverse field.

When run properly this route is incredibly effective and very difficult to defend without underneath coverage from the linebacking corps. However, in Madden, this route is utterly useless as the defenders ignore momentum and can not only stop on a dime and turn with the receiver, but can actually outrun the receiver and get in front of the route!

This sort of clarvoyant defensive backfield play makes the passing game in Madden annoying in the extreme.

Another serious flaw with the passing game is how receivers constantly bump into defenders in zone coverage and cannot get around them. This causes the receiver’s legs to churn away as he continues to futily bang into the defender, pushing the defender a foot or two at a time while never completing his route. Meanwhile you, the quarterback, take a sack while waiting patiently for your dumbass receiver to navigate a zone and get open.

What’s incredibly frustrating about this is that some of the logic necessary to fix this problem already exists within the game code. When a defender in man-to-man coverage follows a receiver who has gone in motion before the snap of the ball he could run into any number of linebackers and other defenders as he is running down the line of scrimmage. But the developers have wisely coded the defender following the man in motion to navigate the field correctly, and avoid contact with other defenders (this works 90% of the time, but sometimes the players still get stuck). The code handles this situation, so why not receivers running routes?

Adding to the frustration of this sort of problem is the fact that in the NFL a large part of the passing game is predicated on being able to “thread the needle” and get a ball in between defenders, either by dropping a pass over the shoulder of a receiver who has beat his defender (the jump-swat case) or by throwing the ball to a receiver who is not yet open, but will be once he clears a linebacker (the collision case and in-route case). This is a huge, important part of the NFL passing game and it’s missing from the Madden video game.

4: Add QB Slide As A Button

This is a small fix. And easy fix. Add the ability for the quarterback to “slide” after he’s crossed the line of scrimmage. It should be a simple button press, not some convoluted joystick waggle. Sometimes the defense just covers everyone really well. Mobile quarterbacks can make plays with their legs. But in Madden, unless you can get to the sideline you run a very high percentage chance of either (a) getting your QB really hurt or (B) causing a fumble when he gets hit. The QB slide has to be included in Madden 2008 and it has to be easy to use. Period.

5: Lose The “Tuck Rule” Anti-Sack

In 2002 the New England Patriots hosted the Oakland Raiders in the AFC Championship game in what has since then been dubbed The Snow Bowl. This game is infamous for the emergence of the “Tuck Rule.”

The Patriots were trailing 13-10 with less than two minutes remaining in the game when Charles Woodson sacked Patriot quarterback Tom Brady. Brady fumbled the ball and it was recovered by Oakland, effectively ending the game and sending the Raiders to the Superbowl. But since it was the final two minutes of the game a review of the play was called in from the booth upstairs. Upon further review the play was reversed and called an “incomplete pass”. Brady’s arm was technically “moving forward” at the time he lost control of the ball; he was attempting to “tuck” the ball into his chest to avoid the fumble. But the letter of the law said that the passer’s arm simply had to be “moving forward” for it to be an incomplete pass. The call was overturned, Brady lead the Patriots to victory and the rest is history.

In Madden 2007 the “Tuck Rule” makes its presence felt early and often.

Sacking the quarterback is something that is very difficult to do in Madden. It is made significantly harder by the presence of the “Tuck Rule” mechanics. Most of the time when your defender is sacking the quarterback, the CPU QB will have the ball fall out of his hand and hit the ground at his feet. This should be a fumble but it never is thanks to the “Tuck Rule”.

A better solution would simply be for the CPU QB to hang onto the ball and take the sack. After all, in the real NFL when a quarterback feels a defender starting to sack him, his first instinct is to protect the football – to hold onto it.

Ironically, that’s what happens to your quarterback when you get sacked in Madden 2007.

I don’t know how many hundreds of games I’ve played with Madden 2007, but I know that I can count on one hand the number of times my quarterback was successful at getting rid of the ball the moment I was being sacked, and having it ruled as an incomplete pass. The vast majority of the time my QB hangs onto the ball and I get sacked. That’s how it should be. But the rules don’t apply equally to the CPU.

And that’s probably the single most annoying thing about Madden: the rules don’t apply equally. Whether it’s the way defenders cover pass routes, or quarterbacks take sacks, or offensive linemen block, or quarterbacks slide, when you play the CPU things don’t happen equally.

A Couple Other Things….

Here’s a few final thoughts for features/fixes that would really improve the game:

  • Defenders that recover a fumble or intercept a pass have about a 100% chance to fumble the ball if you don’t fall down or go out of bounds immediately. The only recourse is to press the “4″ button and hope your guy can hang on for dear life. This is unrealistic.
  • In the real NFL the success rate for coaches challenging plays with replay is less than 50%. In fact, it’s closer to 30%. Yet in Madden 2007 if the CPU challenges a play you can bet the farm he’s going to win. I actually tracked CPU challenges for several games and a few franchise seasons. The success rate for replay challenges when called by the CPU coach was over 90%. This has to be fixed.
  • Defensive backs never play “off”. In the real NFL, when a team’s defensive backs are outmatched by the receivers, or if the defensive coordinator is a more conservative guy, they will often command their corners to play 8-10 yards off the line of scrimmage. You hear the color commentators comment about this during games all the time: “Look how much cushion #32 is giving!” This is an ideal situation for throwing short curls, hooks and slant routes. But in Madden 2007 the CPU never has the corners play soft. Your receivers never have any cushion – and if they do, the defenders elilminate that cushion as soon as the ball is snapped. It’s yet another thing that makes the passing game in Madden unrealistic and aggrevating.
  • Crossing routes are too closely defended. In the real NFL a crossing route can be a killer (this is why defenses employ zones and combination man/zone coverages while they attempt to fill passing lanes with linebackers). It’s very difficult for a defensive back to cover a speedy wide receiver all the way across the field. It’s impossible for a linebacker. Yet in Madden 2007, defensive backs and linebackers routinly cover wide receivers on crossing routes like they had their torso glued to the receiver’s shirt at the snap of the ball. More aggrevating: As you pass the ball to one of these closely guarded receivers, the linebacker covering them (who should be trailing by a couple yards by now) is able to speed up with Superman powers and swat the ball down. I’m still waiting to see this move in a real NFL game.
  • Track play calling stats. In Madden 2007 you can go into something called the Weekly Gameplan and see the top three plays your opponent likes to call for passing and running, and the average yards per play that they gain using those plays. But that’s mostly useless information because the CPU is programmed to call plays in a fairly evenly distributed manner. What would be much better is a breakdown of the plays you have called over the course of a season, how frequently you call them and the AYPP. I’d like to see my whole playbook broken down, so I know if I’m not calling certain plays as often, or which plays absolutely stink because I get no yards from them. That sort of information would be invaluable (and fun).
  • Shade plays you’ve already called during a game. In the real NFL coaches keep markers with them. As they call plays on their laminated playcall sheets they annotate things. One feature that would be really cool is if the playbook would shade a play you have already called – make it duller, and provide a counter in the corner of the playbox window so you would know how many times you’ve already called that play during a game. If the entire playbox window for that particular play was shaded slightly then your eyes could flip through your playbook for plays you haven’t called yet in very rapid fashion. All of this would make calling plays a richer game experience.

All right – I’m done. For now. Get to work EA. Your game doesn’t suck, but it’s not great either. You’ve got room for improvement.