Memory Card Bugs (and a note about static analysis)

I was watching John Carmack’s QuakeCon 2011 keynote, and he mentioned that Rage was currently in the stage where they are creating cert builds, and just fixing bugs like (paraphrased) “getting a multiplayer invite and pulling your memory card out.” Memory card bugs are one of those things that tend to be a big annoyance for game programmers, because of the number of asynchronous use cases that need to be handled and the need to tie what are essentially supposed to be serial operations to a game that may be doing many other things in parallel. (Memory card support was optional on the original Xbox, due to the guaranteed presence of the internal hard drive. Accordingly, hardly any games actually support managing memory cards directly in-game.)

Carmack’s mention of memory card bugs reminded me of a funny story from Obsidian. For the Onyx Engine, one of my coworkers was working on writing the save/load code and then fixing bugs in the system, including memory card bugs on Xbox 360. Many of these bugs were timing-specific, so he would remove and reinsert his test memory card to try and reproduce the bug. Eventually, though, the first memory card slot on his development kit broke from the repeated (and potentially forceful, because of the need to try and reproduce specific timings) insertions and removals of the memory card. He had to switch over to the second slot on the kit — which, thankfully, survived until the project was over.

Another thing that came up in Carmack’s keynote is the use of static code analysis. He mentioned that id have drunk the proverbial Kool-Aid as far as static code analysis goes, and mentioned that turning on the “/analyze” switch for Xbox 360 builds (a flag that the XDK compiler supports — normally I think you need the Ultimate version of Visual Studio) brought to light many issues with their codebase. I can also vouch for this — I used to do this semi-regularly at Obsidian, and every time I ran it there were several subtle bugs that were sniffed out. It’s really worth using if you have it available.

A Musing on Sirius Radio

On Sirius, why is Lithium (the ’90s rock channel) so terrible in comparison to the excellent First Wave channel? I listen to both regularly, and I’m still hearing unusual or rarely-heard tracks on First Wave. It’s great. On the other hand, on Lithium, I’m guaranteed to hear a steady diet of the same Soundgarden, Alice in Chains, and RHCP songs, over and over. I’m sick and tired of the lack of variety and lack of actual DJs on that channel — it’s amazing how much they add to First Wave and other channels (namely Sirius XMU).

The Kindle is really picky about USB cables…

I decided to try setting up Calibre on my machine to manage my e-books, and rather than use the e-mail sync functionality with my Kindle, I figured I would just sync it via USB. I attached it through another micro-USB cable that I happened to have attached to my computer, but I had weird issues where any file I/O would cause the Kindle USB drive to become unmounted and then remount. This was extremely strange, so I tried removing all software from my computer that might be related to the problem: Virtual CloneDrive, VirtualBox, etc. This didn’t fix it. I updated the USB drivers for my motherboard, to no avail.

Finally, after a bit more Googling, I saw that some people mentioned that they tried plugging the Kindle into a different USB port on their machine. That didn’t work for me, but changing out my cable for the official Kindle cable made it magically work. Very strange!

So for anyone who’s having problems syncing their Kindle via USB, make sure you’re using the official cable (or a high-quality cable, at least). I initially thought it might be a 64-bit Windows 7/Vista problem, because I saw some other reports of problems with it, but at least in my case it turns out that it was the USB cable I was using.

Windows 7 Mobile Device Center not recognizing my phone over USB

I had some issues setting up my increasingly old and decrepit phone with my new machine – I installed the Windows Mobile Device Center, but it refused to recognize my phone when connected by USB. I seemed to be having some other issues at the time, and had an aborted attempt to install the proper USB drivers for my motherboard’s controller. I went through the following steps:

  • uninstall Windows Mobile Device Center
  • uninstall the unidentified devices in the Device Manager
  • reboot
  • install my motherboard’s “proper” USB driver (NEC)
  • reinstall Windows Mobile Device Center
  • Try connecting via USB again – it still failed, as before.
  • Slap in my Bluetooth adapter and connect via Bluetooth. When I did this, it seemed to install the mobile device.
  • I also had to delete my two existing PC partnerships before setting up the new one. Now it all syncs correctly.

