[1.0.6][Linux] Resolution problems

Discussion in 'Bugs' started by Pedro, Oct 19, 2011.

  1. Pedro

    Pedro Member

    I just bought the game on Desura. The game seems to run fine, except for a problem: the list of resolutions offered by the launcher is all wrong (see attached picture)

    There are two separate problems:
    1) The game seems to have picked up on the fact that my desktop size is 3200x1200. As you can probably guess, that's in fact two 1600x1200 monitors side by side. The problem is that I can't choose any size that fits in a single monitor (the smallest resolution offered is 2240x1200)
    2) In windowed mode the game does not take into account the space taken by the window titlebar, panels, etc. So either the top or bottom of the game window will always end up out of view

    So, obvious question, is there any way to set the resolution via the command line, config files or the like?

    For fixing the bugs, I'd suggest the following:
    - Regardless of the detected resolution, always include a bunch of standard resolutions in the list.
    - If possible, detect the presence of multi-monitor setups and suggest resolutions based on the size of a single monitor instead of (or in addition to) all of them
    - In windowed mode, if it's not possible to make the window resizable (I assume the game engine isn't prepared to handle changing size on the fly), then at least discover the actual window client size available to the game and use that.
     

    Attached Files:

  2. Marak

    Marak Member

    Your 2) is also a problem with the Windoze version. I end up with bits of the bottom UI lopped off, and every time I play, I have to minimize the game and then restore it, otherwise my Taskbar covers up even more of the Window.
     
  3. KameZero

    KameZero Member

    1) You probably don't have the proper resolution in your xorg.conf file.

    You'll want something like this in your xorg.conf:

    Code:
    Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL;  1280x1024,NULL;"
    2) Indeed, a problem with a great many SDL games, I recommend removing the borders if you have a WM that supports it (Openbox, etc) or you could use one of the various programs that do it for WM's that don't (devilspie).
     
    Pedro likes this.
  4. Pedro

    Pedro Member

    Wow, nice catch.

    The metamodes line in xorg.conf (auto-generated by the nvidia control panel, btw) defined resolutions all the way down to 800x600, but wrongly: it always set the left display to 1600x1200 and the right display to whatever the resolution was. That actually explains the strange resolutions the game was offering me.

    I also didn't know about the trick of writing "NULL" to disable one of the displays, thanks for that.

    So, for reference, this was the line before (wrong):
    Code:
    Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-1: nvidia-auto-select +1600+0; DFP-0: nvidia-auto-select +0+0, DFP-1: 1152x864 +1600+0; DFP-0: nvidia-auto-select +0+0, DFP-1: 1024x768 +1600+0; DFP-0: nvidia-auto-select +0+0, DFP-1: 800x600 +1600+0; DFP-0: nvidia-auto-select +0+0, DFP-1: 640x480 +1600+0"
    and after (right):
    Code:
    Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-1: nvidia-auto-select +1600+0; DFP-0: 1152x864 +0+0, DFP-1: 1152x864 +1152+0; DFP-0: 1024x768 +0+0, DFP-1: 1024x768 +1024+0; DFP-0: 800x600 +0+0, DFP-1: 800x600 +800+0; DFP-0: 640x480 +0+0, DFP-1: 640x480 +640+0"
    I took the opurtunity to remove the 640x480 resolution and add the more useful 1400x1050, and also added the full set of single monitor resolutions, so the final result looks like this:
    Code:
    Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-1: nvidia-auto-select +1600+0; DFP-0: 1400x1050 +0+0, DFP-1: 1400x1050 +1400+0; DFP-0: 1152x864 +0+0, DFP-1: 1152x864 +1152+0; DFP-0: 1024x768 +0+0, DFP-1: 1024x768 +1024+0; DFP-0: 800x600 +0+0, DFP-1: 800x600 +800+0; DFP-0: NULL, DFP-1: nvidia-auto-select +0+0; DFP-0: NULL, DFP-1: 1400x1050 +0+0; DFP-0: NULL, DFP-1: 1152x864 +0+0; DFP-0: NULL, DFP-1: 1024x768 +0+0; DFP-0: NULL, DFP-1: 800x600 +0+0"
    Reader beware: I'm not sure if all the extra cruft in the line is standard syntax or nvidia specific (well the "nvidia-auto-select" bit isn't standard for sure...) I think the "DFP-0" and "DFP-1" references might look different on other people's xorg.conf too.
     
  5. Pedro

    Pedro Member

    By the way, I think the devs still should still implement the first fix I suggested ("Regardless of the detected resolution, always include a bunch of standard resolutions in the list.") for 2 reasons:
    - it serves as a fallback for situations like these where the detected hardware resolutions are bad (which may be frequent, remember in my case the improper config was generated by the NVidia software itself)
    - when playing windowed, the supported hw resolutions aren't very relevant anyway
     
  6. catpants

    catpants Member

    For a more hardware-independent workaround, we can generate a custom modeline for the desired resolution. Let's say we're using a 1280x800 display and want to run DoD in a 1200x800 window.

    First, we create the modeline:
    Code:
    $> cvt 1200 800
    # 1200x800 59.86 Hz (CVT) hsync: 49.74 kHz; pclk: 78.00 MHz
    Modeline "1200x800_60.00"  78.00  1200 1264 1384 1568  800 803 813 831 -hsync +vsync
    We paste the output of that command into the "Monitor" section of xorg.conf:
    Code:
    Section "Monitor"
            Identifier  "Monitor0"
            VendorName  "Monitor Vendor"
            ModelName    "Monitor Model"
            Modeline "1200x800_60.00"  78.00  1200 1264 1384 1568  800 803 813 831 -hsync +vsync
    EndSection
    and restart X11.

    Alternatively, we can add the new modeline via xrandr to avoid having to restart X11, but it won't be saved:
    Code:
    $> xrandr
    Screen 0: minimum 320 x 200, current 1280 x 800, maximum 4096 x 4096
    LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
      1280x800      60.0*+
      1024x768      60.0
      800x600        60.3    56.2
      640x480        59.9
    VGA1 disconnected (normal left inverted right x axis y axis)
    DVI1 disconnected (normal left inverted right x axis y axis)
    TV1 disconnected (normal left inverted right x axis y axis)
    
    Here we see that the screen we're using is named LVDS1, along with a list of existing modes. We create the mode we want:
    Code:
    $> xrandr --newmode "1200x800_60.00"  78.00  1200 1264 1384 1568  800 803 813 831 -hsync +vsync
    And then add it to our screen:
    Code:
    $> xrandr --addmode LVDS1 1200x800_60.00
     
    $> xrandr
    Screen 0: minimum 320 x 200, current 1280 x 800, maximum 4096 x 4096
    LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
      1280x800      60.0*+
      1024x768      60.0
      800x600        60.3    56.2
      640x480        59.9
      1200x800_60.00  59.9
    VGA1 disconnected (normal left inverted right x axis y axis)
    DVI1 disconnected (normal left inverted right x axis y axis)
    TV1 disconnected (normal left inverted right x axis y axis)
    
    Either of these methods should result in 1200x800 being a selectable resolution from the DoD launcher:
    [​IMG]
     
  7. jrssystemsnet

    jrssystemsnet Member

  8. Soraph

    Soraph Member

    Hello everyone,
    I try to run dreadmor under linux but I cna't get a new resolution showing up with the methods mentioned above, when the fix to this bug will be applied?

    My resolution is 3840x1080 and I just can't play the game with 2 monitors.