I suppose it’s inevitable..

I would like to preface this post with the following disclaimer; I am not on the XNA team, nor have I been on the XNA team in almost two years. Do not mistake anything below for an “insider scoop” of anything because I do not know what their current plans are, nor do I know what their future plans are. Everything below relates to XNA version 1.0, and there are still folks who worked on later versions over in that organization. With that out of the way, I shall continue!

Shawn Hargreaves announced the other day he was leaving to move over to the Windows Phone team after six years working on XNA. I’m sure this isn’t a surprise to anyone who keeps even a rudimentary pulse on the XNA scene is subscribed to Shawn’s blog and has read it. However, for me it was a little bit bittersweet.

As the title of this post implies, I suppose it is inevitable. After all, as Shawn points out, he was working on XNA for over six years, and that’s a very long time to be doing one thing. However, with Shawn’s departure, from my recollection everyone that busted their asses to get the first version of XNA out the door has moved on from that team (not entirely true; there is still one person left in that organization who was there at the start of the XNA project, but he’s been on a different role now for quite a while).

The team that started XNA wasn’t very large to begin with, and we weren’t all “publicly popular” (such as Shawn, Kluch and myself), but the small group of us that were there from the start had a huge unknown challenge in front of us, not even sure if it would really work. We had a completely unrealistic release schedule (you want us done before the end of this year? right), were writing everything from scratch, and we had exactly zero customers.

I’m extremely proud of what we accomplished with that first release, and it was probably one of my favorite times at Microsoft. We almost felt like a bit of a startup within the company, and we were successful beyond our original ideas. By version two we had the concept of an “App Store” before Apple did (not to take anything away from Apple, there store is obviously more successful than XBLIG), and people were making money.

As often happens though, time goes on, new people are hired, other people leave. Inevitable. While I was there, we always prided ourselves on our ability to make good hires, so I’m sure the people that remain are top-notch, but it is still somewhat sad for me to look back and realize that everyone that made version one of XNA what it was has now moved on to other adventures in their career. I will always look back at those times fondly. Working with that group of people was a pleasure.

As for what line of code of mine that is executed the most, I can’t say actually since I had a hand in almost ever piece of the xna runtime. It’s impossible to run an XNA game without using some of my code, even now with me gone for a few years. In the runtime itself, it’s probably the graphics device creation still (even though that was changed in v4).. By now it could be the predicated tiling work or even the intro “XBLIG screen” that you see before every game. We should have collected metrics on this kind of stuff!

Tags:

Writing games and writing platforms..

Much like my love of fiction books, I have been a gamer for basically as long as I’ve been able to be. I have no idea where it started, but the first time I really I remember playing games was at a pizza place back in Saint Louis called Pantera’s. I played all kinds of games back there, although I remember wasting way too many quarters in Rastan. Before that there was Spy Hunter and if we go back far enough, even Pole Position. I’m sure there was probably others before that, but we’re edging back to the limits of my memory, I’m not *that* old after all.

At the time I was playing these though, it hadn’t yet occurred to me that there were people who actually created these wonderful things. Sure, it seems obvious in retrospect, but at the time I was a young kid, I probably would have believed that unicorns and fairies made the games I loved. I knew there was some kind of a computer in there, and that’s what I wanted, but we were quite poor at the time and couldn’t afford one.

Luckily, my mother saved up for a year and she was quite excited to finally give me a computer for Christmas one year, and boy was I excited to get it. It was an amazing piece of hardware called the TRS-80 (that has a nickname now of “trash 80″, but I didn’t care, it was a real computer). Looking back at that now, it’s kind of funny, the very first thing it said when you turned it on was Microsoft (MS did the BASIC for the system). Who would have thought that 15 years later I would actually be *working* at Microsoft, the computer had given me an inspiration I didn’t even realize.

The system came with the BASIC mentioned above and it was fascinating to me. I could type things and stuff would happen. I devoured the few “tutorials” in the book that came with the system and was anxious to find anything more I could. I started out probably the way many kids back then did, by copying huge chunks of text out of a magazine, not necessarily understanding what was going on, but being amazed by the results. Well, after running it the first time, realizing it was broken and then spending hours painstakingly trying to find the single spot I had messed up typing.

With that I knew what I wanted to do when I grew up. I would write games, and despite not even being a teenager yet, I was going to write the best game the world had ever seen. It was here that I learned a very powerful lesson; that being that writing a game was hard. I wasn’t even remotely qualified to do this.

