cantfind Posted October 6, 2022 Report Share Posted October 6, 2022 I run my computer on a 4k display for browsing and working, but my integrated gpu is too weak to properly run 0 A.D. in 4k. I've seen that there's a way to start the game with a custom resolution by passing the command line arguments -xres and -res, e.g. -xres=1920 -yres=1080 to run at 1920x1080. But when I run 0ad with these arguments it seems to ignore them... Is that not possible anymore, or am I doing it wrong? I'm using the snap version and my command is: env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/0ad_0ad.desktop /snap/bin/0ad -xres=1920 -yres=1080 %F I've also tried editing these arguments into the 0ad_0ad.desktop file, with no results. The game still works at 4k resolution. Any ideas? Quote Link to comment Share on other sites More sharing options...
hyperion Posted October 6, 2022 Report Share Posted October 6, 2022 xres/yres are for windowed mode, in fullscreen mode 0ad renders at display resolution. You could change display mode or scale using X, see "man xrandr". Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted October 6, 2022 Report Share Posted October 6, 2022 25 minutes ago, hyperion said: xres/yres are for windowed mode, in fullscreen mode 0ad renders at display resolution. Not sure that it's true when borderless.fullscreen is false. Though not sure, if it's true it can be improved in A27. Quote Link to comment Share on other sites More sharing options...
cantfind Posted October 7, 2022 Author Report Share Posted October 7, 2022 changing the display resolution requires me to also change the scaling factor, which means I have to restart X, which is inconvenient. I'd greatly appreciate it if it were possible to run the game at fullscreen in a different resolution, without having to change the resolution of my whole system every time I want to play. Quote Link to comment Share on other sites More sharing options...
Stan` Posted October 7, 2022 Report Share Posted October 7, 2022 55 minutes ago, cantfind said: changing the display resolution requires me to also change the scaling factor, which means I have to restart X, which is inconvenient. I'd greatly appreciate it if it were possible to run the game at fullscreen in a different resolution, without having to change the resolution of my whole system every time I want to play. Can you try to set bordeless.fullscreen=false in the config option? EDIT: sorry not true, false. Quote Link to comment Share on other sites More sharing options...
hyperion Posted October 7, 2022 Report Share Posted October 7, 2022 42 minutes ago, cantfind said: changing the display resolution requires me to also change the scaling factor, which means I have to restart X, which is inconvenient. No need to restart X if you have the randr extension which you are almost guaranteed to have, just write a small script that sets mode, runs 0ad, resets mode. Then use that script to launch 0ad instead. Apart from some flickering when launching or closing 0ad there won't be any side effect. 14 hours ago, vladislavbelov said: Not sure that it's true when borderless.fullscreen is false. Though not sure, if it's true it can be improved in A27. Might also depend on wm/dm and sdl version, so not all that sure either that this is always true. 1 Quote Link to comment Share on other sites More sharing options...
cantfind Posted October 9, 2022 Author Report Share Posted October 9, 2022 (edited) Just created the xrandr script, and it works great! thanks! It's not the most user friendly experience, and I wonder what a Windows user would have done, though... Maybe consider adding a resolution picker to the advanced settings menu? Edit: This seems to be an unreliable fix... sometimes it works, but sometimes it does weird things: * the display lost signal - had to restart * only a quarter of the display showed the 0ad screen, while the rest was black, mouse coordinates corresponded to the upper left qourter, but screen was on the lower left quarter - alt-tab twice resulted in a flickering upper left quarter and a non flickering lower left. On all instances there was no sound (using hdmi, so the monitor is the speakers). Edited October 9, 2022 by cantfind Quote Link to comment Share on other sites More sharing options...
Stan` Posted October 9, 2022 Report Share Posted October 9, 2022 18 minutes ago, cantfind said: Just created the xrandr script, and it works great! thanks! It's not the most user friendly experience, and I wonder what a Windows user would have done, though... Maybe consider adding a resolution picker to the advanced settings menu? Problem is the way the window is made hence why I suggested the bordeless.fullscreen=false in the config. If it's true the sdl doesn't let you set resolution Quote Link to comment Share on other sites More sharing options...
cantfind Posted October 9, 2022 Author Report Share Posted October 9, 2022 Hmmm... adding the line boderless.fullscreen="false" doesn't seem to have any effect... Quote Link to comment Share on other sites More sharing options...
cantfind Posted October 9, 2022 Author Report Share Posted October 9, 2022 I don't know why, but sometimes xrandr fails to change the resolution, sometimes xrandr stops the computer from outputing any signal, and every single time xrandr prevents sound from working... So the workaround with xrandr is not working all that well... I've filed bugs with xrandr. What's wrong with using SDL_SetWindowDisplayMode for changing the fullscreen resolution? Quote Link to comment Share on other sites More sharing options...
seeh Posted October 10, 2022 Report Share Posted October 10, 2022 (edited) if you use/want use for some reason in Linux autoKey ( https://github.com/autokey/autokey ) you could us also something not in FullScreen (works for me): window.activate('0 A.D.') window.resize_move('0 A.D.', xOrigin=1908, yOrigin=-27, width=1922, height=1089, matchClass=False) Edited October 10, 2022 by seeh Quote Link to comment Share on other sites More sharing options...
hyperion Posted October 11, 2022 Report Share Posted October 11, 2022 On 09/10/2022 at 11:35 PM, cantfind said: Edit: This seems to be an unreliable fix... sometimes it works, but sometimes it does weird things: Works for me (tm). If it only works sometimes maybe some sleep before launching 0ad might work. For sound maybe you use sound card by index in your config instead of identifier and some reordering happens? Borderless fullscreen doesn't matter here either. Quote Link to comment Share on other sites More sharing options...
cantfind Posted October 12, 2022 Author Report Share Posted October 12, 2022 I've tried adding sleep... It still doesn't work about half of the time... If I run it as a single line from the terminal, when I lose signal, I can rerun the command (arrow up and enter), and the signal comes back. The error I get when the command fails is X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) Serial number of failed request: 31 Current serial number in output stream: 31 As for the sound, I locked the profile in pavucontrol, but it still doesn't work - it says my HDMI is unplugged when in 1080, only when I return to 4k it sees it as plugged. Interestingly, after recovering from losing the signal by running the same command a second time, I do get sound - but if it doesn't lose signal on the first time, running the command again doesn't restore the sound. Something is very buggy - either in the intel drivers, my HDMI firmware, or xrandr. Quote Link to comment Share on other sites More sharing options...
hyperion Posted October 13, 2022 Report Share Posted October 13, 2022 12 hours ago, cantfind said: Something is very buggy - either in the intel drivers, my HDMI firmware, or xrandr. Agreed, might also be the kernel (KMS). Maybe try a newer or older one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.