Possible fix for DPI scaling issues (text overflow, black UI)

Discussion in 'Command Ops Series' started by Shadrach, Sep 21, 2016.

  1. Shadrach

    Shadrach Member

    Joined:
    Jan 8, 2015
    Messages:
    24
    Likes Received:
    2
    I really wanted to get back into playing CmdOps after being annoyed at the lack of support for DPI scaling, as it causes strange issues and makes some fonts large while the rest of the UI is so small it's hard to read and tiring for old eyes. I run in 1440p and stuff like the bottom menus are way too small for me, and I can imagine how impossible they would be to read in 4K unless you have a *massive* monitor (30+ inches).

    So, I did some research and found what amounts to a hack/workaround. This lets Windows scale *all* the UI according to DPI settings, to avoid bigger fonts overflowing the dialog boxes and having to change resolution to play the game.

    The solution was found here:
    http://winaero.com/blog/how-to-fix-apps-that-look-small-on-high-dpi-and-high-resolution-displays/

    Basically, this uses either an external manifest file (requires a change in Windows registry) or using an app called Resource Hacker (http://www.angusj.com/resourcehacker/) to change the internal manifest of CmdOps.exe.

    I decided to go with using the Reshacker way, since I did not want to change the registry, as it would influence all applications. The drawback is that whenever CmdOps is updated I will have to redo the fix - not a big deal for me, for you it might be different.

    To go a bit into details: The problem in CmdOps.exe is that the default manifest-setting for DPI scaling (dpiAware) is "true" - this tells Windows that the app supports other DPI settings than 100%, resulting in scaling of fonts while the rest of the UI does not scale (as it has hard-coded sizes).

    Basically, the developers can use this solution as well, to just force Windows to NOT attempt proper DPI scaling, but instead just scale the entire UI to the desired DPI.
    <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">False</dpiAware>

    Below is an example of how it looks on my 2560x1440 monitor. Obviously the UI will be a bit blurry and not as sharp as it would be in 100% DPI. But it works for my use and makes the game perfectly playable.

    [​IMG]

    A side-effect to doing this is that the startup options no longer allow changing of resolution, not really sure why (?), but this should be a minor issue for most.

    NOTES

    Note1: This requires a bit of knowledge of file management, and possibly registry editing, so unless you are comfortable doing stuff like that then better to avoid it ;)

    Note2: Reshacker makes a backup CmdOps_original.exe file on save, if you don't use "Save As...", so if somehow things are borked (game won't start) you can use the backup. Always make a copy of the exe in any case just to be sure ;)

    Note3: The Manifest for CmdOps.exe is not where expected from the guide (24 > 1)but located at Manifest > 1. Changing this resource still works like intended.

    Note4: It might or might not require a restart of Windows, not sure as I restarted a lot during testing it.. probably a restart is in order if the registry is changed.

    Note5: This is on Windows 10 Pro, so not sure if scaling works as well in 7/8/8.1 and so on.
     

Share This Page