Another Year, Another Blog Post

It’s been quite a while since my last post.  A lot of stuff has happened, between being featured in a few Unity Asset Store sales, to Space Crüesader being greenlit, to the creation of a new Unity plugin, uNote.  To say that the last year has been busy would be an understatement!  A play-by-play of all of the milestones and accomplishments would be a very, very long list, so, instead, I’m going to stick to the broad strokes.

So, to sum up, here’s some information on things past, and future.

  • U2DEX received multiple updates, lots of praise and a featured spot in the Unity Asset Store March Madness sale
    Over the past year U2DEX has really come into its own.  Some new features were added along with various refinements to the already-existing feature-set, but the most exciting development was receiving fantastic comments like “Why is this not part of Unity?“, I can’t imagine not having it now.“, and “Mandatory purchase for 2D work in Unity.“.
    A lot of this culminated in getting an email from the Asset Store team telling me U2DEX had been selected to participate in one of the Asset Store’s sale events.  Being chosen was an amazing thing in and of itself, but the after-effects of the sale were also really great.  Word-of-mouth for U2DEX has really started to pick up, and I’m truly humbled by the response and emails I’ve gotten from satisfied users.  You guys rock!
  • Space Crüesader was Greenlit for release on Steam
    After almost three years, Space Crüesader was finally greenlit!  Honestly, I had pretty much given up hope, but now that it’s happened I’m pretty excited.  Given that Space Crüesader is about two and a half years old by now (and was heavily targeted for the Xbox 360), I made the decision to remake it in Unity, targeting PC this time.  There are numerous bonuses to this approach, but the biggest will be better cross-platform support, as well as a much better representation of what I wanted the game to be.  It’ll be a lot of work, but the end result should be worth it.  This is less of a retread/remaster and more of a from-the-ground-up, version 1.5 remake — so once it’s a bit farther along, I’ll be sure to share more about it.
  • A new Unity plugin, uNote, was released
    uNote was released earlier this year, and already has many satisfied developers using it (including myself!).  It’s a relatively simple plugin, in terms of what it does, but it’s really handy to be able to drop notes wherever you need to while editing.  It’s done pretty well thus far, so I’m excited to see where it goes from here.

That’s the broad strokes for 2014-2015.  There’s still a lot of work to be done, but overall things have been moving at a pretty brisk pace.  I’ve got some more stuff planned, but Space Crüesader is my priority for now.  It, too, is coming along nicely, but there is still a lot left to do.

Maybe this year I can get in more than one blog post? (Hope springs eternal!)

Until next time!

A Bit of Housekeeping is in Order

It’s been quite a while since my last post, so there’s a couple things to cover.  A lot has changed on the site in the past month or so, as well as some updates to U2DEX.

For starters, the newest version of U2DEX (v1.20) is officially on the Asset Store!  It includes quite a bit of reworking and new features, so it should make your 2D editing experience even more awesome than before!  You can check it out on its store page, or read up about it on its product page.  You can read the full changelog in the v1.20 forum thread.

This post also marks the unveiling of the new forums.  I wasn’t pleased with the direction the old forum software was taking (not to mention the near-constant updates and custom changes that I had to apply just to make it “functional”) so I’ve scrapped it entirely in favor of the very, very nice XenForo.  It’s a much nicer forum platform, both to work with as well as use.

In addition to that I’ve also redone some of the site to make it a bit more visually appealing.  The styling between the various areas of the site should also be more consistent, as well as being fully responsive, so it should look pretty snazzy even on smaller-screened devices (phones, mini tablets, etc.).  You might also have noticed that I’ve updated the logo a bit, and you’d be correct.  It was a little…ugly once I’d done the rest of the site changes, so it got a redo as well.

There you have it.  Lots of small things that add up to a fresher site, as well as a fresher U2DEX.

Until next time!

Introducing U2DEX: Unity 2D Editor Extensions

