beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.73k stars 289 forks source link

[Linux] Crashes to desktop on Wayland desktop environment #942

Open TRPB opened 2 years ago

TRPB commented 2 years ago

857 is marked as solved, but the problem is not fixed.

While switching to an Xorg based desktop environment is a workaround it's certainly not 'solved' as the game is unplayable on any Wayland based desktop environment (Sway, Wayfire, dwl, etc).

aldrenean commented 2 years ago

Chiming in here -- I'm on Sway and I have no problems running BAR. I assume you have XWayland installed?

TRPB commented 2 years ago

Yeah, I have XWayland installed. I'm using Wayfire, I'll try Sway but it seems to be a Wayland issue.

The game crashes to desktop at the loading screen. I've tried a couple of approaches to force it to use xwayland env -u WAYLAND_DISPLAY ./Beyond-All-Reason-1.1459.0.AppImage and GDK_BACKEND=x11 ./Beyond-All-Reason-1.1459.0.AppImage though I'm not sure BAR uses GTK.

The console shows

[t=00:00:56.709923][f=-000001] Loading widget from mod:   RClick Quick Build (mex/geo)  <cmd_rclick_quick_build_resource_extractor.lua> ...
[t=00:00:56.710092][f=-000001] Loading widget from mod:   Attack AoE          <gui_attack_aoe.lua> ...
[t=00:00:56.719564][f=-000001] Loading widget from mod:   BAR Hotkeys         <cmd_bar_hotkeys.lua> ...
[t=00:00:56.733014][f=-000001] Loading widget from mod:   BuildBar            <gui_buildbar.lua> ...
[t=00:00:56.740359][f=-000001] Loading widget from mod:   Context Build       <cmd_context_build.lua> ...
[t=00:00:56.740716][f=-000001] Loading widget from mod:   Ecostats            <gui_ecostats.lua> ...
[t=00:00:56.741285][f=-000001] Loading widget from mod:   Info                <gui_info.lua> ...
[t=00:00:56.815241][f=-000001] Loading widget from mod:   Order menu          <gui_ordermenu.lua> ...
[t=00:00:56.815737][f=-000001] Loading widget from mod:   Prospector          <gui_prospector.lua> ...
[t=00:00:56.816354][f=-000001] Loading widget from mod:   Unit Groups         <gui_unitgroups.lua> ...
[t=00:00:56.820926][f=-000001] Loading widget from mod:   Commands FX         <gui_commands_fx.lua> ...
[t=00:00:56.821298][f=-000001] Loading widget from mod:   Game info           <gui_gameinfo.lua> ...
[t=00:00:56.822817][f=-000001] Loading widget from mod:   Geothermalspots     <gui_geothermalspots.lua> ...
[t=00:00:56.830687][f=-000001] Loading widget from mod:   Idle Builders       <gui_idle_builders.lua> ...
[t=00:00:56.831222][f=-000001] Loading widget from mod:   Mapmarks FX         <gui_mapmarks_fx.lua> ...
[t=00:00:56.831594][f=-000001] Loading widget from mod:   Metalspots          <gui_metalspots.lua> ...
[t=00:00:56.844657][f=-000001] Loading widget from mod:   Mouse FX            <gui_mouse_fx.lua> ...
[t=00:00:56.845147][f=-000001] Loading widget from mod:   AllyCursors         <gui_ally_cursors.lua> ...
[t=00:00:56.845480][f=-000001] Loading widget from mod:   Anti Ranges         <gui_anti_ranges.lua> ...
[t=00:00:56.845757][f=-000001] Loading widget from mod:   CommandInsert       <cmd_commandinsert.lua> ...
[t=00:00:56.846012][f=-000001] Loading widget from mod:   Grabinput           <grabinput.lua> ...
[t=00:00:56.846289][f=-000001] Loading widget from mod:   Highlight Unit GL4  <gui_highlight_unit_gl4.lua> ...
[t=00:00:56.846565][f=-000001] Loading widget from mod:   Notifications       <snd_notifications.lua> ...
[t=00:00:56.846963][f=-000001] Loading widget from mod:   Rank Icons GL4      <gui_rank_icons_gl4.lua> ...
[t=00:00:56.847734][f=-000001] Adding, 16, images to atlas from, LuaUI/Images/ranks
[t=00:00:56.886629][f=-000001] Loading widget from mod:   Select n Center!    <gui_center_n_select.lua> ...
[t=00:00:56.886975][f=-000001] Loading widget from mod:   Set fighters on Fly mode  <unit_set_fighters_fly.lua> ...
[t=00:00:56.887279][f=-000001] Loading widget from mod:   Waypoint Dragger    <unit_waypoint_dragger_2.lua> ...
[t=00:00:56.887465][f=-000001] Loading widget from mod:   Replay buttons      <gui_replaybuttons.lua> ...
[t=00:00:56.888078][f=-000001] Loading widget from mod:   Show Builder Queue  <gfx_showbuilderqueue.lua> ...
[t=00:00:56.888448][f=-000001] Loading widget from mod:   Commander Hurt Vignette  <gui_commanderhurt.lua> ...
[t=00:00:56.888826][f=-000001] Loading widget from mod:   Mouse Buildspacing  <gui_buildspacing.lua> ...
[t=00:00:56.889001][f=-000001] Loading widget from mod:   Lups                <lups_wrapper.lua> ...
[t=00:00:56.889679][f=-000001] Warning: [ParseUniformsTable] uniform "ScreenSize" from table "uniformInt" not active in shader
[t=00:00:56.889913][f=-000001] Warning: [ParseUniformsTable] uniform "life" from table "uniform" not active in shader
[t=00:00:56.890505][f=-000001] Warning: [ParseUniformsTable] uniform "isS3o" from table "uniform" not active in shader
[t=00:00:56.920197][f=-000001] Warning: [ParseUniformsTable] uniform "life" from table "uniformFloat" not active in shader
[t=00:00:56.921030][f=-000001] Loading widget from mod:   Default Group Recall Fix  <gui_group_recall_fix.lua> ...
[t=00:00:56.921355][f=-000001] Loading widget from mod:   Contrast Adaptive Sharpen  <gfx_cas.lua> ...
[t=00:00:56.924439][f=-000001] Loading widget from mod:   CustomFormations2   <cmd_customformations2.lua> ...
[t=00:00:56.924818][f=-000001] Loading widget from mod:   Cursor              <gui_cursor.lua> ...

