Sunday, November 20, 2011

Game Review: Super Mario 3D Land

How to create Super Mario 3D Land:

  1. Invent a time machine.
  2. Travel back to 1988 and kidnap the Super Mario Bros 3 design team.
  3. Put the Super Mario Galaxy development team under SMB3 designers.
  4. Have James Cameron be a senior producer of the 3D department.
  5. Profit!

Review

While its not the open world adventure Super Mario 64 2 sequel I have been waiting for since 1995, it still kicks a**. Creative worlds, vivid colors, classic music, fluid controls, Luigi, Dry Bowser, tanookie tails everywhere, this game has it all! Aside from living up to it's lineage as a masterful platformer, and beyond being jam packed packed with well polished content, Super Mario 3D Land really shines by doing two things right in particular:

First, the 3D is actually useful.

Forgive the pun, but the 3D element of Super Mario Land actually adds a new dimension to the game play. Some of jumping puzzles can be quite challenging, and having depth perception is very helpful to gauging your jumps. Just to put this into perspective, yes that was another pun, I have only ever turned the 3D on while playing this game. However, to be honest, I still don't usually leave the 3D on the whole time that I am playing; but I do try using the 3D before I fall back on the golden tanookie leaf.

Second, it has a perfect challenge curve.

Professional game reviewers all seem to agree that good games should be easy to play, challenging to beat, and very difficult to complete. Super Mario 3D Land seems to agree with that philosophy, as it follows it to the letter. I blew through all eight worlds the first week I got it, and now I am crawling through the super frig'n hard special worlds. To be clear, the special worlds are not just harder; they also add fun new mechanics (Shadow Mario) and game play modes (timed runs) that really contribute to the replay value of the entire game.

Score - 9/10

It has taken far too long for the 3DS to finally get some games that made the investment in the hardware worth it, but that at least that time has finally come. Even though I don't much care for 3D technologies, I must still confess that this game got it right. Super Mario 3D Land is just a platformer, but it is a truly masterful platformer that acts as the perfect cornerstone for this young game console.

Game on!
Tom

Sunday, November 6, 2011

jQuery UI Modal Dialog disables scrolling in Chrome

Is Chrome becoming the new IE?

As much as I love jQuery, I still cannot escape the fact that jQuery UI leaves a lot to be desired. Yesterday I ran across an issue where the jQuery UI modal dialog acted inconsistently in different browsers. Normally opening a modal leaves the background page functionality unaltered, but in Webkit browsers (I ran into this while using Chrome) it disables the page scroll bars.

The Fix

Yes, this bug has already been reported. Yes, it is priority major. No, it won't be fixed anytime soon. For a feature as widely used as the Modal Dialog, I find that kinda sad.

However, thanks to Jesse Beach, there is a tiny little patch to fix this! Here is a slightly updated version of the fix:

(function($) {
  if ($.ui && $.ui.dialog && $.browser.webkit) {
    $.ui.dialog.overlay.events = $.map(['focus', 'keydown', 'keypress'], function(event) { 
      return event + '.dialog-overlay';
    }).join(' ');
  }
}(jQuery));

Additional Resources

Hope that helps!
Tom

Thursday, November 3, 2011

Configuring MVC Routes in Web.config

ASP.NET MVC is even more configurable than you think!

Routes are registered in the Application Start of an MVC application, but there is no reason that they have to be hard coded in the Global.asax. By simply reading routes out of the Web.config you provide a way to control routing without having to redeploy code, allowing you to enable or disable website functionality on the fly.

I can't take credit for this idea, my implementation is an enhancement of Fredrik Normén's MvcRouteHandler that adds a few things that were missing:

  • Optional Parameters
  • Typed Constraints
  • Data Tokens
  • An MVC3 Library

Download MvcRouteConfig.zip for the project and a sample application.

Example Global.asax

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
 
    var routeConfigManager = new RouteManager();
    routeConfigManager.RegisterRoutes(routes);
}

Example Web.config

<configuration>
  <configSections>
    <section name="routeTable" type="MvcRouteConfig.RouteSection" />
  </configSections>
  <routeTable>
    <routes>
      <add name="Default" url="{controller}/{action}/{id}">
        <defaults controller="Home" action="Index" id="Optional" />
        <constraints>
          <add name="custom"
              type="MvcApplication.CustomConstraint, MvcApplication">
            <params value="Hello world!" />
          </add>
        </constraints>
      </add>
    </routes>
  </routeTable>

Thanks Fredrik!

~Tom

Update 2/16/2013 - I have added this source to GitHub and created a NuGet Package.

Shout it

Real Time Web Analytics