Graphics card drivers: a lesson in software engineering

1
Official Construct Post
Ashley's avatar
Ashley
  • 23 Jan, 2012
  • 1,024 words
  • ~4-7 mins
  • 2,310 visits
  • 0 favourites

Construct 2 uses a hardware-accelerated Layout View while editing your project. This helps guarantee a snappy, responsive UI even when editing very large projects. However, this has also exposed us to one of the most awful areas of software engineering I have ever seen: graphics card driver bugs. Graphics card drivers are wrong on every level, right the way from "Do they work?" (often not) to "Can I get a fixed one?" (either no, or with difficulty). Why is this such a tough area?

In software engineering, there's a really good, sensible rule: slow and correct is better than fast and broken. In other words, a really fast program which doesn't work is obviously not as good as a slow program which works. Construct Classic, the predecessor to Construct 2, was a victim of over-optimization: it was incredibly fast, but also had some really awkward bugs that were difficult to fix because of the really cool, clever optimizations we did. A few games didn't work because of these bugs. We certainly learnt our lesson: it would be better if our engine was a little slower and all the games worked. This is the approach we took for Construct 2: it's still designed to be as fast as possible - it's just reliability is the top priority and will take precedent over performance if need be. It's no coincidence Construct 2 is far, far more stable than Classic.

If you didn't know, the driver is a bit of software which talks to your graphics card. It's a key point for both performance and reliability of graphics in general on your computer.

For years graphics card makers like ATI and nVidia have lived in a cut-throat world of competing over performance. If one graphics card scores 5% on a performance benchmark than another of the same cost, chances are everyone marches off and buys the faster one. I guess the engineers behind the drivers know the rule that slow and reliable is better than fast and broken. However, with extreme pressure over long periods of time, I suppose management or marketing got their way: cut that reliability check there to save a bit of performance... remove that null check... assume this combination of calls never happens... bingo, another few percent on the benchmark.

Here is a list of some real issues we've had reported by our users. They have all been fixed by the user updating their graphics card driver:

  • Crashes every time on startup
  • Objects appear as empty rectangles
  • Crash closing down
  • Glitches and other deformed graphics

These have occurred across all major graphics card vendors. Nobody does well here. We even used to have a hardware-accelerated image editor, but there were such serious reliability issues we reverted to a software-rendered one instead. As you can see, these issues range all the way from minor issues to making Construct 2 totally useless. Again, slow and working is better than fast and broken! Still, pretty much every time we just get the user to update their driver and everything is sorted: it works fine, and the editor is really fast as well.

It's not always that straightforward though. Sometimes old hardware is no longer supported with new drivers. So they have ditched you with broken drivers and no solution. If this happens to you, don't buy from them again.

Then, sometimes the graphics card maker updates their drivers, but nobody is allowed to install them. It really is that insane. I've seen lots of cases where for example nVidia release a new driver with lots of bug fixes, but they are not allowed to install it on any ACME laptops. Instead, if you have an ACME laptop, you have to go to ACME to get the new driver from nVidia. However, ACME may be lazy, or not care at all about the problem, and not update the drivers on their site. So despite nVidia fixing the problem, ACME users are stuck with broken drivers. This happens a lot too. If this happens to you, don't buy from that manufacturer again; you should buy from a manufacturer who cares about supporting their products.

If you're lucky enough to have a manufacturer who does have a modicum of concern about drivers, you may still be sent through the most twisted, contorted upgrade processes you've ever seen. Once I ended up browsing an FTP directory of files named setup00010.exe through setup53065.exe. Thanks to Google, I actually managed to find the one that matched my hardware and software configuration. It would be nice if they had tried to be a little more helpful though.

With WebGL appearing on the web now, the poor engineering of "fast and broken" in graphics card drivers has actually become quite a serious problem, exacerbated by vendor apathy. Some kinds of crashes can take down the entire system on Windows XP (although Vista and 7 can recover from this type of problem). However, thanks to diligent work by browser makers, only stable drivers are supported for WebGL. This means malicious websites can't exploit buggy drivers - but on the other hand, if you have buggy drivers, you get no WebGL support. It's not the end of the world though, since for Construct 2 games you'll just fall back to the slower 2D canvas. However, it's somewhat embarrassing for the graphics card maker if in such a huge effort to make their graphics card as fast as possible the browser maker blocks their driver and then the user gets poorer performance. Oops! It turned out that fast and broken is actually slow and broken, and slow but works is actually faster and works!

It should never have ended up like this, but it's time things changed. Graphics card makers should make reliability a priority. If you are a customer looking for a new computer or graphics card, ask about or research the reliability. Nobody sells graphics cards based on reliability yet, but it's an incredibly important point, so seek out the most reliable models and vote with your wallet.

And, of course, if you're having trouble with Construct 2, please try updating your driver :)

Subscribe

Get emailed when there are new posts!