Annoyingly, I still cannot sync via USB, but at least the Bluetooth works. I could have probably skipped to that, but I’m so used to syncing via USB that I wanted to get that working. I guess I could probably start sifting through the RNDIS driver error logs and see if I can find anything there, but considering that this whole epic saga started because I needed to sync someone’s address to my phone so I could mail them a package, I don’t want to get sidetracked too much more…

A Gross Overgeneralization

From David Chisnall:

If you find yourself optimizing your code, then it means that the author of your compiler has failed.

This is just very, very untrue. Even if you strike algorithmic optimization from the picture, code optimization is still a very important and useful skill to have no matter what sort of programming you’re doing. Knowing your target platform, knowing the behavior of your compiler or interpreter, and knowing your data (hat tip again to Mike Acton for driving this point home to me) can provide you with ideas on how to transform your code and realize massive performance gains.

If you’re writing performance-critical code, no compiler is going to do everything for you – the best optimizer is still between your ears. The idea that poorly-performing code can be blamed on the compiler is simply naïve and defeatist.

Our Magnificent Bastard Tongue

Our Magnificent Bastard Tongue (Kindle version) is a book that my wife gave me awhile back, and to which I finally got around to reading. It’s a bit of a strange book – it purports to challenge existing dogma about the origins of modern English, but does so in a manner that seems too casual for academia proper, and yet still too involved for most laypersons. The capsule summary of the author’s view is that Celts and Vikings are mostly responsible for some of the oddities of the English language, rather than the “punctuated equilibrium” that mainstream linguistic thought champions. The erosion of verb conjugations and the presence of meaningless “do” words are cited as some examples of these, which are found in precious few other languages.

As someone who knows very little about linguistics, I feel that I was able to understand the book’s arguments but not critique them – it seemed pretty reasonable, but without a more thorough background in the subject I’m sort of hesitant to embrace it as truth. I did find it very amusing and interesting that the author, John McWhorter, went on a bit of a tangent to attack one of the more interesting bits of language-related theory that I had read about in college: the Sapir-Whorf Hypothesis. Back in college, I remember having some doubts about its veracity (namely, that it seemed unbelievable that a people could be limited in their ability to participate in the “modern” world just by virtue of quirks of their native tongue), but McWhorter brings up several other reasonable objections to the theory and its formulation.

All in all, I can recommend it as a thoughtful, dense, and short read. It’s unlikely to spark any epiphanies for the average person, but still an interesting book nonetheless.

The Xbox (1) Live Shutdown and Secret Weapons Over Normandy

A few months ago, Microsoft announced that it would be shutting down the Xbox Live service for the original Xbox on April 15, 2010. I haven’t played an Xbox 1 Live game in years, but this news still makes me a little wistful, because for the first time something that I’ve worked on will essentially no longer be available anywhere. I’m referring to the downloadable content for Secret Weapons Over Normandy – there were three packs, each containing a challenge mission and a new plane. According to this list, there were only 53 games on the original Xbox that even had DLC, and ours was in the earliest 20% or so of that. (Wikipedia doesn’t have a dated list for downloadable content, so I’m merely going by release date of the original game, which may not be accurate – I seem to recall that the Yavin Station DLC for KOTOR only came out after the PC version shipped, which was many months after the Xbox version.) I remember at the time that it was still a novelty for a game to support DLC – I think the only game up until that point for which I personally had downloaded DLC was MechAssault.

At that point, publishers and developers hadn’t really figured out their DLC strategies yet – they tended to come out at odd, uncoordinated times, and since you couldn’t bill users for it, there wasn’t a direct financial motivation for producing it. (I’m guessing Microsoft probably paid LucasArts for the DLC, but I have no real knowledge about this.) In hindsight, it seems a little quaint to produce DLC for a game without Xbox Live multiplayer like SWON when there was no ability to monetize it. Then again, the time investment in producing the DLC was pretty modest – creating and setting up a new plane was a fairly simple process, and we had an awesome mission editor, SLED, that really made it fast and efficient to create new missions. Comparing that process to content generation on current-gen games makes my head spin, to be honest.

