📜 ⬆️ ⬇️

History: QuakeLive native Linux downloader

image

Since iD Software stopped supporting Linux and Mac and made Launcher for QuakeLive as a standalone standalone application written in C # using a cross-platform framework (!) For rendering web pages in OpenGL , a lot of time has passed. I already zatyunil my distr for a stable-maximum number of fps (I still have a weak video card), but it still slowed down. Now I will tell you what I did to play my favorite game in my free time, the game with which I started sitting at the computer at the age of 7. I will not remain indifferent to such spitting to people never. Under the cut, I’ll tell you how to improve the performance of the game on Linux and how I made my own Launcher.

1. OpenGL Optimization


Since I have a NVIDIA graphics card, everything is for NVIDIA. I must say that these settings give a noticeable increase in performance.

Add to xorg.conf, to the “Screen” section (if not, you can create it using the nvidia-settings utility:
')
Option "NoFlip" "True"
Option "NoRenderExtension" "False"
Option "NoLogo"
Option "AllowGLXWithComposite" "true"
Option "RenderAccel" "true"
Option "UseEvents" "false"
Option "TripleBuffer" "false"
Option “RegistryDwords” “OGL_MaxFramesAllowed = 0x0; EnableBrightnessControl = 1 "


Let me just say about the main settings that give a tangible - this is TripleBuffer = false and OGL_MaxFramesAllowed = 0x0. The first, as the name implies, disables triple buffering, the second sets the number of frames that need to be rendered after the entire image for the video card has been rendered (for example, 60 frames were rendered for 60 hertz monitor). The main goals of these settings are to reduce InputLag and increase performance. A lot of feedback was about this setting. I recommend reading here and, for development, here .

Also, in the game you need to completely turn off post-processing ( postprocessing ) and enable r_vertexlight = 1 .

2. Process Priorities


Since the lags were still, I started digging deeper. Someone probably would have thought that raising the priorities of processes through renice would help. Which only I did not see the attempt - lower to the minimum (20) wineserver, to the maximum priority - the game, on the contrary, all together. Believe me, this does not give a result.

3. Own Launcher.exe


Swarm even deeper. I made a simple conclusion ps ax | grep quake and saw the so-called awesomium_process.exe . I will not explain what the process is, I can only say that it will be spawned by quakelive.exe for the embedded web browser. The problem is (as I suppose) that awesomium always works with logging, in connection with which somewhere every 30 seconds there is always some kind of lag for half a second, plus with it in the game there are always less FPS than can be . At first I tried to kill him, but after a couple of seconds he would be spawned again by quakelive.exe. Then I tried to stop it ( kill-stop pid ) - then everything went like clockwork. Of course, it was always annoying to do this with my hands, although I have two monitors and the console is always open. I thought about the fact that I know quite a large number of people who play with Mac or Linux.

And here I decided to write my own Launcher, native, without Vains.

image

At once I will say that the language (Python) was chosen because I realized that I would have to mess around a lot with parsing and strings. Well, in general, it will all happen faster.

First, I analyzed how quakelive works, although not without outside help (however, it is about 5% and it is outdated (the API has changed)). My favorite Wireshark and, surprisingly, FireBug helped me in this matter. With the help of the latter, I looked at how and what the browser does (with its castrated functionality) on quakelive.com. But after all, 80% of the functionality is hidden in the stand-alone client, and this is exe! In this case, Wireshark helped.

At first, I looked at what quakelive.exe does with the help of the netstat utility, and looked at the IP that the client is accessing. Then I drove these IPs into Wireshark and with the help of packet analysis I realized that in most cases this is just quakelive.com:80, just like on the site. Well, everything is simple here - analyze everything neatly and fake it. At the moment I have faked almost everything and I know how the whole quakelive client works. But there is one interesting point - chat.

I immediately guessed that this is XMPP. I asked my Linux friends (one of them is the administrator of one irc channel for conducting pickup games), and he told me that this is indeed the case and even gave a reference to “read” how it works (someone wrote a small algorithm in your own words how to make a client for quakelive chat). In fact, this is a regular xmpp account on the domain quakelive.com. But the problem here is that both the chat and the game are related, since the notifications about where the friends are located (on which server) and other stuff (roster, invites to friends) and so on all use XMPP, and all data is encrypted, and using Wireshark you will not see them. I did it easier - I connected to the xmpp server quakelive.com through my own python client and analyzed all the data on the network that came to me. Then I tried to connect to the resource through my favorite qutIM and once again made sure that everything works as I think.

A little offtopic and continued

The purpose of my Launcher was to unlink from the client (and from the awesomium_process.exe lagging process) that was used by the gaming web browser. The problem was that it was impossible to start the game without him (and go to the server), as he had to be authenticated on the XMPP server without fail. Having raised my brain, I collected that the game itself without this process can be authenticated on the server, and with the help of the right commands and a couple of days of time I did achieve it - I ran quakelive.exe without a web browser, went to the server and played, while The maximum was stable and there was no twitching, as it was with awesomium_process.exe. These developments also entered my launcher.




Total
We have an application for all debug-based distributions, written in python and allowing you to run the game with the highest possible performance.

In addition, I had several contacts in different parts of the world, one of which is the author of the famous QLPrism, he in his free time is testing my application, like other people.

Finally, I will say that without our programmer's thinking (this is when everyone helps each other), this would be much more difficult to do, thanks to all those who have helped me in some way.

What can my client:
1. Automatic update of the game.
2. Run immediately with a call to the server (vbil link and Enter)
3. Server Browser
4. Run your own server (if you have a pro account)

Installation:
sudo add-apt-repository ppa:broken/ppa sudo apt-get update sudo apt-get install qllauncher 


UPD: Yesterday, quakelive came out on Steam, which again, once again, connects me and other people who want to play with Mac or Linux using the Steam network. I already have some ideas on how to make it possible to run quakelive on a native (Linux or Mac Steam), but this requires study. However, as the “close” people assured me, the support of the old Launcher (as an exe file) is planned for about a year, so everything is still ahead and you can use my Launcher :)

UPD2:
Small RoadMap:
1. Chat
2. Profile.
3. Friends
4. Installing QuakeLive (if not previously installed) directly from the qllauncher
5. Something very, very interesting, connected with RE and patching :)

UPD3:
I repeat, the initial goal of qllauncher was and there is an increase in productivity. It is clear that at this stage of its development, someone may not have enough functionality, as well as the fact that it is not designed for something that can not be downloaded and installed Windows QuakeLive. For this purpose, you still need to go to quakelive.com yourself , register, download the installer, and run it once. After that, you can run qllauncher.

References:
Project repository on BitBucket

Source: https://habr.com/ru/post/237441/


All Articles