Those of you that know me know that I really enjoy cooking. Well, really, I enjoy eating good food, but I’ve found that the easiest (and most inexpensive) way to get good food it to make it yourself. So, tangentially, I enjoy cooking.

As a result, I spend a lot of time online looking at various interesting recipes on the internet (and through cook books, but this post is mostly about the internet). One thing I’ve found is that most sites that offer a good deal of recipes, are lacking in their actual usability; not because they’re not designed like other sites, but because they’re designed exactly like other sites. Most of them are designed as simple lists of categorized articles or blogs, with ratings and comments. This may be fine for most blogs or new sites, but cooking is this inter-related web of techniques, derivations, substitutions, and adaptations that (in my mind) can’t be served properly by this common model, but does lend itself well to the web in general. The problem is that people get locked into this core method of usability, and don’t realize that it doesn’t work in all situations.

This, in my mind, actually violates a core tenant of usability in information systems: get the information that the person needs to them as quickly as possible, and allow them to access related information quickly and easily. For cooking, this is not just related reciepies. This may mean linking them to information about the techniques required for a particular recipie (creating a roux, blending a soup, searing a piece of meat, grilling, broiling, etc), the potential ingredient substitutions (can I substitute different types of mushrooms, stocks, water, etc) or additions (can I add garlic, Tabasco sauce, or rice to this dish, and where). Additionally, potential side dishes, wines, derivations (versions of the same recipe that use similar but different ingredients) and nutritional information are all common things I want to see with a recipe, but rarely see in any web recipe outlet.

And don’t get me started on comments. 90% of comments of recipe sites are worthless: “This tasted great! I will do it again!” is pretty common. But that last 10% is sometimes useful. “Lightly salt the zucchini to drain the moisture first,” “Added garlic to this dish and it really brought out some of the flavors,” are good comments, and are related specifically to an ingredient, addition, or substitution, so why are they at the bottom of the page instead of where it might be useful to me?

What does this have to do with games? Well, nothing really, but it does point out an alarming trend in general usability: this idea that once you’ve found one system that works, you tend to apply it to other systems where it’s not as useful, or (worse) where it doesn’t make sense. So, when you’re designing your user interface for your next game, just think to yourself for a second: “Am I designing this interface this way because this is the easiest and best way to access this information, or because it’s the way it’s always been done.” You’ll be surprised how often you answer yes for the later, and find another, better way to do it.

A while back, Brenda posted this nice post giving advice for “newbies” who want to keep a blog. So, I totally agree with all her points about how you should keep a blog as a student, but I found it interesting that I’ve basically violated almost everyone one of them: I don’t update on a set schedule, I occasionally will post something completely unrelated, and my blog has kind of shifted focus over the past year from being purely about game design theory to a blog that shifts between programming and game design theory. Am I exempt since I’ve held a game programming job and currently work at a game middleware startup? I’m really not sure, but one thing I have to wonder is whether or not my lack of focus or a set schedule affects my audience or my readership.

Personally, I think the schedule idea mattered more before the days of RSS, when you had the “morning crawl” every day when you got to work. I still do the “morning crawl” but it’s mostly just a crawl of RSS feeds that I didn’t get around to reading the day before or missed articles from. Whether or not they’re on a schedule or not doesn’t affect me, and I wonder how many people are the same. In fact, a blogger that posts too much I just tend to ignore, since I find I usually just can’t keep up. Again, I wonder if this is a common phenomenon.

As for focus, I think that’s an interesting question. I post mostly about programming and weird game design theories, and interestingly the two subjects are about as far apart as I can make them. The programming side is very practical, talking about how I solved very specific problems, whereas the game design stuff is all theoretical: not a single practical piece of information in that category really. The third major category for me is newbie advice, which I’m always happy to hand out. I think more people found my blog from the Top 10 things response than any other single article (mostly because of the Game Set Watch link), and I’m sure some people subscribed to my blog after that expecting more newbie advice. So I’m happy not having a focus per-se. But of course I don’t really jump fields completely, I guess you consider this blog focused if you squint your eyes and cross them a bit.

Anyway, I’m interested to hear what my readers have to say. Would you rather have me update on a set schedule? Would you rather have me focus on (or at least post more about) a particular subject? Would you rather I not talk about agency theory quite so much? I’m interested in what people have to say.

