New blog URL

January 29, 2014 at 4:30 am (Uncategorized)

If you’re reading this at, you are at the old site!

I’ve decided to host on Windows Azure from now on, with a custom URL to come… some day.

Go here for the latest:


Permalink Leave a Comment

Custom SOAP XML Namespace Serialization for Array Items in a WCF DataContract

April 25, 2012 at 4:52 pm (Programming/Development)

Just thought I’d share this little tidbit of gold that I found after working on this issue for a few hours today:

WCF is a big step forward in .NET SOA development and I’ve really enjoyed working with it over the past several months after working with .NET 2.x ASMX based services previously. However, I ran into an issue where the items in an array which is part of a request’s DataContract were being serialized into a separate namespace from the array object itself. Here’s an example to see what I mean:

In our DataContract:

    Name = "MyCoolDataContract",
    Namespace = "")]
  public class MyCoolDataContract
      Name = "MyArrayOfGuids")]
    public Guid[] MyArrayOfGuids { get; set; }

The resulting SOAP request generated from the WSDL:

<soapenv:Envelope xmlns:soapenv=""
... stuff...
               <!--Zero or more repetitions:-->

Notice that the namespace for MyArrayOfGuids is dat but the namespace for the Guids it contains is arr.
This arr namespace is mapped to According to my Googling, this is the namespace under which Microsoft serializes items within any type of Array or similar collection (Lists, etc.) in a WCF DataContract.

This behavior was giving a web engineer who was attempting to call into my service some headaches when attempting to build an appropriate SOAP request.

So, after attempting many different things to get the items to serialize under the same namespace as the array object itself, I came across a pretty simple solution which has worked nicely. (ref.

Create your own class to “wrap” the collection and serialize it under the proper namespace:

ItemName = "Guid",
Namespace = "")]
public class ArrayOfGuid : List<Guid> { }

After creating that class just change the data type of the collection in your original DataContract to the custom class:

public Guid[] MyArrayOfGuids { get; set; }


public ArrayOfGuid MyArrayOfGuids { get; set; }

Now you’ll be serialized in your own terms… Down with the man!

Permalink 1 Comment

Blog transition still in progress

July 17, 2011 at 12:09 am (Uncategorized)

I’m still in the process of migrating my blog from my old webspace to here on WordPress.

I also recently began working for a game development and entertainment company, so I’ve been busy with my dream job (and, as always, side projects).

Stay tuned…

Permalink Leave a Comment

Blog overhaul

April 21, 2011 at 3:50 pm (Uncategorized)

The blog has moved. Changes are in progress.

More soon. ^_^

Permalink Leave a Comment

Smooth keyboard input with GLUT

August 20, 2010 at 4:09 pm (Gaming, Programming/Development)

Recently, I’ve been learning OpenGL in order to ramp up for the still-in-progress Android game mentioned in previous posts.

In my Jedi training I came across a rather annoying behavior of GLUT – slow response to keyboard input. Specifically, response to keys that are held down. The repeat time is like that of a standard Windows app, i.e. in Notepad, press a letter key an hold it, the letter is displayed, there is a short delay, then the letter begins to repeat.
Now, this is all fine and dandy for most every application because immediate responsiveness is usually not necessary. Although, in games, this is awful and just plain unacceptable.

When doing some research, I tended to find three solutions to the problem:
1. Switch to normal Win32 development and use that message loop to handle input
Ick… Nein! I simply want to learn OpenGL, not Win32 programming.
2. That’s just a limitation of GLUT, live with it until you are ready to switch to #1.
Again, I say: nein! 容認できない!
3. Use DirectInput, it’s much better for handling Input on Windows
Ok, granted. BUT, again, I want to learn OpenGL here… for an Android app, I’ll come back to DirectX when the project necessitates it.

Fortunately, there’s actually a very simple solution that allows those learning OpenGL to continue to use GLUT for its inherent benefits all while receiving silky-smooth keyboard input with the added bonus of handling multiple-key input:

Use a flag variable on key-down to signal a press, swap the flag on key-up, update based upon that flag

Here’s an example:

In accessible scope

GLboolean upPressed = false;

In our glutSpecialFunc()

void SpecialKeys(int key, int x, int y)
   // ...
   // Stuff
   // ...
   if (GLUT_KEY_UP == key)
      upPressed = true;

   // More stuff ...

In our glutSpecialUpFunc()

void SpecialKeysUp(int key, int x, int y)
   // ...
   // Stuff
   // ...
   if (GLUT_KEY_UP == key)
      upPressed = false;

   // More stuff ...

In our glutIdleFunc()

void Update()
   // ...
   // Stuff
   // ...
   if (upPressed)
      // Movement kung-fu!

   // More stuff ...

That’s it! Not too bad, right? Not only is the input smoothed out, but now you can handle multiple, simultaneous key presses! This works rather nicely and I’m sure it can be applied to any key (not just “special” keys) or mouse button.

Take that Win32!

Permalink 2 Comments

One more time with Tetris, then I’ll drop it… I promise!