Been a while, eh?  With Xbox Live Indie Games slowly being pulled off life-support, it was time I moved on to something else — turns out that something else is the Unity game engine.

Which brings me to the topic of the day: U2DEX — my first foray into making plugins for Unity.

From it’s asset store page:

U2DEX streamlines areas of the Unity Editor for 2D development, further turbocharging your 2D workflow.

By stripping away 3D values, or presenting them in a way that makes sense for 2D space, U2DEX rounds out and polishes some of the Unity Editor’s sharp, 3D corners, while still maintaining the Unity look-and-feel you know and love.

Essentially, U2DEX makes creating in Unity even more awesome for 2D games.  Here’s a run down of some features:

  • Grid tool – Aligning objects has never been easier!
  • Snap tool – Snap objects to numerical units, or to a Grid component’s Grid if you have one enabled!
  • Applicable class editor – Apply the 2D Transform Inspector to virtually any class with a name!
  • 2D Toolkit support!
  • Orthello support!
  • Enhanced Size and Scale – Use the underlying object’s scale, if possible. Preserve your dynamic batching with no extra work!
  • Enhanced Rotation – Use Degrees, or Radians, and watch as U2DEX converts between the two in real time!
  • Compatible with Unity Free and Pro
  • FULL source code access!

There’s more in-depth info on it’s product page.
In addition, you can now talk about stuff on our forum!

By the way, U2DEX is only $10, which makes it super cheap.
You can buy it here!  (I’ll love you forever!)

That’s it for today.  Hopefully some people get some use out of U2DEX — I had fun making it, so hopefully you have fun using it!

Space Crüesader Patch Is Out!

Space Crüesader version is now out on the Xbox Live Marketplace!

There’s ton of fixes, but the #1 most important thing is that backgrounds can now be disabled entirely, if the player wants it.  Following closely at #2 is that nobody is shunned from the highscore boards if they play with backgrounds or flashes off.  Instead, they get an icon next to their entry for each thing (flashes, backgrounds) that they have disabled.

Another huge plus is that, although the Marketplace name hasn’t been changed, Bing can now find the game!  Woo-hoo!  Turns out that Bing does, in fact, look at the game descriptions, so all I had to do was remove the umlaut from the description.  Now you can find the game by typing in “Space Cr” into the Xbox’s Bing search, and it’ll give you “Space Cruesader”.  Follow that link and it’ll take you right to it!

Have fun!

If you’re interested, you can read the full, behind-the-scenes changelog below.
You might learn something!

Continue reading

Space Crüesader Patch Incoming

A patch for Space Crüesader has been in the works for the past week and a half or so that should address a lot of issues (and non-issues that’ll make the game more user-friendly).  Here’s a short list of some of the changes you can expect:

– A new option to disable backgrounds completely!
– Two more options under “Flashes” that will allow you to lessen the flashes and fireworks,
without completely removing them.
– The ability to always upload scores, even if you have flashes off and backgrounds off.
(New icons will be placed next to entries, so players can tell if that entry was made with
those options off)
– The highscore table will now update every minute if you’re viewing scores.  This should
help if you’re hanging out waiting for a score sync to happen.

This patch should be coming soon, and I’ll post the full change log when it hits the Marketplace.  I’m currently hung up on two things, but once those are cleared up (either for better or for worse) the patch should be out pronto!  Here’s the things I’m currently working on getting sorted:

#1 I’m trying to get the umlaut removed from the ‘ü’ in the Marketplace title so dimwitted Bing can find it (seriously, who would have thought that Bing couldn’t connect the dots? — no pun intended).

#2 I’ve been very diligent about trying to make all old saves compatible with the new format.

At the end of the day, this patch should address a lot of the issues I’ve seen reported.  I know that this is a bit light on the info, but once I’ve got some more info to share, I’ll do so.

Space Crüesader Reviewed by Indie Gamer Chick, Recieves Seal of Approval

On November 30th, a review for Space Crüesader was posted on Indie Gamer Chick.  Generally, this is where my fellow indie developers prepare for the no-doubt brutal shredding of their baby.