Leading up to the crash.

aldrenean commented 2 years ago

Hmm, what happens when you run xrandr? Do you see a screen listed as "primary"? If not try making your main display primary, I've found that some games don't know where to render without that. I run this script at startup which is configured to find my main display at 1440p (though it will often get unset, I sometimes have to restart games and run the script again).

#!/usr/bin/env bash

DSP=$(xrandr | awk '/2560x1440/ {print $1}' | head -n 1)

xrandr --output $DSP --primary
echo "Xwayland: Primary monitor set"
xTechon commented 2 years ago

I'm actually having the same issue, normally, I would prepend SDL_VIDEODRIVER=x11 to the command to run the appimage which works for a lot of other games on wayland. Now it just crashes to desktop or sometimes crashes my whole desktop when it loads the game.

I'm on a Dell XPS 13 9310 running Arch Linux and using KDE as my desktop env I'll attach the log of the error here: 20220507175515_infolog.txt

TheLazyNut commented 2 years ago

It could be related to the file descriptor limit and a leaking of xwayland as explained here: https://discord.com/channels/549281623154229250/549282926596980738/989614627421843476

I had similar issues and increasing the limit solved the problem for me.

dzosz commented 2 years ago

issue is still there. some engine builds work fine though, other crash consistently. SDL_VIDEODRIVER=x11 works for me too

Kravantokh commented 1 year ago

The game crashes on Archlinux, Wayland/Hyprland, too. None of the above environment settings helped in my case and neither did xrandr.

infolog.txt

EDIT: To be more precise, the issue occurs on Wayland/Hyprland with xwayland for me.

flindeberg commented 1 year ago

Is the game supposed to run on Wayland? I can't get the game (or rather the launcher) to launch without grabbing an X-display (as in Xwayland or similar).

Kravantokh commented 1 year ago

Well, at least in my case the problem occurs on xwayland (which I forgot to mention previously) but I'm guessing it is implicitly the same for everyone else saying wayland. (Edit: I edited my previous comment to include this detail)