I spent the next several years learning how to be a developer in general, always thinking of games in the background, but learning the basics. I learned new languages, being fascinated by the power of Pascal before migrating to C, and then discovering Visual Basic and realizing that as a development language, this was the beginning of a boon to developers everywhere. It had a low barrier to entry and could explode at any time.

Now, I still wanted to be a game developer, and I still didn’t think I was qualified to be one, so it was then that I decided what better way to become qualified than by opening up game development to the masses and help *everyone* become qualified. By now, I was already working at Microsoft and migrated over to the DirectX team and began a project that intended to bring the power of DirectX to Visual Basic. I’ve told this story many times, so I’m sure everyone knows by now that DirectX for Visual Basic turned into DirectX.NET which turned into Managed DirectX which turned into XNA. By the time I looked up I realized that I had been writing platforms for an entire decade, and still not writing games.

That’s when I switched. I moved over to Microsoft Studios (then Microsoft Games Studios) and started making games. So here we are now, a year and a half later. What have I discovered?

Despite both of them being writing code, and actually, even somewhat related code, the two activities are so very far apart. There are so many things you need to take care of for a platform (such as robust parameter validation) that you simply don’t need to worry about in a game. On the flip side, writing games has extra constraints you just don’t see on the platform side such as game designers. Ok, sure, you could argue that program managers help define the “mechanics” of APIs much like a game designer helps define the “mechanics” of the game, but once the program manager has defined the mechanics, she is done. The game designer must also make those mechanics fun.

There’s so much more creativity required when writing games as well. Sure, there is some creativity in designing API’s and functionality and feature set on a platform, but it’s not nearly the same magnitude. Actually, I suppose that isn’t fair, there is a lot of creativity in developing a platform, just not the type of creativity that excites me the way writing a game does; coming up with narrative, etc.

It’s also taught me that despite spending a decade making game development easier to do, I still have so much to learn. I would feel comfortable developing a platform completely on my own (hell, I have done it before), while I’m not sure I could say the same thing about writing a game. The work game designers do (and the way in which they think about things) is a skill I need to learn, and I’m thankful I have the opportunity to learn from a group of people who are amazing at what they do. Some of my coworkers have done design work on some of my favorite games of all time such as Command and Conquer; Gears of War; Alan Wake; Dungeon Siege; the list goes on and on.

That isn’t to say that I worked with less amazing people before (I’m sure everyone knows who Shawn is, which would disprove that), it’s just a different type of awesome. Developing a platform, the cool things we normally get to see could best be described as tech demos, and while they’re amazing in their own right, you normally have to wait for your customers to write something awesome to fully realize your initial vision.

If there was one thing I missed about being on the platform team it was the intimate knowledge of what was coming next. I just don’t have that anymore, and it is frustrating. I wish someone would say something about XNA and Windows 8 just like everyone else does. However, for where I was in my career and my life, making the transition to making games was definitely the right move for me. I can flex my creative juices and expand in the areas I am weak in.

It’s nice to realize that your dream job at eleven can still be your dream job at thirty six.

Tags: ,

I have a split personality

Well, that’s not really true, although I suppose sometimes people might think it is. The reality of the situation though is that there are a lot of people who have been “following me” for quite some time due to my work in games, or more specifically XNA, MDX, or perhaps because I’m just a generally cool fellow.

Recently though, I’ve spent a decent amount of time chatting about books, fiction and horror, and all kinds of things that have very little to do with game development (or even coding) at all. While I’m sure there are certainly some people who follow me and my random musing who also find these types of posts interesting, the reality is a large portion of the people probably do not.

On top of that, the folks that are interested in my ramblings about writing and fiction and horror books have almost certainly little interest in game development. So in short, the two potential ‘audiences” I would like to speak to have little overlap and forcing either into the subject they’re uninterested in seems lame at best.

So with that I’ve split my personality into two! This page will continue to be about games, game development, and all that fun stuff. My new site http://books.millermansworld.com will be focused on, well everything else, but particularly books and writings. However, it may well also contain random thoughts I have about non-gaming items as well, such as a piece I’m thinking about writing on public education.

I also created a secondary twitter account (@millermanbooks) because that seemed like the hip thing to do as well.

Hopefully I will see some of you in both places, and if not, well hopefully the content at whichever spot you choose is interesting enough to see!

