Saturday 5 September 2009

The 14 Hour Bug

So, we had a demo for the 2005 JagFest, everything was looking cool wasn't it?

Well no, not really, there was a bug, everything ran OK when I tested it for short periods of time. So I thought, I know, I'll let the code roam over the wilderness for a while (essentially moving the viewpoint throughout the possible viewing possitions the game would allow) and check how stable the code was. So in went code to move the viewing location around and bounce around all over the landscape.

Everything looked fine. Then it was left running overnight.

The next morning - everything was locked up. I tried it again, including a Vertical BLank (VBL) counter to determine how many times the screen had been refreshed, to see when it happened (essentially a 50 or 60Hz counter. Unfortunately it happened again, and again, and again (you get the idea) but never at the same point in time, even when the path (and therefore views) was strictly controlled, the crash seemed random, at SOME point in the first 14hours. It couldn't be a few seconds to make testing easy - oh no - so unfortunately with each experiment taking a day, progress became slow.

In fact this was such a difficult problem that friends were even suggesting I include an autosave feature in the game, so that if it locked up players could reboot and start again from the autosave, thereby not losing too much progress.

mmmmm, professional
(but I do appreciate the attempt at comfort)

How was it fixed? Well in the next post I'll tell how some bad luck turned into good.

Cheers,
Atari Owl

No comments:

Post a Comment