6
\$\begingroup\$

I've made an Android game that uses no/custom game engine. It renders using OpenGL ES 2.0 and optionally uses some extensions for optimization or extra effects. Over the time I have dealt with various issues in OpenGL drivers, I had to implement workarounds or disable usage of some features on some devices. I am still getting reports from users that something does not render correctly on their device, but in most cases I have no way to debug it as it is happening on some strange device that I don't have. I am using AWS device farm for testing and all the devices there render the game correctly...

So I have come with an idea to implement some kind of self-test. It would run shortly after the first start and render off-screen some samples that test the shaders and features I use. The images would be compared to how they are supposed to look like. (I know the comparison must have some tolerance.) If it detects a mismatch, it could send me screenshots and detailed information about the OpenGL environment. Possibly it could even self-heal by disabling some features and trying again.

Was something like that already done in a (mobile) game?

Are there any caveats I should be aware of?

\$\endgroup\$
0
+50
\$\begingroup\$

So I have come with an idea to implement some kind of self-test. It would run shortly after the first start and render off-screen some samples that test the shaders and features I use. The images would be compared to how they are supposed to look like.

On it's own, this is a reasonable technique to verify the correctness of a rendering operation. It is vulnerable to false failures though, particularly if you implement a precise pixel-by-pixel equality test. But there are ways to make it effective, and I've seen it used on large projects as a way to do integration tests on rendering systems.

If it detects a mismatch, it could send me screenshots and detailed information about the OpenGL environment.

You will generally want to obtain permission from your users, or at least tell them that you will be collecting certain system information and reporting it back to yourself. In some cases it may be legally mandated that you disclose what you are collecting, allow a user to review it, or allow a user to opt-out of such collection.

Given that, it doesn't seem like a good use of your time to bother running this self-test on their machines. Rather you should just implement the bits that collect their system information and have them send you that when they have a bug or other rendering issue. Perhaps include some functionality to capture the current framebuffer to see the rendering issue, et cetera.

You're going to do it anyway and this way you will not be quite as inundated with reports (the bandwidth and storage of which may cost you money) of too many issues.

Possibly it could even self-heal by disabling some features and trying again.

This is potentially tricky, but a reasonable idea if done at a fairly granular level. This is often done under the umbrella of "scalability" features, although one doesn't need to actually render anything to do it. Generally detecting device capability bits and flags, or running some basic throughput tests, are all that is needed. It can be difficult to determine what you need to "turn off" based on trying to render some scene and coming up with an arbitrarily mangled output scene, for example.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the answer, I would still love to hear whether any existing game already did this, or if not, why not. The privacy concern may be an issue, but it is not so different from collecting crash logs. I am afraid a "report rendering bug" button would be ignored by majority of my users. \$\endgroup\$ – michalsrb Feb 23 '18 at 10:05
  • \$\begingroup\$ Yes, games have done this. I don't know of any mobile games specifically, but I've worked on non-mobile ones that did. I don't really see why that aspect of the platform would make a huge difference though. \$\endgroup\$ – Josh Feb 23 '18 at 16:39
  • \$\begingroup\$ No difference in the implementation. I just asked specifically for mobile because that is my case and my guess would be that game on mobile, especially on Android devices may need it the most because of the variety of devices and bad quality drivers that don't get updated unless user updates whole system. \$\endgroup\$ – michalsrb Feb 23 '18 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.