May 18, 2010 at 2:20 pm (Gaming, Programming/Development, Projects)

I can’t seem to stop adding features to my Tetris clone that I initially said I was going to leave out! It’s difficult to look at something you produce knowing that it is “missing” features that you know you could just take a few minutes to add. *sigh* The burdens of game development 😉

I went ahead and added functionality to display the “next piece”. It was just too important to the Tetris gameplay experience that I couldn’t leave it out and still feel ok about it.

Anyway, the game is still available here.

On a quick side-note:
The Android game project is still coming along. We are working on taking the existing game design doc and fleshing out a tech doc. After that step is complete we will begin coding the beast!
Exciting stuff!

Permalink Leave a Comment

Ok, I lied…

April 8, 2010 at 4:22 pm (Gaming, Programming/Development, Projects)

I did add a basic scoring system to my XNA Tetris clone and a system to make the game speed increase as time goes by. It was way too easy to play and play and play and play and never fail at the default speed, so the gamer in me couldn’t accept that.

With those additions, the game is essentially complete. There are other features I might add in the future – next piece preview, set piece “ghost”, quick-drop, speed increase based on score, etc.

Until then, enjoy the version I have and let me know if you have any questions about my code or find any bugs. (Hint: there are at least two minor bugs I know of, but we’ll keep that secret between us, right?)

Click here to download the full source and built executable.

Permalink 1 Comment

XNA Tetris clone & Mobile development update

April 7, 2010 at 1:52 pm (Gaming, Programming/Development, Projects)

First thing’s first:
I’m about finished with my XNA Tetris clone. The only feature left to implement is the game-over state.
I don’t plan on making this a fully featured Tetris knock-off with special effects, scoring and multiple game modes. The objective with this project was really a proof-of-concept for me; verification that I could develop the core gameplay mechanics and logic… the rest is fluff 🙂
Once I get that last part completed, I’ll upload the game and source for anyone interested in developing a Tetris-style game. I tried to keep it pretty thoroughly commented and clear.
Here’s a preview of the game screen (note my incredible artistic talents):
XNA Tetris

In other news:
The iPhone game that I was slated to work on is going to be completed without me. Well, technically, it’s going to be completed without my friend (mentioned in the previous post) or myself. It turns out the developer who is currently working on it is only about 1 month from code-complete and my friend and I don’t feel that it’d be in our best interest to try to cram and learn Objective-C for this project if it’d be finished a week after we are ready to go!
Instead, we are going to focus on Android as a development platform. The group that we are working with on this game plans on shifting to Android after this initial iPhone release anyway, so we are going to come in once they are ready for porting and future Android development.
There are added benefits to developing for Android as opposed to iPhone that also influenced our decision. The primary ones are that a Mac is not required for development and there are Android phones across multiple providers. Now, I know that these hurdles can be overcome with some h@x0ring and unlocked phones, respectively – but we already run Windows/Linux and we want to target the mass market, not just tech-savvy mobile device users.
Oh, and I already have an Android phone… so it’ll be easier to test our stuff on an actual device 🙂

Anyway, that’s all for today!
Next post will have the source for my XNA Tetris clone!

Permalink Leave a Comment

Tetris-clone update and a bit more

March 16, 2010 at 4:22 pm (Gaming, Programming/Development, Projects)

First of all, my Tetris-clone is still under development.
It’s coming along… slooooowly but surely. Free time to spend working on an personal game development project is hard to come by these days.

…and that is partly because I’ve become involved with a small, independent group of developers working on their first iPhone game. A college friend/developer and I were looking to hop into Android development, then he talked to another friend of his who was part of this iPhone game development effort. It turns out that they were looking for some more programming support, so he and I decided this would be a good place to start our mobile application development journey.
Yes, this is not an Android application, but plans to move to Android development – as well as iPhone development – are in place for the future.

After gathering some more information from this new group, I may or may not provide some details about the game. We haven’t discussed publicity yet, so I don’t want to reveal anything without consent.

Either way, it looks like I have a busy and exciting spring/summer ahead!

Until next time…

Permalink Leave a Comment


February 12, 2010 at 6:47 pm (Gaming, Programming/Development, Projects)

I’m starting a new “Projects” category for my blog. It’ll contain posts related to personal projects that I am working on.

First project to mention:

That’s right, I’ve decided to tackle a personal programming “unicorn” of mine, and attempt to put together a clone of the classic block-based puzzle game. When first getting into programming games, there were a couple times that I began throwing a Tetris clone together, but I could never quite finish it. I would get caught up with something like matrix rotation or handling the rows in the play grid.
I think I’ve finally gotten to a point where I can handle the problems I previously stumbled upon.
I’ll be using XNA for this project as it’s a solid framework with an easy to understand graphics system and many helpful libraries… plus, I haven’t gotten enough of a grip on DirectX yet! (That will be for version 2… ^_^ )

I’ll post the project on the “Projects/XNA” section of my site when it’s complete, and I’ll post status updates here when I can.

Stay tuned…

Permalink Leave a Comment

Next page »