I was no exception.

When I emailed Indie Gamer Chick to let her know that my game was out, I was expecting the inevitable review to be pretty brutal.  Twin-stick shooters are a pretty over-crowded market on XBLIG, and while I was confident that mine was a good game, Indie Gamer Chick has gone on record stating that she’s generally not a fan of shooters.  “Better cue up my bitter tears,” I was thinking as I sent the email.

Surprisingly, it was a tear-free experience.  A few days after I sent the email, Indie Gamer Chick had the review up, and it was uncharacteristically positive.   In fact, Space Crüesader is now proud to bear the Indie Gamer Chick Seal of Approval, which can be seen on its product page.  She even went so far as to say it’s one of the best titles on XBLIG, and that she loved it!

If you don’t believe her (shame on you!), you can form your own opinion for the low, low price of one dollar.

If you do believe her (good on you!), you can purchase the game from, or find it on the Xbox Dashboard under “Indie” (near the top of the new releases list, as of the time of writing).

If you’re undecided on the matter, then I can’t help you.  I could add a gratuitous link to the game’s marketplace page, but that would be rather silly, wouldn’t it?

Space Crüesader Launches, Fanfare Begins

Let it be known that on the 28th of November, 2012, Space Crüesader launched for all the world to play! (cue fanfare)  You can purchase it on for 80MSP (or $1, in normal monetary terms).

There’s also some pretty sweet reviews coming in as well, like this one and this one.

There’s still a long way to go, and the website will be going through some changes as I work out the best way to showcase the game and news relating to it.  However, the game is out, the reviews thus far have been positive, and I actually made it to release.

That’s got to be worth something, right?   Right?

1 When I said “for all the world to play” I meant the United States, Canada, the United Kingdom, Japan, Germany, France, Italy, Spain, Sweden and Singapore.  I would have said “most of the world”, but that doesn’t sound as nice, does it?

The .Net Dictionary Dilemma

Nine times out of ten, if you were to ask someone “What is the best way to store a key and a value in .Net?” that someone would answer something along the lines “Well, you’d probably want to use a Dictionary.”.

Now, if you were to ask that same question but phrase it slightly differently to “What is the best way to store a key and a value in .Net on the Compact Framework?” you probably wouldn’t get “Dictionary” in your answer.

You see, it is a common (misguided, I should add) notion that Dictionaries are, usually for garbage reasons, completely evil, and you would have to be monumentally stupid to even contemplate using them. Even worse, if you even vaguely approached the idea of using enums as your key value, most (misguided) programmers would have you tarred and feathered…and then marked with the red cross, as you have obviously contracted the plague of incompetence.

So, I went ahead and built an input manager revolving around Dictionaries, with enums as my keys.

You see, I don’t believe that Dictionaries are the absolute devil-spawn of .Net Collections. Sure, there is a grain of truth in the concept of “Dictionaries create garbage, and Dictionaries create lots of garbage when used with enums”, but there is a fairly simple way around that. But first, a quick explanation of why using enums with Dictionaries create garbage.

Dictionary<enum, value> = Garbage

The above statement, while true, doesn’t tell the whole story. Using an enum as your key value (that is, the first argument, as Dictionaries look like Dictionary<Key, value>) will more-than-likely cause Boxing to occur. If you are unfamiliar with what boxing is, the general rule of thumb is this:

Boxing is bad. Avoid it.

The reasoning behind this rather broad statement is that Boxing/Unboxing creates garbage. This is exactly why using enums as your key value creates garbage. To avoid this, you have two options:

1. Cast your enum values to ints before inserting them into your Dictionary. Then use integer keys for accessing the values later.

This isn’t a great option. It makes your code (in my opinion) ugly, and it will make your life a nightmare later when you have to do this for any Dictionary you use. It will also ruin the type safety that generics have in .Net.

2. Don’t use enums as keys, or don’t use a Dictionary.