I've attempted to redirect all of my feeds to Feed Burner. As a result, you may see a break in service, or you may not. I"m hoping not, but technology can be confusing some times.

What I'm hoping is that I'll get a better idea of how many people are subscribed to the blog. I mean, I am working at a metrics middleware company, so I guess it's about time I started applying metrics to my own site.

I've updated my MetaGameBot to include some things I've wanted for a while. New features include:

  • Reconnecting if it ever gets disconnected (which has happened a lot). It's a bit more fault tolerant now I guess. Probably will still have lots of down time, but at least it's better!
  • You can now ask the game bot for information on any of the categories on Metacritic, not just games. By default, it still just searches for games, but now, if you start your search with a category name (Movie, Book, Game, TV) followed by a colon it will search only in that category. It may not be useful for some of you, but there are many times where I've been in a movie store looking at a movie that looks interesting that I want to know about. Now I have access to it right at my fingertips.

That's it. Enjoy the new Rankings bot!

The more I use it, the more I feel that C++ was never really made to be "user friendly." Now, regardless of all the compiler options, the intermediate objects, linking and all the various errors that can occur because of all those things, the language itself strikes me as one of those things that was occasionally, well, just not well thought out.

This is the code snippet that made me think this today:

template <const char *EventName, typename DataType>
class EventType
{
	// etc...
};
typedef EventType< "TypeName", MyDataType> MyType;  // This is illegal.

Now, the reason this can't be done is because the string needs "external linkage", which means you have to declare it as a variable before hand. Except that the VC compiler doesn't accept that either. It's just one of those oversights that makes me go... WTF?

Last night, on the way to the Post Mortem, I got into a discussion with my co-workers about my last post, which led to a discussion about the types of games we like. I, of course, related this all to agency theory, and started looking at things through the perspectives of what types of control (or illusions of control) people enjoy in games. What was great was that, talking in these terms, it was actually pretty easy to classify what we liked in games through this lens, far better than if we were to talk about them in terms of genre, or even other methods that are being researched now. Being able to do that is very exciting. For me anyway.

So, I thought I’d share for you some of the types of agency we hit on, and a few very interesting points about not just classifying games though types of agency, but understanding them. Let’s use Darius as an example. It turns out Darius really likes strategy games and tactical RPGs. When we dug deeper, we started seeing that what he likes in these games is the agency over the improvement of his characters, what I call “improvement agency”, over the long term and in a complex fashion, as well as the short term agency of being given free reign over single battles, and the agency over the difficulty (basically improving his own understanding of the system, and making smarter decisions over time).

This gives us a whole bunch of classifications of agency I hadn’t considered before: simple vs. complex, short vs. long term, and internal vs. external. Any game can have any combination of these in many different types of agency.

Adventure games, for example, tend to have simple short term agency over the narrative, through solving puzzles. A few also have simple long term agency over the narrative, where certain decisions affect later narrative in a small way. Very few will have complex long term narrative agency, where a single decision affects the entire game, but this is rare. More common is the illusion of long term agency, with Deus Ex being the perfect example. Here, it always feels like decisions are affecting long term goals the plot, but, in reality, all of the agency is short term and contained, with a long term illusion over top of it.

Strategy games (especially turn based strategy games) usually focus on giving the player long term agency over the improvement of their units, and short term agency over single battles. In games of strategy like chess, the complex, long term agency of the position of the pieces over time is what’s most engrossing, whereas the short term agency of taking pieces is minimized. In the RTS, however, the long term planning tends to be minimized through races for certain units, and it’s the short term battle to battle agency that’s rewarded.

I could go on, but you get the idea. What’s really cool is that none of these agencies really conflict. You can have short and long term improvement in units in strategy games, just like you can have short and long term affects on a narrative in the same game. You can have improvement agency in a game that focuses on short or long term narrative agency, or in a game that uses only difficulty as its primary system of enjoyment. Additionally, you can have single parts of the game be very short term focused, with the longer, over arching game being more complex. This is how I think game stages work and make certain games more interesting.