The DLC was pretty much ready to go from the launch date – we had spent less time in certification and re-submission than we had planned, and so the DLC content was started and finished sooner than expected. I also seem to recall some feedback from Microsoft that our DLC was the first that had passed cert the first time through – I’m not 100% sure if I’m remembering that right and that we were the first, but passing on the first submission was definitely something that they highlighted and was a nice feather in our cap. Our engine design and the relatively self-contained nature of the DLC definitely helped with that. (Certification in general was actually a breeze on that game – we passed SCEA cert on our first submission, and I think we only had minor fixes for SCEE and for MS. The project schedule was built around the assumption of two resubmissions for each platform/region.) I think the DLC came out one pack at a time, a couple of weeks apart from each other, and all of the game content was out by early-to-mid December 2003.

My involvement in the DLC was pretty peripheral – I just played it a few times and gave a little feedback. At the time, I think I was working on the Japanese localization of the game (for PC and PS2), which needed some additional code and tool work. That version, incidentally, is the “final” version of the game – there were a couple of tiny bug fixes I made that missed the US and European releases, and of course none of the Japanese text and font rendering stuff was in the earlier releases.

Thoughts on Dragon Age

I’ve been meaning to write this up for awhile, since I beat the game a month or two ago, but only just now got around to it.

I quite enjoyed the first 10 or 15 hours, tolerated the next 35 or so, and then slogged through the last 20. I would say that once the joy of discovering a new world wore off, the rigid structure of the gameplay took over and gradually wore down my positivity. I played as a human mage, and after the first 20 hours or so, encounters devolved into one of two types:

  • the party’s alpha strike is successful in obliterating most enemies, and the rest of the battle is just meaningless mop-up which requires no supervision
  • the alpha strike doesn’t kill many enemies, forcing a long drawn-out battle where you cycle through your spells and skills, chugging potions as necessary.

The first portion of Dragon Age did a great job of introducing the world, and really selling the idea that not only was there a well-established world with norms, customs, and history associated with it, but that learning about this stuff would be necessary for navigating the storyline. Once the amount of “historical/travelogue content” began to slow, and once I had exhausted most of my companions’ dialogue, my opinion of the game began rapidly declining, as it had to hang its hat on its comparatively uninteresting quests and combat instead. It seemed like there was a lot of filler content and battles.

The character dialogues, while they lasted, were for the most part memorable and interesting. However, most of my party members spent half the game sitting at the campfire, with no further dialogue or quests associated with them, beyond “their” one quest – this was pretty disappointing. The voice acting was generally good, though – I only started clicking through the voiceover about halfway through the game, which for me is quite a lot!

My interest picked up a bit when I started the last third of the game (the Landsmeet), but the realization that it was mostly a bunch of FedEx quests to get through the final gate to the endgame was a pretty big disappointment. The endgame itself was also sort of unfocused, and unlike the Ostagar segment, didn’t do a great job of selling the cataclysmic battle that was supposed to be taking place. The fact that the final battle ended with my character unconscious and Alistair engaging in cheese tactics to slay the final enemy didn’t help either…

One thing I had blocked from my memory until now was the excruciatingly painful install sequence. I played the game on the PC, and wanted to link my new EA/Bioware account to a specific old Bioware account that I had already used. The process for doing this involved several rounds of deleting my account, and trying to recreate/relink it as I wished. This process took up two hours of my life that would have been better spent on other things.

Overall, I wasn’t disappointed with the game — I certainly had some fun with it, and got my money’s worth out of it — but at the same time, I feel that there were a lot of things that could have been better about it. I suppose I’ll have to wait and see about the sequel, which is supposed to be coming next year.