Bit of a letdown, wasn’t it? This is the definition of “stuck between a rock and a hard place”.

However, there is a magical third option that most everyone glosses over with the “Dictionaries and enums are evil” argument.

The Third Option

Your third option is to utilize an IEqualityComparer.

“Well, how do I do that!?” I hear you screaming at your screen. Don’t worry; I’ll explain how these work.

First, let’s create a normal Dictionary:

Dictionary<Buttons, bool> GamePadButtons = new Dictionary<Buttons, bool>(); // create our
//dictionary for storing Buttons (which are the buttons of an Xbox GamePad)

Great! We’ve got a Dictionary set up to use Buttons as our key, with a bool being used as our value.

Now, if we iterate over this Dictionary, or check one of the values like this:

foreach (Buttons button in GamePadButtons.Keys)
        if (GamePadButtons[button] == true)
                 //do something


There’s the garbage I was on about earlier. Interestingly enough, this code does not generate garbage on a PC, using .Net 4.0 or later. However, if you are using an earlier version, or targeting the .Net Compact Framework (which is what the Xbox uses), you will still get garbage.

And lots of it.

So, then, let’s fix it. This will require that you make a new class (one of the aforementioned IEqualityComparers). Personally, I would make a new .cs file and store all of my IEqualityComparers in that single .cs file. If we follow the sage advice of Nick Gravelyn, we should end up with something like this:

public class GamePadButtonsEqualityComparer : IEqualityComparer
        private static GamePadButtonsEqualityComparer defaultInstance;
        public static GamePadButtonsEqualityComparer Default
                if (defaultInstance == null)
                    defaultInstance = new GamePadButtonsEqualityComparer();
                return defaultInstance;

        public bool Equals(Buttons x, Buttons y)
            return x == y;

        public int GetHashCode(Buttons obj)
            return obj.GetHashCode();

We’ve now created an IEqualityComparer for the Buttons class! Now, all it’ll take to erase the garbage created by our Dictionary is to change this one line of code:

Dictionary<Buttons, bool> GamePadButtons = new Dictionary<Buttons, bool>();// our old line

Dictionary<Buttons, bool> GamePadButtons = new Dictionary<Buttons, bool>(GamePadButtonsEqualityComparer.Default); // our new line

We’ve fixed it! That single line of code has solved all of our Dictionary-induced headach–

Wait. That hasn’t done anything at all! Where have we gone wrong?

It turns out that we need to change one more line of code to completely erradicate the garbage. This time, the line of code is located in our IEqualityComparer:

return obj.GetHashCode();// our old line

return (int)obj;// our new line

There we go. It turns out that GetHashCode does generate some garbage here, so insead of using that method (which returns an int), we just manually cast the object to an int ourselves.

Problem solved! All of the garbage generated by our Dictionary+enum pair has been resolved.

Now for the bad news. You’ll have to make an IEqualityComparer for every enum you want to use. (For example, if you wanted to use the Keys enum for Keyboard keys, you’ll need to make an IEqualityComparer for that.) However, the code is exactly the same as the one we’ve made here, only you’ll use Keys instead of Buttons. So, yes, this would qualify as boilerplate code, but it’s much easier (and less ugly) than having to cast to ints everywhere!


Dictionaries are great for storing keys and values. By having eliminated one of the drawbacks (if you can call it that) of using them, we’ve now made it easier to correctly disprove the argument “Dictionaries with enums are completely and utterly evil, and only the incompetent use them”. Albeit, it’s not the most user-friendly way of creating Dictionaries — having to create an IEqualityComparer for every unique enum you want to use is not fun — but it’s much better (in my opinion) than casting to ints, or worse, not using Dictionaries. (and maybe using a double-dimension array, or two separate arrays/lists, etc. instead)

MediaPlayer: How to Check if it Has Control

I’ve been working with XNA’s MediaPlayer class a lot lately, and I’ve come to learn many of the typical pitfalls associated with it.  (Hint: There’s approximately a million of them)

