Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some questions regarding q2pro on linux #228

Open
fishxz opened this issue Feb 22, 2022 · 7 comments
Open

some questions regarding q2pro on linux #228

fishxz opened this issue Feb 22, 2022 · 7 comments

Comments

@fishxz
Copy link

fishxz commented Feb 22, 2022

hey,
im currently maintaining https://github.com/flathub/com.github.skullernet.q2pro and i would like to ask, if you would like to participate.
flatpak is a easy way to provide binaries for linux, which q2pro is currently missing.

there are some issues im currently running in:

  1. wayland doesnt work. the game starts, but there is no window (game is running in the background), just the icon in the taskbar.

    /var/home/danielschenkenberger/.var/app/com.github.skullernet.q2pro/data/baseq2/pak0.pak
    ------- FS_Init -------
    Current search path:
    /var/data/baseq2/pak2.pak (2 files)
    /var/data/baseq2/pak1.pak (279 files)
    /var/data/baseq2/pak0.pak (3307 files)
    /var/data/baseq2
    /app/bin/baseq2
    3588 files in PAK files
        -----------------------
    Execing default.cfg
    Execing config.cfg
    ------- S_Init -------
    Could not open /dev/dsp: No such file or directory
    Using SDL audio driver: pulseaudio
    sound sampling rate: 22050
    ----------------------
    ------- R_Init -------
    Detected OpenGL 4.6 (compatibility profile)
    Loaded extension GL_ARB_fragment_program
    Loaded extension GL_EXT_compiled_vertex_array
    Using GLSL rendering backend.
    ----------------------
    cl_maxfps value `60' is inexact, using `62' instead.
    (Set `cl_warn_on_fps_rounding' to `0' to disable this warning.)
    SDL mouse initialized.
    ====== Q2PRO initialized ======
    
    q2pro r666, Feb  9 2022
    https://github.com/skullernet/q2pro
    
  2. im not sure how to deal with paths.

    CONFIG_PATH_DATA=/app/bin
    CONFIG_PATH_LIB=/app/bin
    CONFIG_PATH_HOME=/var/data
    

    this only allows to load game libraries from /app/bin (which shouldnt be modified by user), but the game should look for both "PATH_LIB" and "PATH_HOME" (so user can install there own game libaries).
    the reason is why i use "/app/bin" for the lib path, is because this way im able to ship the default "gamex86_64.so" and "q2pro.menu" with the pakage.

  3. q2pro on linux could use a better icon, than the current low res one.
    currently im using this one: https://github.com/flathub/com.github.skullernet.q2pro/blob/master/q2pro.svg

@darkshade9
Copy link

Hey @fishxz we're setting a specific directory only for CONFIG_PATH_DATA and CONFIG_PATH_HOME so that q2pro knows where to look for game assets, see this build config for an example:
https://github.com/actionquake/distrib/blob/main/build/linux/config_linux64

@skullernet
Copy link
Owner

  1. There is native Wayland video driver now that may work slightly better than SDL (at least it should display something).
  2. I've added code that tries to load game*.so from homedir first and then falls back to libdir.
  3. How is that icon file licensed? Who made it?

@fishxz
Copy link
Author

fishxz commented Aug 25, 2022

  1. There is native Wayland video driver now that may work slightly better than SDL (at least it should display something).

wayland works now, but typing in console is very slow and sometimes keypresses get registered multiple times.
windows decortation doesnt work on gnome, should be fixable by adding https://gitlab.gnome.org/jadahl/libdecor

  1. I've added code that tries to load game*.so from homedir first and then falls back to libdir.

very useful change... works as intended.

  1. How is that icon file licensed? Who made it?

i took the icon from the yamagi q2 project and changed the color to match q2pro.

More details here:
flathub/flathub#1658

@fishxz
Copy link
Author

fishxz commented Aug 28, 2022

after testing wayland a bit, the following things i noticed:

  1. console is super slow as long no game is loaded or while connecting to a server, which also slows down downloads... typing in console while connecting brings it back to normal speed. (ingame the console works as intended)
  2. s_auto_focus 1 doesnt mute the game while minimized, but 2 works (also a problem on x11).
  3. assuming you want sound in background, the game is rly rly slow while minized/unfocused, which means the sound stutters, which makes background sound useless.
  4. on x11 the game now respect the keyboard layout of your language, which is not good.

@skullernet
Copy link
Owner

windows decortation doesnt work on gnome

This is expected, as Gnome doesn't implement XDG decoration protocol.

console is super slow as long no game is loaded or while connecting to a server

Odd, this didn't happen during my testing on Debian 11 with Sway and in Fedora 36 VM with Gnome.

s_auto_focus 1 doesnt mute the game while minimized, but 2 works (also a problem on x11).

Both native X11 and Wayland backends don't detect window minimization currently. It doesn't seem to be possible on Wayland at all, but might be possible on X11, but I couldn't find straightforward way to do it. Does this even work with SDL on X11? Grepping for SDL_WINDOW_MINIMIZED state in SDL X11 video driver sources returns nothing.

the game is rly rly slow while minized/unfocused

This didn't happen for me. Might be something to do with how vsync works on Wayland.

on x11 the game now respect the keyboard layout of your language, which is not good.

Works for me fine, but I assume there may be issues with how X server maps keycodes to keysyms. Might be possible to switch to raw evdev keycodes on Linux.

@fishxz
Copy link
Author

fishxz commented Aug 30, 2022

Odd, this didn't happen during my testing on Debian 11 with Sway and in Fedora 36 VM with Gnome.

on my 60hz screen the typing is fine, but there core problem still exist... if you connect to a server it kinda slows down and if server set "sv_force_reconnect" you kinda in a loop until you type in console, same for downloads...

This didn't happen for me. Might be something to do with how vsync works on Wayland.

not sure about that... it doesnt stutter anymore because of slowness, but it plays the last sound before minimize in a loop.

my main screen is 144hz btw.

@skullernet
Copy link
Owner

I've added a hack to allow SDL video driver to work with Wayland. Let me know if it behaves better than native Wayland driver, so that it can be prioritized by default.

As for native Wayland driver issues, does disabling gl_swapinterval change anything?

s_auto_focus 1 doesnt mute the game while minimized

Should work on X11 now, but not on Wayland.

on x11 the game now respect the keyboard layout of your language, which is not good.

Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants