Author Topic: Unfortunate totally-game-breaking bug on multi-monitor Linux  (Read 2960 times)

Offline NullNix

  • Newbie
  • *
  • Posts: 3
Unfortunate totally-game-breaking bug on multi-monitor Linux
« on: September 05, 2014, 11:55:34 am »
So I just bought AI War (8.000 I think, I haven't updated -- I can't update, see below). I'm using a Radeon HD6850 with the open source radeon driver, with two monitors attached.

AIWar really doesn't appear to support this case well. When I start it, it renders in a random one of the two monitors, filling that monitor only, but renders its images as if it were filling both monitors, so half of the screen is cut off and inivisible (including some of the things you have to click on to run the in-game updater, I think, though I've never seen that half of the screen so I can't be sure). Worse yet, the mouse pointer position computation is offset by the same amount, so the mouse doesn't click on the thing that's underneath it -- it clicks on the thing that is twice its X coordinate to the right.

Worse yet, even though AI War isn't multi-monitor-aware, it is multi-monitor aware enough to use XRandR to see what monitors exist, but it *ignores* whether those monitors are turned on or off! So it always tries to render at twice the acceptable resolution and turning a monitor off with e.g. "xrandr --output DVI-0 --off" doesn't work -- hell, half the time AIWar decides to render into the monitor that's turned off, so I can't even quit it! I suspect I'd have to *physically unplug* a monitor cable to get the bloody thing to render into one screen properly. Modifying the resolution settings in ~/.config/unity3d/Arcen Games, LLC/AI War/prefs does nothing: the game just changes them back on next start.

Needless to say this makes the game entirely unplayable, heck it's not even evaluatable. I'd hope a fix, or workaround, would be fairly easy? (Obviously I'm not going to go around unplugging my monitors just to play a game, however good, since everything else on the desktop would detect this and all hell would break loose as my virtual desktops rearranged themselves.)

This is the first Linux game I've ever seen that fails this badly with more than one monitor: all the others I've been able to cajole into functioning by xrandr-disabling one monitor, but AI War's combination of recognising multiple monitors even if they are disabled and refusing to believe they exist is catastrophic. Congratulations, I guess, this class of bug is unique in my experience :)

Offline NullNix

  • Newbie
  • *
  • Posts: 3
Re: Unfortunate totally-game-breaking bug on multi-monitor Linux
« Reply #1 on: September 05, 2014, 12:01:57 pm »
Urgh. A horrible horrible workaround is to chmod the prefs file so it's not writable by the user, and force it to windowed mode in there. It's then playable, though the windowed part is unfortunate. I haven't found a way to make it behave in fullscreen yet -- but at least I have now done an update, and can verify that these behaviours persist in the latest version.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Unfortunate totally-game-breaking bug on multi-monitor Linux
« Reply #2 on: September 05, 2014, 12:21:15 pm »
Hi there,

The unity preferences are not something the game pays a whole lot of attention to.  Instead, if you look in the game folder there is a settings.dat file that the game uses instead.  The multi-monitor thing is unfortunately down to the Unity 3D engine and not something we can do much about.  But if simply changing your resolution solves it, then great -- if not, then running in windowed mode should do so.

In the settings.dat file (which is just a text file that you can create if it is not there) in your RuntimeData folder inside the game folder, here are the relevant lines:

IsFullscreen:0

WindowWidth:1800
WindowHeight:720

FullscreenWidth:1920
FullscreenHeight:1080

That first should be either 0 or 1, to tell if it it should be fullscreen or not.

The second two are for the resolution when you are in windowed mode -- that's just the window size, so it can literally be any odd thing and it will work fine.  The last two are the resolution that the game uses when in fullscreen, which is probably what you need to change if you are wanting to use fullscreen mode and the game keeps overriding the defaults.  This is what it's overriding it with.

You can change all of these things through the in-game settings interface as well, if you can see the game well enough to do it there.  But if the graphics are all stretched and mangled, then certainly just doing it through the settings.dat file itself is far easier.

Hope that helps!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline NullNix

  • Newbie
  • *
  • Posts: 3
Re: Unfortunate totally-game-breaking bug on multi-monitor Linux
« Reply #3 on: September 05, 2014, 06:05:35 pm »
Thanks, that seems to work! The game looks overwhelming at first sight, but it looks like most of the complexity is introduced slowly, so it might not be too terrifying. Already blown away by a game that does what is sensible for you so you don't have to grind at micromanagement all the time. Why the heck has nobody done this before? (Well, nobody outside SimAnt, which overdid it so the game won itself even if you walked away from the keyboard for a few hours!)

(Now to figure out how to usefully 'hold all these keys at once' on a keyboard with three-key rollover. Maybe I need a different keyboard for this game. :) )

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Unfortunate totally-game-breaking bug on multi-monitor Linux
« Reply #4 on: September 05, 2014, 07:12:41 pm »
Haha.  Glad that worked, and hope you have a grand time!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!