Portability and the Demo Effect
Easy enough... it's just C++
Asteroid Arena is fully made in C++ (even the build scripts!), a language that is portable to all kinds of operating systems and hardware. We're using OpenGL that is a Graphics Library supported by most operating systems, it's portable. The game is (currently) only made for Windows and we only communicate with the Windows kernel (parts we use are portable all the way to Windows XP!).
So… Asteroid Arena should work on all Windows computers right? It is after all only using portable technologies.
There's no such thing as perfect demo machine
We were going to a demo session to show Asteroid Arena to whoever happened to join. As such, we had to get a computer there. Easy enough, buy a laptop and install the thing! But what computer? We could get the latest and greatest gaming laptop, or a mid-range, but still new-ish, laptop that potential end-users might have. Of course we ended up with the second, a laptop with Windows 11 - integrated graphics.
"Integrated graphics? You mad?" you might ask. Games usually require a lot of horse power.
Asteroid Arena is tested on Surface Pro 2, which is well below the minimum specs, to guarantee that the game works well on low-end machines. So performance is not a worry. Surface Pro 2 also has integrated graphics, so this should "just work".
It's not working
It's midnight before the demo session, we've setup the computer and we start copying the game over. We launch it and… a black screen.
Panic level 1 - Did I forget to copy something?
"If I call in sick and don't sleep, we still got 20 hours to fix this!" Troubleshooting mode starts. Game audio and input is working, so it's purely graphics related. What's the first fix attempt? Update drivers.
After going through Intel driver software installers that installs installers we managed to get an updated driver for the graphics, but alas, still a black screen.
Panic level 2 - Err… what's going on?
"If it's not you, is it me?" If you're a programmer, most issues you face are with your code, not their's. So, install a graphics debugger (RenderDoc was my choice) and see what errors it spits out. Launch the game, observe black screen, launch the debugger, observe… no errors.
Panic level 3 - I can still cancel the event!
At this point, maybe giving up is an option? Re-check everything before that! Step one, is the graphics driver the latest (even though you already updated)? Is the debugger still showing no errors (even though you already checked)? Well, seems the graphics driver claims there is a newer version! CLICK UPDATE NOW Also… maybe there's an error at the very start of the game, so check that. And there are! A huge amount!
There's the little bug
The error that the new computer claims is in one of the shaders, it's using a variable name ending with double underscore called vs_out__ - "double underscore is reserved for future OpenGL use". This is the root cause of the black screen. Easy enough to fix, just remove one underscore, check that it works (which it did), shut down computer and go to sleep (at 2 p.m.). Why this computer would consider it an error and not the other 5 we have is a different question, I still slept well.
Panic level 0 - gg ez win.
I had a nice sleep, went to my day job and was looking forward to the demo session in the evening.
The Demo Effect
After some issues finding the place (had to ask the local shop keeper for directions like a tourist - although I've lived in the city for over 10 years), we arrived fashionably five minutes late. We plugged in the computer and controllers, and started the game just to waste some time before the actual event would begin. We got greeted with an error popup: Could not find 'wglGetProcAddress'.
Panic level 99 - Despair.
How is it possible the game that was running in less than 24 hours ago has failed to launch when nobody has touched the computer? And why 'wglGetProcAddress'? It's been available since Windows 2000! What has changed? What is wrong?!!?11?
Panic level 999, event starts in 10 minutes - Naaah, we can still fix this…
'wglGetProcAddress' suggests a severe issue with the computer, check the driver version. The driver update software is very sluggish, and the entire computer is feeling a bit "off". Is the computer on safe mode? Are there driver updates since yesterday? What does other software claim my OpenGL version is?
Panic level 9 999, event starts in 5 minutes - Maybe I can call a friend to borrow a laptop?
During the previous night I installed a tool that shows what OpenGL features your computer support. It said OpenGL 4.5 last night. This time I checked it again, it said OpenGL 1.1. How can this be!? The driver is up-to-date, the game was working yesterday.
Panic level 99 999, event starts - Err, the next table has two laptops, maybe I can borrow one?
Alright, I know I fixed the original issue. The computer was working, my code was not working. I fixed it, what changed? The computer rebooted! Remember the "CLICK UPDATE NOW" part above? Yea, that was a mistake. After the computer rebooted it installed the latest drivers and that caused havoc. Uninstall Intel graphics drivers!
The game runs!
Panic level 0, two minutes after event started - Everything works.People join, the game runs, and nobody knows about the pre-panic (well you do, but don't tell the others).
The event in question (April meeting of IGDA 2022 in Helsinki) was very successful, people enjoyed the game and we got some good feedback, but most importantly - even more importantly than having a non-crashing game, I didn't lose a single battle!
- Jens the Undefeated Merciless Programmer, April 2022