With David taking a quick getaway vacation, and Micah off recovering from not doing anything in academia recently, Daniel and I are quietly holding the fort. By quietly, I mean “stirring up trouble.”
As you may have read, we sent out several builds of Clockwork Empires to various parties recently. Six such parties, in fact. Of these six parties, three of them were able to play the game, and three of them were not. This is what happens when you take code that runs very nicely on your office machine (Windows 7, a Lot Of RAM, a fairly recent video card of Good Quality and Character by NVIDIA, with a Fan Attached To It) and try to run it on somebody else’s machine (Windows XP laptop, 1 gig of RAM, and the video card driver is actually just Bonzai Buddy.)
This is why, instead of being able to play the game, about half of our six testers got either black screens or just… broken stuff. One machine couldn’t play the game at all; it failed to recognize that it was a Windows application. (This is a new one on me, but it turns out certain builds of Windows XP cannot correctly run applications compiled with large-address aware mode on. Now I know.) The other two machines ended up displaying with black screens, or black screens and the UI elements only. Hooray!
The secret shame of the game industry is that everybody has to go through this, on every project, for various video cards. This is The Cost of Doing Business. It used to be worse back in the day when you had several players (3Dfx, Matrox, ATI, NVIDIA, Intel, SiS, S3, and PowerVR), but now we are basically down to three manufacturers of video card hardware.
The common culprit here is that all of these machines use an integrated graphics card, the Intel HD3000 and Intel HD4000 respectively. Supporting integrated graphics cards is the bane of every rendering programmer’s existence. On paper, these cards support all the features we need to render CE; in practice… not so much. Fortunately, we have an Intel HD4000 in the office, in the form of the laptops that we took to PAX 2012 last year. Unfortunately, we actually need to support this card, as it’s the single most popular card on the Steam Hardware Survey (and also ships standard on a lot of OS X machines, including most Macbook Pros)
The black screen of death was caused by not creating a framebuffer target in the right format. CE created a 32-bit floating point framebuffer for shadow maps using the GL_LUMINANCE32F floating point target. Intel doesn’t support this, but does support the GL_R32F floating point target, which is the same thing except instead of “Luminance” you have “Red.” To figure this out, I played “GL Error Russian Roulette”, where you sprinkle your entire code base with calls to the glGetError() function until you actually figure out which line of code is causing the problem.
Once that was fixed, everything shows up on screen… except for, uh, the terrain. Despite claiming that OpenGL supported the GL_EXT_TEXTURE_ARRAY texturing extension, the GLSL compiler refused to acknowledge its existence. Solution? Don’t use the extension, and instead change the GLSL version from 1.30 to 1.50 so that it could be used without the extension being set. (A tip of the hat goes to Simon Roth, who pointed out that it worked for him.)
There was also an exciting moment when I had to install new video card drivers on the laptop, a process which I couldn’t do because the newest Intel drivers were not signed by Hewlett-Packard. Hewlett-Packard last signed drivers in, uh, 2012. Instead, I needed to unzip the drivers, attempt to manually install them, deal with the fact that Windows 7 insisted that the drivers from 2012 were newer than the drivers from 2013, completely uninstall the drivers from 2012, and then re-manually-install the new drivers.
Anyhow, to make a long story short: the game now runs on an Intel HD4000. As an added bonus, this also fixed most of the problems that we were seeing on the MacBooks in the office (even though I don’t have an official Mac beta out the door yet.) It doesn’t run quickly on this laptop – I get about 10 FPS at 1330×768 (the strange, alien default resolution of this machine), with shadows turned to low and all the bells and whistles turned off. I am reasonably sure this can be made faster, and I am hoping to get it up to 20 FPS on the company laptop. The main culprit here seems to be the terrain texturing, which can be very slow due to having to render up to 16 layers of textures on top of each other in a worst-case scenario (4 biomes touching); turning off the smooth blending helps matters, but not a lot. An additional culprit here is that we perform triplanar texturing, which takes three samples per texel and blends them in order to determine the correct orientation of the texture to use, instead of just one. I will be looking into ways of eliminating this in the near future.
Suffice it to say, though, this isn’t fun, and it prevents me from working on other more important things, like shooting people and getting Joseph’s new “meat cleaver” model integrated into the game. *sigh*
I will be going through the Enormous Pile of Video Cards to try to work out what the minimum spec is for the game before we ship it. In general, if you have a discrete video card that supports DirectX 10 or above, you should be okay. That includes most NVIDIA and AMD cards made in the past 5 years, or since 2008. You may have to turn things off if you don’t have the fill rate or resolution necessary to support all the bangs and whistles, though. I am committed to supporting the Intel HD4000 because some large portion of the Steam user base (4%) actually uses the darned thing, and because it is standard in most MacBook Pros these days. I’m not sure about the Intel HD3000 yet; it may simply be too slow.
For those of you wondering what the minimum spec and recommended specs are for the game: if you have an NVIDIA card which is from about 2009 or later, you should be able to play the game. Ditto if you have an AMD card from the same period. If you have an Intel HD4000 or one of the newer ones (HD5000, Iris, etc.) you should also be okay.
Other notable bugs from our pre-alpha testers include a number of complaints about the configuration screen, the game thinking it crashes on exit on some machines (which is one of those unpleasant “hmm, it looks like didn’t actually clean up a resource somewhere” bugs), people’s heads popping off in the work crews menu, that sort of thing.
Oh, game development! You’re so wacky, I love it! Happy Thanksgiving!