Game Design, Programming and running a one-man games business…

First real players, first real bugs

So…. GTB is out there being played by real actual people, rather than just me and my cats, and of course, the first few bug reports come in.

It seems hard for many gamers to believe that developers do their best to reduce bugs, because the minute you play a beta build, you encounter crazy stuff that makes you think “how the HELL did they let this one go?”. I thought I’d give an example of the worst bug found so far, and what caused it, and why I didn’t spot it.

Alt-Tab hangs the game.

On the surface of it, that seems mad, and annoying. Surely cliff tested it? Yes… he did, massively so, and it worked fine. So when I got multiple bug reports, after I KNEW it worked, I did some digging. Did alt-tab work for me? yes. In release build? yes. In release-build run outside Visual Studio? Yes? In different maps? Yes? Nighttime? yes. units selected at point of alt-tab? paused? mid-explosion? shockwave being rendered? nightvision on? paths drawn? yes,yes,yes,yes… after a cold reboot? YES.

Testing all that takes longer than it sounds… So then I do what you *have to do* when you encounter stuff like this. You pretend to be playing innocently, and go through an entire mission, playing and ignoring the potential bug, winning an entire battle. Then you play a second battle, and alt-tab. HANG

Which makes you think that it is something to do with multiple battles. Cue lots of digging through code. Cue turning on the directx debug run-time and maximised error reporting, and running the game in debug. Also cue bouts of near-sobbing when I manage to play 2 battles and it NOT happen… Eventually I manage to reproduce the hang in the debugger. (This is a big win). The you get that infuriating directx error that basically says “Srry, can’t restore DX, you forget to release some directx resource. We know which one, but we are leaving it to you to guess..” or words to that effect.

I bet this guy wrote that one:

Anyway, to cut a loooong (6+ hours) story short, eventually, a whole lot of experimenting shows that the problem occurs only if the post-mortem dialog, or one of it’s many offshoots get launched. This does some multi-threading, which led me up a right blind alley. Anyway… eventually it becomes clear that displaying the unlock-choices dialog causes it…sometimes…

Then a sudden brainwave. The unlock choices *sometimes* gives you a new Hull, and to do that it needs to render that hull. As an optimisation, it doesn’t draw it in layers, it renders out a composite texture (multi-layered) as a sprite, and uses that (it will get re-used later in various dialogs…). That means some render-target code gets triggered. A bit of digging shows that when I create a render target to save out a new composite hull texture, I wasn’t calling Release() on it correctly, in two places. Arrghhh! bug fixed. (AFAIK).

So why didn’t I find it before I shipped? Well basically I implemented the unlock dialog after I’d already tested the hell out of alt-tab. By the time I was close to shipping, and double-checking alt-tab, I either tested it in the first battle (no probs) or I had already unlocked anything and didn’t see that dialog, or I got lucky and the dialog only offered modules or ready-rendered hulls.

But it’s swings and roundabouts. This bug was hell, but pretty much every issues everyone is experiencing on the unit design screen to do with saving and deleting turns out to be a single line where I used = instead of ==.

Don’t you just love C++?


10 thoughts on First real players, first real bugs

  1. Wow. Bug fixing is hell.

    Seriously though, don’t berate yourself too badly, the beta is still more stable and less buggy than a fair few released games (I’m looking at you, Bethesda and Obsidian), and anyone playing the first release of a beta on the first few days should know what they’re getting into.

    Plus, between the bug reports, people (myself included) seem to be liking it a lot. It’s torn me away from Mass Effect 3, which is saying something.

  2. So far I have gathered 5 A4 sized pages of bug reports or fix suggestions or plain out suggestions and I have barely gotten into the game.

    Good to hear the alt+tab bug got fixed but it may not be all because I noticed that you can blackscreen the game even when you are on the main menu and just alt+tab for very long time.

    For me it seemed the alt+tabbing was more duration based than occuring because of specific settings.

  3. When comparing a literal in C, I’ve started putting the literal at the front of the comparison. Then, when you (inevitably) forget the second =, the compiler tries to assign to a const, which throws an error. BAM.

  4. Updates will be available from inside the game? :)

    Because I don’t find the whole BMTMicro download system very helpful or trustworthy…

  5. @Pete

    Thanks for the tip!

    I feel like a moron, I have been a programmer for over 15 years and it never ocured to me to do that. The only thing I can say in my defense is most of my work is done in SQL and CF so I don’t have to use == often.

  6. It’s a really dumb thing, frankly, gcc and VS can be set to throwing a warning whenever it detects an assignment in a comparison. But using your Rvalue’s on the LHS of comparisons is also something great to do when writing code on the whiteboard for job interviews. It always sparks some discussion about being conscious about what you’re writing, demonstrating that you are aware that you are human and have also developed means to improve your output despite that…

  7. That sucks. I hate it when an error is some stupid mistake that I made. Thanks for all your hard work Cliff. It makes it possible for all of us to enjoy your game. xD

    @thomas Yes. Already implemented it seems. (unless he changes it, although as far as I can tell, its working perfectly)

Comments are currently closed.