Garbage detector from my Gamefest Slides

One of the last things in my slides for Gamefest was a simple little object I had written to help us detect when our code was allocating memory we weren’t expecting. Due to the size limitations of slides I had attempted to to shorten the object to the minimalist version, and in doing so lost a few things. Here is the object I used in its entirety:

public struct GarbageDetector : IDisposable
{
    public long StartMemory;
    public long FailAfterAllocationAmount;
    public bool CollectAtEnd;
    public GarbageDetector(long fail_after_memory, 
        bool collect_at_start, bool collect_at_end)
    {
        CollectAtEnd = collect_at_end;
        StartMemory = GC.GetTotalMemory(collect_at_start);
        FailAfterAllocationAmount = fail_after_memory;
    }
    public GarbageDetector(long fail_after_memory) : 
        this(fail_after_memory, true, false)
    {
    }
    public void Dispose()
    {
        long difference = GC.GetTotalMemory(CollectAtEnd) - StartMemory;
        if (difference > FailAfterAllocationAmount)
        {
            System.Diagnostics.Debugger.Break();
        }
    }
}

Not very much different than what’s in the slides, but a few subtle differences. The most important being whether or not ‘true’ or “false” is passed in during the two calls to GetTotalMemory. What does this code actually do though?

I wrote it basically to allow myself to “wrap” a section of code and measure any allocations from it. At the constructor of the helper object I measure the total memory in use and store how much allocation (in bytes) I expect the code block to take. Then at the end I measure the memory once more and if more memory was allocated than I was expecting I break into the debugger.

A few things to note. First, when you pass in ‘true’ to GetTotalMemory a full collection will occur, so if you are doing this often you will dramatically slow down your application.

Second, you’ll notice that the slides pass in ‘true’ in both spots which is probably not the behavior you want (you’ll notice in the code above that ‘false’ is passed at the end in the second constructor). If you pass in true in both spots, you will only catch allocations that were not garbage because any garbage would have been collected due to the ‘true’ being passed in!

Now, there are times when you do want to know this, so having the option is certainly fine, but the majority of time you want to know about allocations that create garbage, in which case you need to pass in false to the second call.

Another point I brought up during the talk that isn’t obvious is that this code completely ignores other threads. Which means if you have another thread allocating memory in between the two calls, you will get “false positives” that can prove difficult to track down. When I used this method I kept the code I wrapped in this object small to help eliminate them.

To see an example of using this helper in code see below:

using (new GarbageDetector(0))
{
    // Some other code
    new object();
    // This will now break in the debugger
}

Tags: , ,

Duke Nukem Forever, or when 14 years later is still too soon…

Duke Nukem Forever
Duke Nukem Forever

I first heard about Duke Nukem Forever before I even started working at Microsoft. In my previous job Duke Nukem 3D was one of the games we played constantly and we had more fun than we should have playing it. I was naturally pretty excited when I first heard about Duke Nukem Forever.

Of course, that was sometime around 1997, and I heard it was coming in 1998 if my memory serves me. I heard something similar for 1999 and 2000 or 2001 as well. After a few more years it became a running joke. 3D Realms kept saying it would be done “when it was done”, and “when it was done” seemed to be “never”. After more than ten years of “coming soon”, the game was completely cancelled a few years ago. Take-Two sued 3D Realms for wasting so much time and money and the game had completed it’s life by becoming a laughing stock.

Of course, behind the scenes there were still dealings going on. It turns out gearbox was in negotiations to release Duke Nukem Forever (one of the founders of gearbox worked on a version of Duke Nukem 3D). Finally at PAX last year they announced that the game would finally be released after 14 years.

Duke Nukem Forever ScreenshotI have to say that I was pretty excited. I imagine that nostalgia was kicking in or something, but it made sense at the time. I absolutely loved Duke Nukem 3D and the last gearbox game I had played was Borderlands which was amazing as well (I should write a review about that one sometime, if you haven’t played that game yet, go buy it now, it’s only $15). Between the next version of a classic game I loved being finished by a developer who developed a recent game I loved it was a perfect recipe for awesomeness. Unfortunately, even perfect recipes can be burned.