That said, not all people like all types of agency, and not all people like having lots of it available. We’re all familiar with the term “freedom paralysis,” something that occurs when there’s just too much available for you to do. Different people have different levels where freedom paralysis occurs, and, even more interestingly, different types of agency that will cause freedom paralysis. For example, some people will look at the giant, open world of Oblivion and basically give up right after the character generation quest. That same person may take a look at all of the options for expansion in a Japanese RPG and eat it up, even though there’s probably more to see and do in those games. For me, side quests in games like Rouge Galaxy gave me freedom paralysis. There was just too much to keep track of and I felt like I had to do it all. But sit me in front of Jak and Daxter or Ratchet and Clank and I’ll get 100% completion.

So, there is no right or wrong type of agency to use, but you should always analyze the audience you’re going to be marketing to, and figure out what types of agency they tend to enjoy, and what types of agency they tend to not enjoy. Additionally, you need to make sure that, for your audience, you’re adding the correct level of agency so that they won’t get overwhelmed (suffer freedom paralysis) or feel the game is too simple. It’s not easy, but it can be done.

Edit: This post was superseded by this one. Basically, I realized that this approach for C++ is way to hard and not worth the effort. So, if you're interested in testing generated code, especially in C++, I'd go read the other article. However, if you're curious as to how to build, load and test a C .dll, this would be the article for you.

So, as you may have noticed, I’m enamored with the concept of automated testing. In my opinion, it’s really the only way you can actually be sure your code is working as intended. You can’t rely on you code reading skills, and even if could, things that “makes sense” don’t always work. Now, I know unit testing doesn’t actually prove your code works (though there are ways to do that as well), but it does let you know that it works in at least the cases you’ve tested (in perpetuity if you run the tests after every build).

Recently, I ran into an interesting problem concerning unit testing . For our metrics suite, Orbus is creating a code generator, and supplying templates for various languages. The problem was how do you write a unit test (or functional test in this case) for a code generator? In my mind there are only a few options:

  1. Take a test case and write out the code you want the generator to generate. Compare the generated code to the known value with a diff utility.
  2. Run the generator once, and take this as the known value. Compare the generated code to the known value, again with a diff utility.
  3. In a functional test, run the generator, compile the resulting code, then run it with various inputs, testing its outputs (much like a standard unit test).

In my mind, the first and second options are an exercise in futility. In reality, you don’t care about the text in the functions, you care about the fact that the generator produced functions that take certain parameters, and produce certain output. By trying to compare the text, you don’t actually get one of the main benefits of automated testing: discovering whether changes you made internal to the code (via refactoring or by adding additional functionality) have broken it. In this case, you want to be able to change the code generated inside the functions whenever you want, so long as the signatures remain the same and so long as the produce they proper output to external libraries. Basically, you want to treat your generated code as a black box.

The problem with the third option is that it’s really hard to do for some languages. Scripting languages, it’s pretty easy right? Just load up your trusty interpreter and feed it a few scripts that utilize your library. .NET languages have it pretty easy as well, since most of them have CodeDom objects that allow you to compile assemblies on the fly and load them. .NET’s reflection also allows you to check the number and types of parameters you’re loading, so no problems there. In reality we really only have a problem with native, compiled languages. For me, this was specifically a problem with native C++. Thankfully, I’ve actually “solved” the problem (at least for a C interface) in C# unit testing. Here are the steps our functional tests go through to test our generated code:

  1. Generate the code to a temporary directory and build it into a .dll. The .dll I built exposes all of the API functions that someone could use from the generated code. This isn’t hard to do using preprocessor macros and the like, and we need to do it anyway so that potential clients can use our API in a .dll if they so choose. To aid in the building process, the generator also builds a .vcproj file (it’s just XML) for all of the generated files and then uses devenv /build to build it.
  2. Load the library and do any initialization. Using LoadLibrary, you can get a handle to a loaded .dll pretty easily. Initialization is where things get hairy. In our API, we need to supply a connection object to a (static) initialization function. This object is really what generates the “output” of our library, so I wanted the connection object to be accessible to our C# unit tests. To do this, I created two mock objects in C++/CLI, one managed connection object and one unmanaged connection object that contained an auto_gcroot structure to the managed connection. I then pass the native class to the initialization routine, like so:
    typedef bool (*InitFunc)(Connection*);
    Initfunc proc = (InitFunc) GetProcAddress(module,”InitFunction”);
    MockNativeConnection* pconnection = new MockNativeConnection(managedConnection);
    proc(pconnection);
    

    Now all calls into my libraries will use that connection object (it’s a singleton) so it’s a pretty easy way for me to check that everything is running nicely.

  3. Use P/Invoke to call out to your system. Now, you could write typedefs out for all the functions you’ve generated and call them in C++/CLI using the same “GetProcAddress” from above, but since I want to do the actual tests in C#, it makes more sense to use the DllImport attribute from C# to import the methods you’re looking for. Furthermore, P/Invoke will do automatic marshaling of most of your types, and will automatically do name matching for you. In general, it's just an easier interface to use over GetProcAddress. Here’s an example:
    [DllImport("MyDll.dll", CharSet = CharSet.Ansi)]
    static extern int LogEvent(string asDataPoint1, int aiDataPoint2);
    
    [Test]
    public void TestLogEvent()
    {
    	LogEvent ("My Test", 1);
    
    	Assert.AreEqual("LogEvent", _connection.ProcedureName);
    	Assert.AreEqual("My Test",  _connection.Parameter[0]);
    	Assert.AreEqual(1, _conneciton.Parameter[1]);
    }
    

    This tests that my event generated method (LogEvent) told the connection object to execute the “LogEvent” procedure with the two parameters I supplied.