One of the biggest is the fact that it’s so slow.  I mean, it will literally slow your game to a crawl if you check Volume more than a few times every few seconds.  However, I’m getting off-track here.  Maybe I’ll go into that in some other post.

For now, I’m going to post about something much more important.  You see, XNA has this nifty feature that will mute either your Music category in XACT, or the MediaPlayer class, when the user starts to play music through the Guide.  This is fantastic, and I’ve never had a problem with it (I’m an XACT man, myself), until I started using MediaPlayer for my Custom Playlists (so the user can play their own music in-game).

MediaPlayer pitfall #1,000,001: While MediaPlayer will mute your music when music is played through the Guide, it will not resume your music if that music from the Guide is turned off!  Like a spoiled, bratty kid, it will do half of what it’s told, but then firmly dig in and say “Screw you!”.

So, then, how do we go about fixing this behavior?

I got to thinking, and realized that polling the MediaPlayer.GameHasControl will probably be slow, so checking it every frame was going to be a no-no.  So, then I came up with this:

// Declarations
bool GuideWasVisible = false; // a bool we'll use to keep track of the last Guide status

bool MediaPlayerHasControl = true; // a bool we'll use to cache the
                                                    //MediaPlayer.GameHasControl value

// The following should probably be wrapped in a class.
   if(!GuideWasVisible)// since we'll set it anyway,
                                //we can use it to stop subsequent updates
        if(MediaPlayer.GameHasControl) // check if the MediaPlayer has control
            MediaPlayerHasControl = true;
            MediaPlayerHasControl = false;
         GuideWasVisible = true;// set GuideWasVisible, since the Guide is Open

if(GuideWasVisible && !Guide.IsVisible)
   bool MediaPlayerRegainedControl = false; // now we check if it gained control back
   if(MediaPlayer.GameHasControl) // check if the MediaPlayer has control
            MediaPlayerRegainedControl = true;
            MediaPlayerRegainedControl = false;
   if(!MediaPlayerHasControl && MediaPlayerRegainedControl)
        StartNewSong();// the MediaPlayer did not have control before, but now it does,
                               // so you can start a new song.
   GuideWasVisible = false;// reset this, so it only does the MediaPlayer check once.

The code itself is pretty self-explanatory (but not especially clean, it can probably be improved), but I’ll run through the gist of it.

Essentially, MediaPlayer is slow, so we can’t check the GameHasControl flag every update. However, we can check it once, if the Guide gets opened, and check again when it’s closed. This code hinges on the fact that a user must open the Guide to turn on their custom playlists.

Then, when it’s first opened, we cache the current value of the MediaPlayer.GameHasControl. Then, when the Guide is closed, we check the current value of the MediaPlayer.GameHasControl, and compare it to the value when it was first opened. If the previous value was that it did NOT have control, and the current value is that it DOES have control, we start a new song, since the user stopped their Guide music.

Now, I will admit, this isn’t without it’s problems. First, if the user pauses the music from the Guide, the GameHasControl flag will still be false. Don’t ask me why, I have no clue why it still does this.

Label that MediaPlayer pitfall #1,000,002.

Also, you will more-than-likely need to adjust the code to fit your needs. For instance, I pause my Jukebox class when it’s detected that the game doesn’t have control. I also set a flag when it has regained control to play a new song when the game is unpaused (as I pause when the Guide is opened).

At the end of the day, it’s a workaround for a problem that shouldn’t exist in the first place. It works — but it’s not ideal.

Announcing Space Crüesader!

My entry for Microsoft’s annual Dream.Build.Play contest is finally ready!

Space Crüesader is a twin-stick space shooter, and, incidentally, my very first game.  It’s been a labor of love for some time now, and I’m excited to finally be able to show it off.  It’s 99% completed, I just have a few more finishing touches, but overall it’s in the state it will ship in later this year.

If you’re interested, you can read more about the game and see its trailer at the game’s product page, located over here.