The Tribulations of a Linux Game Developer (Part 2)

This is part 2 of a long rant that should I have written in smaller, more frequent updates, over the past year or so. In part 1, I described the Linux laptop that is the subject of the rant you are about to experience. It is worth a read.

I have been using the aforementioned laptop for game development because I want to see how far I can push it. It is by no means a powerhouse; it has a modest Intel Core i7 at 2.4 GHz with 6 GB RAM and an NVIDIA Quadro NVS 4200M video chip. The main CPU can be clocked faster than 2.4 GHz, but then it runs disconcertingly hot. The graphics chip is meant for business, not games. Yet, I accept the modest specs because I am making a game with the simplest graphics possible.

Seriously, these are some basic graphics.

But now, I am encountering problems with my graphics rendering that I hadn’t noticed before, because until now, I hadn’t been concerned with graphics performance.

In troubleshooting, I found that, as usual, there are a number of different ways to get graphics working on Arch Linux with an NVIDIA graphics chip. Those links only point to the graphics drivers themselves. They do not relate to the graphics standards that software/games might be built with. In Linux, the options are, essentially, OpenGL (which has been around forever) and now Vulkan (which is new, circa Feb 2016).

If you looked at the content behind the links (though you weren’t expected to), you probably saw instructions to install mesa-libgl or nvidia-libgl, depending on which driver is installed. Those libgl packages contain different implementations of the OpenGL standard. mesa-libgl is open-source; nvidia-libgl is NVIDIA’s proprietary package.

Apparently, the two packages behave differently…

(As an aside, I mentioned before that my game engine is based on OpenGL. Therefore, now that Vulkan is here, I am technically using outdated technology. That is ok for now, because that outdated technology is well-established and well-supported.  The point is: Even though I am aware of Vulkan’s existence, I will focus on OpenGL for the purpose of this rant. One day in the future, I may write a different rant about Vulkan + Linux.)

My 2D game with runs smoothly with mesa-libgl, as it should, because the graphics are rectangles and circles. For reference, it looks like this:

However, with mesa-libgl, more fully-baked games (i.e., some Steam-powered games, and especially 3D games) run like a snail sliding on a molasses.

On the flipside, when I install nvidia-libgl, Steam games, other 3D games, and for that matter, other 2D games that aren’t mine, run perfectly.  But with nvidia-libgl, my game runs like a turtle climbing a mountain.

Here is a clip of the exact same game, running with nvidia-libgl installed, instead of mesa-libgl. Nothing else has changed, and the video is not doctored in any way:

I am not exactly sure what is causing the performance discrepancy. I will investigate it, figure it out, and report back.

Problems like this highlight my computer’s status as a bad game development machine. Every now and then, I have to spend an awful lot of time troubleshooting issues that are not related to the game itself. But, because I am a badass masochist, I wouldn’t have it any other way.

Mass KonFuzion out.

 

P.S. I hope this blog is detailed  enough for experts, but accessible to beginners. Basically, if my wife can follow along, I’ve done a good job. But if you think I’ve done a bad job, let me know in the comments.

4 thoughts on “The Tribulations of a Linux Game Developer (Part 2)”

  1. Are you not concerned that your learn everything approach will slow down your ability to progress? Technology advancements have always come from standing on the shoulders of giants. Very impressive either way, Mr. Konfuzion!

  2. Frédéric! Yes, I am definitely concerned that the learn-everything approach slows down my progress in other areas. But at the same time, I feel like the best way to stand on the shoulders of giants is to climb up there from the ground. That way, when it’s time to ditch one giant for the next, I’ll know exactly why and how to do it.

    But thanks for reading and thanks for the shout! I also secretly spy on your posts, even though I don’t always comment. We’re long overdue to catch up and kick it like a center forward.

Leave a Reply

Your email address will not be published. Required fields are marked *