Now this may seem like a lot of work, but it’s worth it if you fell that you’re either going to be changing your generators a lot (or if you want the peace of mind of having these tests around) or if (like me) you’re going to be generating for a lot of different languages and platforms that can all compile to .dlls. With this library, I should be able to test any language that compiles to a native .dll no problem (so long as it exposes a C-like interface and doesn’t use any structures….)

Next, I’m going to work on grabbing C++ objects from the .dll instead of just a straight C interface and testing those. This stands to be a much more daunting task, since, unlike P/Invoke, I can’t rely on auto marshaling, and I can’t actually code the structures if I want them to be reusable. I’ll write up what I find.

It's been quite some time since I've posted, but some major life changes have taken up a lot of my time since GDC. Specifically a career change and a move, and all of the stress that that implies. Both of these are the result of leaving Bethesda and going work at a new startup, Orbus Gameworks, located in Boston, Mass to work on gameplay metrics middleware and consulting. You're probably already familiar with my co-worker and boss.

For me, this is a very exciting opportunity to test out my programming, task management, and leadership chops, none of which are really at the point that I'd really like them to be at, but there's really no better way to strengthen them right?

For the blog, what this means is I'll be able to post a bit more often, and about a bit more, especially related to programming. In the past, I've been hesitant to talk about challenges I've faced and overcome at the workplace related to process, general programming and tool development, and other things. In the future, I won't be so hesitant, partially because I really don't have to clear the posts through anyone but myself (and maybe Darius). Hopefully, everything will just be a lot more open at the blog from now on.

I know I promised these slides on Monday, but I was busy driving (yes, driving) back from Orlando and it totally slipped my mind. However, better late than never, so the updated slides are now available. There were only a few minor changes to this talk, mostly just in explanations of some of the patterns, as well as an additional slide explaining why engineering is important. Other than that, pretty much the same.

GDC is coming up. I'll have much to say about it afterward. By the way, if you are not subscribed to it already, I highly recommend reading the ScholarBlog. It's a blog I started 3 years ago for the IGDA GDC Scholars to write about their experiences at GDC. Although not as rife with content as I would like, we've gotten a few people to volunteer this year, and I'm hoping they'll supply some interesting insight into the life of a GDC Scholar.

Wired has a great interview with Alex Rigopulos, the CEO of Harmonix, probably my favorite game studio at current (since I'm a huge fan of all things rhythm game related). Aside from all of the interesting discussions on downloadable content and marketing niche games, the small snippet on motivation caught my eye:

My feeling is that game creators need to devote themselves to the specific set of creative impulses that fuel them. And in the case of us, the thing that's been pushing the team at Harmonix is this notion of recreating the emotion of music performance. That's really what the game designs all revolved around. In other cases, with Matsuura as another example, character and story is at least as big a part of what those experiences are about as is the actual gameplay. And so for them, as creators, it's getting their creative juices flowing, and so they need to find a way to integrate story into the experience. And so I think what it comes down to is what's the right formula for the market, but what's the right formula for a particular game creator that's going to drive them to create something powerful?

Just an interesting quote and one I can whole heartedly agree with.