After yet another delay (minor in comparison to the others) Duke Nukem Forever was finally released on June 14th 2011 and since I had pre-ordered it I received it that day. I was excited to play it when I got home from work that day and jumped right in to do so. I played through a bit before going to bed that night. The next day when asked by a coworker what I thought of it, I summed up my thoughts by saying that “it is a terrible game, but I am glad I bought it”. By the end of the week I realized what a stupid statement that was.

First, the game starts off as a game inside the game and you’re literally pissing (or can be). I suppose that’s sort of funny, or at least it was when I was 11. Worse, the stall next there has a piece of shit you can play with for an achievement, and I’m not even making that up. I’ve been in the game for 90 seconds and I’m already covered in urine and feces? He was saying some classic “funny” lines though, so I forgave that part and continued on. The graphics looked like they were out of the 90s (oh wait, I guess they were), and while I never expected it to live up to some of the modern day games graphic wise, the poor quality of the graphics was jarring. There were mirrors all over and when I jumped, my character in the mirror simply didn’t move. In 14 years, couldn’t the artists figure out how to assign more than 6 bones to the character?

Duke Nukem Forever

I honestly expected most of the graphic inferiority to be a “by-product” of the game within a game motif that you start under. Yet, when that game was over and I was in the “real” world, the graphics were exactly the same, and I was quite dissapointed in that. Of course, who cares about graphics if the game play is top notch right?

Except, game play was horrible as well. It’s like they forgot what made Duke Nukem 3D fun. It certainly wasn’t his witty lines, they added flavour, a nice bonus, but didn’t make the game fun. It definitely wasn’t digitized boobs, and even if it was due to the grahpical inferiority displayed quite a few games out now show you better anyway. They took away the ability to hold every gun in the world down to having just two (which I didn’t like in Halo and still don’t like now). No longer do you have health, but now you have “Ego” which is simply a glorified health/shield combo (again, like Halo and every other shooter in the world nowadays it seems).

Yet, even after taking some of these “design decisions” for more recent games, they completely skipped some of the other ones like helping to improve aiming (via magnetizing or auto-aim or something) which made it into a complete chore to shoot things. Plus, I could barely tell if I was actually hitting the thing I was shooting at to begin with. Oh, and can we make a new rule? Water levels are terrible and they should be outlawed.

Duke also has a reputation for being cocky. I like that actually, I don’t mind arrogance at all, but you need to be able to back it up. Duke had the cockiness down without the amazingly good game to back it up though. Throughout the game he makes fun of Halo (when he see’s master chiefs helmet), Gears of War (Gears 0, Duke 1), Valve games (Half life or portal? who knows, he says “I hate valve puzzles”), all of which are vastly superior to Duke Nukem Forever.

Duke Nukem Forever screenshot

I normally don’t play a ton of multiplayer with these types of games (for a variety of reasons), but since I remembered all of the fun I had playing multiplayer back in Duke Nukem 3D, I gave it a shot here, and it wasn’t terrible, but it certainly had lost alot of the fun. The graphic problems were even more noticeable (it’s one thing when the image of yourself in a mirror is not moving while jumping, completely different when it’s your opponent). It’s still fun to shrink someone and stomp on them though.

After all that, I haven’t even talked about my biggest problem with the game, and that was loading times. I don’t know who worked on the system for loading in this game, but he/she/they should seriously consider a different line of work. I can’t fathom how anyone could look at the loading times this game had and think “yup, that’ll work”. You had 14 years to make this damn thing, loading should not take 45 seconds anytime something minor happens. I’m fighting a boss and I died? The last save point was exactly where the boss was? All you have to do is reset the bosses health and my health and ammo and we’re good to go? Nope, 45 seconds of loading time.

Now, I know that I’m a bit of a stickler for performance and loading times. I mean, I’m giving a talk about this exact issue at Gamefest next month, and I’ve given several performance talks at GDC over the years, so perhaps I’m just naturally inclined to notice them? I’ve had several other people who have complained about them with me as well, so it isn’t just me. These are extremely noticeable and very frustrating. Hell, part of me wonders if it wasn’t done on purpose, because I think I would have to work hard to get things to load so slowly (without putting artificial waits around everything). I simply cannot fathom what was going on during those loading screens other than maybe Duke was praying we would just stop playing.

At the end of the day, I bought this game on nostalgia and little else. For Duke Nukem Forever, nostalgia and 14 years simply wasn’t enough. The game needed a lot more work to be worthy of the gearbox logo if you ask me. It was one of my most disappointing purchases ever.

Tags: