History: QuakeLive native bootloader for Linux

    image

    From the moment id Software stopped supporting Linux and Mac and made Launcher for QuakeLive a stand-alone standalone application written in C # using a cross-platform framework (!) For rendering web pages in OpenGL, a lot of time has passed. I already cluttered my distr for a stable-maximum number of fps (I still have a weak video card), but it still slowed down. Now I’ll tell you what I did in order to play my favorite game in my free time, the game with which I started sitting at the computer when I was 7 years old. I will not remain indifferent to such spitting on people ever. Under the cat, I’ll talk about how to improve performance in a game on Linux and how I made my own Launcher.

    1. OpenGL optimization


    Since I have an NVIDIA graphics card, everything here is for NVIDIA. I must say that these settings give a tangible performance boost.

    Add to xorg.conf, in the “Screen” section (if not, you can create it with 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 "


    I will only say about the main settings that give a tangible one - 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 have been rendered for a 60 hertz monitor). The main goals of these settings are to reduce InputLag and increase productivity. A lot of reviews were about this setting. I recommend reading here and, for development, here .

    Also, in the game, you must completely turn off postprocessing and enable r_vertexlight = 1 .

    2. Process Priorities


    Since the lags were still there, I began to dig deeper. Someone might have thought that raising the priority of processes through renice would help. As soon as I have not seen the attempts - we reduce 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


    The swarm is even deeper. I made a simple conclusion ps ax | grep quake and saw the so-called awesomium_process.exe . I will not explain what this process is, I will only say that quakelive.exe will spawn it for the built-in web browser. The problem is (as I believe) that awesomium always works with logging, and therefore somewhere in every 30 seconds there is absolutely always some kind of lag for half a second, plus with it the game always has less FPS than it can be . At first I tried to kill him, but after a couple of seconds, quakelive.exe will spawn it again. Then I tried to stop it ( kill -stop pid) - then everything went like clockwork. Of course, this always bothered me 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 a fairly large number of people who play with Mac or Linux.

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

    image

    I must say right away that the language (Python) was chosen because I realized that I would have to deal with a lot of parsing and strings. Well and generally faster it will all happen.

    At first, I analyzed how quakelive works, although not without third-party help (however, it is about 5% and it is deprecated (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 neutered functionality) on quakelive.com. But after all, 80% of the functionality is hidden in a stand-alone client, and this is exe! In this case, Wireshark helped.

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

    I immediately guessed that it was XMPP. I asked my Linux friends (one of them is the administrator of one irc channel for pickup games), and he told me that it really was and even gave a link to “read” how it works (someone wrote a small algorithm in your own words how to make a client for quakelive chat). This is actually a regular xmpp account on the quakelive.com domain. But here is the problem - both the chat and the game are connected, since notifications about where friends are located (on which server) and other things-tricks (roster, invites to friends) and so on - everything uses XMPP, and all data is encrypted, and You won’t see them with Wireshark. I acted easier - I connected to the quakelive.com xmpp server through my own python client and analyzed all the data on the network that came to me.

    A bit of offtopic and continued

    The goal of my Launcher was to decouple the client (and the lag process awesomium_process.exe) that was used by the game web browser. The problem was that it was impossible to start the game without it (and access the server), since it had to pass authentication on the XMPP server without fail. Having wondered, I realized that the game itself can be authenticated on the server without this process, and with the help of the right commands and a couple of days of time I achieved this - I ran quakelive.exe without a web browser, went to the server and played, while fps kept steadily maximum and there was no twitching, as was the case with awesomium_process.exe. These developments are also included in my launcher.




    Summary
    We have an application for all deb-based distributions written in python that allows you to run the game with the highest possible performance.

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

    In the end, I’ll say that without our programming thinking (when everyone helps each other) it would have been much harder to do, for which I thank all those who helped me somehow.

    What can my client do:
    1. Automatic update of the game.
    2. Launch immediately with a call to the server (hammered the link and Enter)
    3. Server browser
    4. Launch your own server (if there is a pro-account)

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


    UPD: Yesterday quakelive was released on Steam, which again, once again, ties my hands to 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 the native (Linux or Mac OS Steam), but this needs to be studied. However, as "close" people assured me, support for the old Launcher (in the form of 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 it was not previously installed) directly from qllauncher
    5. Something very, very interesting, related to RE and patching :)

    UPD3:
    Once again, qllauncher's original goal was and is to increase 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 the fact that Windows screw QuakeLive may not be downloaded and installed. For this purpose, you still need to go to quakelive.com yourself , register, download the installer and launch it once in a single way. After that, you can run qllauncher.

    Links:
    Project Repository on BitBucket

    Also popular now: