Category: Development

  • When No Idea Was Crazy

    While I was cleaning out and throwing away some old junk, I came across some old promotional stuff for iSmell scent technology which I guess I picked up at the 2000 GDC. I saved it for humor value. The company (Digiscents) met its demise in June 2001, to no one’s surprise. I thought I picked up their SDK and documentation as well, but I must have thrown it out a long time ago.

    There’s an article linked from that Wikipedia entry titled “How Internet Odors Will Work,” but I’m afraid that it’s too much of a low-hanging fruit for even me to make a joke.

    Someone appears to have taken over the Digiscents domain, and is running a “digital scent technology blog.” (For a laugh, check out the Google AdWords at the top of the page.)

  • Apollo Justice

    I saw on Rock Paper Shotgun that Capcom has released a free Flash demo of the upcoming Apollo Justice: Ace Attorney game. As someone who recently played Phoenix Wright: Justice for All (my introduction to the series — I haven’t yet played the other two installments), I find this demo interesting for a few reasons:

    • Phoenix is no longer the main character.
    • The Flash rendition looks and plays exactly like the DS version of the game, and is purported to represent about half of the first case. This is pretty remarkable. It leads me to believe that Flash is actually their development platform for the series, and that they use a “baking” process to convert it into a format that they run on their DS engine. If this is the case, their development costs for the games must have been pretty low (and even lower for subsequent entries) — and, by extension, the revenues from the 2 million copies sold of games in the series are almost pure profit.

    My experience with Justice for All also got me thinking about the possibility of proving that the game can be completed. The gameplay does not allow for “retrograde motion,” so to speak, or failure (except in the case where your “health meter” is expended by frivolous objections). As such, it should be possible to test whether or not the game can be completed by simply applying all available actions (a list that is not particularly large) until “forward progress” is made. “Forward progress” could be defined as seeing new dialogue, getting a new item or contact, or going to a new cutscene.

    I imagine that, if such a tool were available, it would drastically cut down on the most time-consuming part of QA that would need to be done on the game — checking to make sure that it can be completed. (Inform, about which I keep meaning to write more, has a user-built “skein” that serves much the same purpose.) The Phoenix Wright games are not short, owing to the fact that they have tons of dialogue and many cutscenes. Cutting down the amount of QA needed would mean, of course, more profit, and probably an easier development cycle overall.

    I’ve inserted the embedded demo below — hopefully it doesn’t cause issues with your browser. I would say that the demo, while representative of the character and tone of the game, doesn’t show enough of the actual “gameplay” of the game, and doesn’t require much thinking to actually complete.

  • OpenWrt

    So I decided, on something of a whim, to replace the firmware in my trusty Buffalo WBR2-G54 router with OpenWrt, a modular Linux distribution for embedded devices. (I actually used the X-Wrt packages, which have a better web interface for configuration but are based on OpenWrt.) The WBR2-G54 is based on the Broadcom 4712 platform, and normally runs its own customized version of Linux (but which is not normally accessible to the end user).

    The process of installation was a bit maddening, as the newest “Kamikaze” distribution doesn’t work out of the box with the WBR2-G54 — the wireless interface doesn’t show up in the configuration pages. It took me awhile to figure out that the problem wasn’t with what I was doing, but rolling back to the earlier “White Russian” distribution got me up and running. (I used these two sources for instructions on flashing. Note that, in Windows Vista, you’ll have to install the TFTP client manually, as it’s not part of the default packages that are installed.)

    There are a few benefits (real and potential) to doing an upgrade like this:

    • Support for WPA2 security. The vendor firmware only supported WPA, and, even though my current wireless card doesn’t seem to support it (in spite of manufacturer protests to the otherwise), it’ll be good to have for the future.
    • The ability to use services like DynDNS, in case I want to access my home network while I’m on the road. This is another feature that was not supported in the vendor firmware. Couple this with Wake-on-LAN support, and it would be possible to use resources from home in almost any situation.
    • Being able to set up a VPN for home, again for purposes of working on the road.
    • Running any number of other packages to add interesting functionality to it. This InfoWorld article is a good overview of the possibilities. I have a feeling that, in order to be able to do all this whiz-bang stuff, I’ll actually need a router with more RAM and flash — the web interface for X-Wrt indicates that I’m already at about 84% RAM utilization with a default installation and a couple of other packages.

    I wound up having to install the miniupnpd package to enable UPnP support (necessary for the all-important Xbox Live on the 360), but other than that, I didn’t need to do too much else. Once I actually got the firmware flashed correctly, I would say that setting it up correctly isn’t much more difficult than with the stock firmware. Granted, you’ll need to know about the alphabet soup that is the world of networking, but the configuration process is fairly straightforward.

    One other possibility that I’m interested in is installing some kind of voice chat server on it, similar to Ventrilo or TeamSpeak — I’m not sure if the VOIP packages that are available would encompass this sort of thing, and the Mumble project would appear to be a no-go due to its server’s reliance on Qt. I’ll have to look into it some more.

  • Visual Studio 2008 RTM install

    I finally got around to installing the release version of Visual Studio 2008 on my machine. Fortunately, I checked around to see if there was anything special that I needed to do when uninstalling the beta, and found this article listing the recommended series of steps to uninstall the beta. I seem to remember there being some problems with uninstalling VS 2005 betas and then installing the final, so I’m glad that I checked. For those out there who don’t want to manually wade through that uninstallation list, there’s another article out there with an uninstall script that should do the trick.

    My impressions of the final version of 2008 are pretty much the same as from the beta — it seems like a pretty solid release, with support for .NET 3.5 and better extensibility support among other things. I may write up more later as I get more seat time with the final…

  • Code Size is the Enemy?

    “Size is the Enemy” is a Jeff Atwood (Coding Horror) article that has made the rounds lately. It’s a response to a rambling rant by Steve Yegge about how large code bases are unwieldy, and how language choice affects the viability of software projects beyond a certain size. Early on, Jeff calls out a quote that I, too, find really amusing:

    I happen to hold a hard-won minority opinion about code bases. In particular I believe, quite staunchly I might add, that the worst thing that can happen to a code base is size.

    I don’t think I’ve ever encountered a programmer who truly believed that “bigger is better” with regards to codebase size. Granted, the crowd I tend to run with isn’t exactly a bunch of Perl golfers either, but no reasonable person would doubt that complexity scales superlinearly with lines of code. So, at least with regards to the sentiment that codebase size should be minimized, I find myself in agreement with both — if you can reduce the size of your code while maintaining readability, then it’s an easy win. For example, on Neverwinter Nights 2, we drastically reduced the number of scripts required by adding a parameter passing mechanism to NWScript — I actually ran the numbers and discovered that 75% of the script calls in conversations used our new, parameterized scripts rather than the one-off style of scripts from NWN1. This is a great example of reducing code size without reducing functionality, and it made things much more manageable.

    I take issue with the second conclusion of Yegge’s article, though. While it’s true that functional languages can often express algorithms more eloquently than imperative languages, I don’t think this magically translates into huge maintainability wins in a monster codebase. Sure, the trivial example of reading lines out of a file makes other languages look great in comparison to hoary old C++. (I’m not sure if I’m allowed to call Java “hoary old Java” yet — after all, it’s only 12 years old or so.) But to hold up this example as proof of language superiority is missing the bigger picture — what makes an application distinctive is not how it reads lines out of a text file, but rather all the other stuff it does that no other piece of software does. The design of that “stuff” probably has more to do with maintainability than language choice ever could.

    The biggest factor in the complexity of a code base, in my opinion, is the complexity of its internal interfaces. I hate to trot out the quixotic concept of the “software IC”, but thinking about an interface in terms of building it onto a chip is a decent analogy in this case. Once you get beyond a certain number of “pins,” or command multiplexers, or what have you, things get complicated. When you have 500,000 lines of this kind of “complicated,” all interacting with each other in mysterious ways, you have big trouble.

    Now, I’m not advocating going gonzo with componentization, either, in spite of how delicious ravioli code sounds. I’ve seen and heard about way too many over-engineered, CORBA-gone-wild projects to make any kind of blanket statements in support of component architectures and stuff like that. But by keeping interfaces (whether internal to the code, or part of a component system) minimalist in nature, and designing them so that doing the right thing is easy, and doing the wrong thing is hard, you can maintain a good level of understandability in a codebase. I see no reason why this advantage does not scale with project size. Dividing a codebase into easily testable, well-defined components with simple interfaces is key, particularly for lone-wolf developers.

    I find it very interesting that the project in Yegge’s article (Wyvern) is not just a game, but a role-playing game. I know first-hand that RPG rules systems can, by their nature, necessitate a kind of code design that leads to massive complexity. RPGs tend to carry a massive amount of state around, and have rules systems that interact with that state in often arbitrary ways. (An example of this would be a character trait that changes the order of combat resolution, or some kind of “luck” trait that allows re-rolls of certain types of skill checks. If you have many rule-changers like this, it’s almost impossible to write a clean system to handle it.) This kind of complexity is design complexity, and has nothing to do with programming languages and the features they support. For this reason, I think that even if he succeeds in his goal of removing 33% of Wyvern’s lines of code, I don’t think that the resulting code base will be any easier to maintain. (His game is a 2D Java RPG — I don’t think that it’s a stretch to say that the majority of his code is going to be related to game rules and game content.)

    I think that both authors are missing a key point — namely, that if you can simplify your application or problem, you should do so. Wyvern should look more to Magic: The Gathering’s rules than D&D. (Granted, Magic has its own mind-benders, but I think that it’s fundamentally simpler than even the newer versions of D&D. Coming from a math professor, that’s what I would expect.) Granted, sometimes it’s not possible to simplify a problem any further, but in this case Wyvern appears to be a self-inflicted wound. And, finally, I am still in agreement that code size reduction is a wonderful thing, but I am less enthused about the opinions rendered in the language wars…

  • Even When You Wrote the Operating System, You Still Have to Work Around Other Peoples’ Bugs

    For all the grief that Microsoft has taken in the past about the bugginess (real or imagined) of Windows, they have definitely put in a huge amount of effort to try and erase that perception. Readers of Raymond Chen’s excellent The Old New Thing blog will no doubt be familiar with the many tales regarding application compatibility (including one about a game) and the extent to which Windows tries to accommodate buggy (but mission-critical) applications. They’re interesting stories to read, not only because of the technical details, but because of the business justifications for such endeavors.

    It just so happens that I ran into another situation recently where Microsoft has to play nice and accommodate somebody else’s misbehaving application. The Google Maps Windows Mobile application adds a command for mapping a contact’s address to the context menu for the contact. This is really convenient, and is very intuitive — you look up the contact, and then you can map their address. But in the otherwise excellent Windows Live Search Mobile application, you can only search contacts from within the application itself — you can’t go from the Contact screen to Live Search in the same manner as with Google Maps. It seems pretty clunky and counterintuitive.

    Since I figured this was a “slam dunk” kind of improvement, with no potential downside, I mailed the feedback address for Live Search and mentioned that it would be nice to have the same Contact menu functionality as in Google Maps. I got an amazingly speedy response (within half an hour) indicating that they couldn’t add that feature, because Google Maps had issues if another application tried to hook the same menu! Microsoft realizes that, regardless of who is at fault, that people tend to blame bugs on them, so in a case like this, it’s easier for them to step aside than to endure a torrent of tech-support questions.

    Fortunately, Google has apparently fixed the bug on their end, so this feature will be added to the next version of Live Search. It just goes to show that, no matter how big or small your company is, if somebody creates a useful application on your platform, you can become beholden to either the need to maintain compatibility with their bugs, or to their goodwill with regards to fixing their bugs. It’s a tough situation in which to be.

    The only remaining question for me is whether or not the mobile Google Maps app auto-updates — I know that Windows Live Mobile does, because it downloaded an update the other day. I don’t know if I’ll have to remove and reinstall Google Maps as well. Guess I’ll have to give it a shot…

  • Fixed: Size of the Moon

    The gaming blog Rock, Paper, Shotgun recently ran an article mentioning the next project of the developers of the 2005 PC game Boiling Point. That upcoming game, however, is not the real focus of the article (nor of this one). There’s a bit of pointing and snickering at part of a bug fix list for the first patch for Boiling Point — I’m sure that the bugs in the list seem pretty crazy to most people. I thought it would be fun and illuminating for non-game developers to give my best guesses as to what these bugs actually represent under-the-hood, and how they may have happened, solely based on the descriptions. Note that I haven’t played or ever even seen Boiling Point in action before, so my guesses may be totally incorrect.

    The aforementioned article had the following bugs highlighted:

    • fixed: the snake wasn’t able to bite you while you were crawling

      • I have two guesses as to how this may have happened. One would be that the player’s “hit box” and the player’s “personal space” (a space surrounding an object into which other objects can’t move — I’ve borrowed this term from Bioware‘s earlier games) are not always the same. When the player crawls, perhaps his personal space grows large enough that the snake’s weapon range isn’t long enough to reach from the edge of the player’s personal space to the player’s hit box.

        Another guess would be that the targeting AI for the snake (governing where to move in order to attack, and things like that) somehow got messed up when the player was prone, or had an early-out return.

        Odds are good that this slipped through the cracks because either it wasn’t tested, or that crawling was tested for other animals (but not the snake). Not uncommon.

    • fixed: size of the moon

      • My guess would be that, if there was actually a separate “moon” object (i.e. it was not something done entirely in code), that it was created as a copy of another object, and the size was never correctly adjusted.

        Alternately, if the moon was created in code, it’s possible that: a) nobody ever really looked for it, b) it was working at some point, and later broke, or c) if the game simulates lunar cycles, that testers explained away the missing moon by assuming that it was a new moon.

    • fixed: posters in bar vanish as you turn away from them

      • The culling code is buggy for that specific type of object, or the bounding boxes generated for them are incorrect. If the posters are built as three-dimensional solids with a very small depth, it’s also possible that it may be caused by numerical precision or other issues.

        Stuff like this tends to be pretty easy to notice, as long as it’s in an area of the game where players will commonly visit — I’m guessing that the developers knew about it, but it was not determined to be a “stop ship” bug.

    • fixed: dog does not cast shadows

      • For performance and artistic reasons, it’s common to have per-object flags to turn off certain effects or processing. The “cast shadows” flag was set wrong on the dog.

        Likewise, this is not a “stop ship” bug, so it’s a toss-up as to whether or not the developers were aware of it.

    • fixed: a metal clanking sound plays, if the user’s character stabs the curtains

      • As with the dog, this is an issue with incorrect data being set on an object.

        This is also not a fatal bug, but it’s one that I can easily imagine slipping through the cracks, since it is not only object-specific but weapon-specific as well.

    • fixed: jaguar floats across screen at treetop level

      • This is a tough one to hypothesize about without having seen the game. One possibility is that creatures in the game can be set as “flying” (unaffected by gravity), and this jaguar had that flag set on it for whatever reason. If the jaguar was initially placed on a slope, but then walked away, it would seem to be floating in mid-air.

        Another possibility is that it is somehow set to collide with coarse LOD bounding box representations of, say, a village, and is just “walking” on top of it.

        If this bug only occurs in one area, or with one jaguar, then I can see this potentially being missed during testing. If it doesn’t cause problems with the game, either they figured it was okay to ship, or ran out of time to fix non-fatal bugs.

    • fixed: npc die on contact with grenades, and not from the actual explosion

      • It’s not clear from the description if this is limited to friendly NPCs or not, but it’s possible that the damage resolution code for area-effect weapons has an (erroneous) early out for friendlies, while the damage resolution code for other types of attacks does not.

        This might be a case of a regression failure, where functionality that was working at one time later breaks due to other changes. Alternately, it may be a case of testers selectively testing ways of killing friendly NPCs. (Hey, it’s an anti-social thing to do in the first place, so I don’t blame them for not trying out every weapon on their buddies.)

    Like I said before, I might be totally wrong on some of these, but it’s fun to speculate and to try and understand how games are doing things under the hood…

  • Revision Control

    Having recently started to get more serious about development at home, I decided to install a couple of different revision control programs and give them a whirl.

    First, I installed Perforce. Perforce is a commercial version control system, but it’s free to use for up to 2 users and 5 client workspaces. I was already familiar with Perforce from my time at Obsidian, but that was from a user perspective — I was curious to see if setting up and administering a Perforce database was also straightforward. Fortunately, it is pretty straightforward — I was able to get things set up and working in minutes, and haven’t had any hiccups in my (admittedly simple) use of it so far. It gets two thumbs up from me.

    Next, I installed Subversion. This is the de-facto replacement for crusty old CVS, and it’s come a long way in the last few years. I installed it via pre-packaged binaries, and also added the Tortoise SVN Windows shell plugin and the VisualSVN package. My first impression of Tortoise was negative — the installer caused a problem with Windows Explorer that forced it to restart. Considering that shell plugins can cause a wide variety of mayhem, this is not an encouraging sign, even less so considering that my past experience with Tortoise (several years ago) resulted in the same strange issues. I haven’t used it for a project yet, but I’m somewhat discouraged by the fact that it does not integrate with the MS SCC API, and their FAQ response regarding SCC API support is just plain incorrect in parts — Perforce supports atomic transactions as well as the SCC API, and I haven’t yet seen the case where you would want to mix source control providers within the same solution. I’ll have to play around with this some more…

    A third option I wanted to try was SourceGear Vault. I’ve never used it before, but it seems to bill itself as a drop-in replacement for the much–maligned Visual SourceSafe. Unfortunately, it uses IIS and SQL Server as its back-end, which I don’t have (or want, at least for now) installed on my machine, so I couldn’t set up my own server and had to settle for checking out the demo server. My impressions were not super great — the demo server was slow, leaving the client unresponsive in many cases. While there appears to be support for atomic transactions, this only seems to include checkins — it does not include delete, rename, or other operations. This is really a killer problem in situations where you have even a small number of people working with a project — it adds “friction” to the seemingly simple tasks of reorganizing files, thus making people reluctant to do them (and more likely to put up with bad organization). The SourceGear website bills their products as solutions for “small and midsize teams,” but with the aforementioned weaknesses (and readily-available alternatives) I would hesitate to recommend Vault for anything more than a single developer. Fortunately, a single-developer license is free.

    I may try a few other options when I have the chance, so there may be a follow-up to this in the future. (After all, I still need to play around with Subversion some more.) But so far, it looks like I’ll be sticking with Perforce.

  • Watching Movies With Film Majors

    Having constructed the Potemkin villages that are game environments, game developers just don’t see games the same way that the general public sees them. Every game developer I know has, at some point (and usually, often) sat around with co-workers, playing the latest and greatest game and critically ripping it apart for problems that are both easily seen and those that are more subtle. “You can totally see a seam on that texture.” “Oh, great, another FedEx quest.” “This UI is terrible.” “That cutscene sequence was dumb.” “Weapon X is totally worthless.” “This game is so unbalanced.” There are probably a million more complaints that you could come up with. Knowing what goes on behind the curtain makes us understand limitations of game engines, where corners have been cut, and seemingly inexplicable design decisions better than most.

    When the Playstation 2 was released in the US, I sat in on our company demo of the new console. Partly due to the underwhelming launch titles, and partly just because programmers tend to be grouchy, we had plenty of fodder for complaint and discussion. But one of the more excited and forgiving souls in the room rolled his eyes and pronounced that, “Man, listening to you guys is like going to see a movie with film majors.” Truer words were never spoken.

    I recently read this great blog post about Mass Effect (a game I have not yet played), in which another game developer points out some of the tell-tale signs of triage, content cutting, technical challenges, and design changes. In addition, there’s also some discussion of how these situations come into being. Having been a big part of a large, ambitious game project myself, I can vouch for a lot of the bullet points discussed, and wanted to comment a little bit further on things.

    It is extremely rare for games to ship with the full feature set envisioned early on in the project — so typically, features and content are classified as either vital or non-vital. If, during development, a feature or piece of content is not working out, it can be cut if it is non-vital. The need to classify work in this manner early in the project’s life span, however, also begets a lot of the problems mentioned in that blog post.

    • “Undue or odd simplicity.” Game mechanics that sound great in design discussions may not work out so well once they are later implemented. (For example, the boss battles in Guitar Hero III have been pretty much universally panned.) Since a lot of resources may have been poured into these ideas, the preference (rightly or wrongly) is usually to keep trying to make them work somehow, rather than just cutting them. These triage efforts may take the form of simplification, or providing alternate methods to “get around” the balky mechanic. The latter category includes the “you’ve failed this part 5 times, do you want to just skip it?” crutch that has become popular in recent games.
    • “Significant differences between demos and the actual game.” Even if you do decide to cut a feature or some content, if you’ve ever showed it to the public or talked about it in the press, people are going to be wondering where it went in the finished product. And if you leave those vestiges on the shipped disc, you never know what might happen…
    • “Sudden narrative leaps and loose ends.” Cutting non-vital story content and dialogue can still leave awkward gaps in a story, even if it doesn’t totally compromise it. Characters that simply show up or disappear without a trace, deus ex machina, and sudden jumps in location or disposition all tend to be signs that some non-vital content was cut and patched up in a low-risk fashion.

    I also have to throw in some additional RPG-specific commentary on the “lots of bugs” category. RPGs tend to be games of large scope. They try to provide an experience that is more customizable (in terms of choices having an impact on gameplay) than almost any other genre, an engrossing and lengthy story, and interesting gameplay on top. If you imagine the gameplay experience translated into a directed graph of a player’s actions, RPGs tend to have very high branching factors compared to other game genres. This variability drastically increases the amount of test paths that must be checked, and even if you have a massive army of testers, it is extremely difficult to ensure 100% test coverage. I would go so far as to say that no modern RPG can achieve this. (The continual refinement and patching process of MMORPGs is a testament to this.)

    An anecdote of the complexity of RPG games was related to me by a former co-worker at Obsidian. He told me that, several years ago at Black Isle, there was some discussion of adopting the then-new Dungeons and Dragons 3rd edition rules (widely viewed as very successful, and which simplified many arcane aspects of earlier editions) into a game that was already in development and using an existing engine. As part of the feasibility study, effort was put into determining how the combat system would need to be changed. One of the programmers diagrammed the combat resolution system on whiteboards, and wound up using something like 54 square feet of whiteboard space on an incomplete flowchart of the system, before the decision was made that it not feasible to adopt the 3rd edition rule set. The vast number of feats, spells, and items that exist in modern D&D take a massive amount of effort to implement, and oftentimes have subtle, unspecified, or ill-defined interactions with each other. Granted, as far as complexity goes, D&D is fairly high on the scale, but even simpler rules systems are tricky to get right.

    Mass Effect is, by all accounts, not a short game, so I’m not surprised that it may seem buggy. But if game developers and publishers want to continue producing epic, complex RPGs, I believe that the tools for producing and testing gameplay content must become much better, and automated testing of gameplay scripting must somehow become a reality. Ensuring that changes and additions do not break progression in an RPG can sometimes be a very time-consuming process, because a bug may only affect certain character types, later parts of the game, or (worst of all) be randomly-occurring. To put this in perspective, for NWN2, we had testers who were “sprinters,” whose job was to simply go through the game as quickly as possible, to ensure that the “critical path” of the story was working and viable. If I recall correctly, “sprinting” through the game took about 20 hours. When you need a multiple-day test to really ensure that a change hasn’t caused another problem somewhere else, your iteration time and desire to make polish changes suffer.

    One source of direction and inspiration is Inform, the interactive fiction authoring system whose latest incarnation uses a natural language system to construct gameplay. I’ll probably have more to write about Inform later — I think it’s fascinating and a tantalizing glimpse of the possibilities of higher-level gameplay tools.

  • XNA Game Studio 2.0 Beta is out

    It can be found here. The biggest new features include integration with all SKUs of Visual Studio 2005, and support for Live on both Windows and the 360. The Visual Studio integration is huge, in my opinion, if only because it enables source control and add-in support for developers. I guess now you’re also able to use mixed-mode debugging for XNA projects, but I believe that is only useful for Windows-based projects — I can’t imagine that they’d ever allow unsigned code execution on the 360 (for security reasons). One can always hope, though. 😉

    They claim that the final release isn’t far off, either. With Visual Studio 2008 having just been released to manufacturing as well, I would imagine that there will be a refresh for XNA Game Studio that will include support for 2008. (The 2.0 beta doesn’t seem to integrate with 2008, or at least Beta 2 of 2008.)