protonscr

Shattered Union

protonopen appid 3960Game compatibility - Unofficial
ValveSoftware/Proton#3008 · opened 2019-08-24 by ryao · updated 2019-09-18 · 3 comments · github · game page · search this game
Rryao 2019-08-24 github

Compatibility Report

  • Name of the game with compatibility issues: Shattered Union
  • Steam AppID of the game: 3960

System Information

I confirm:

  • [x] that I haven't found an existing compatibility report for this game.
  • [x] that I have checked whether there are updates for my system available.

steam-3960.log

Symptoms

Systems that report more than 2066MB of texture memory trigger a bug in the game that causes it to crash. This happens on Windows. If you use Intel integrated graphics, you are fine. If you boot with your system set to 2048MB of RAM, you are fine. The PC Gaming Wiki says to use a "Blurry Texture Fix" designed for Railroad Tycoon 3 that has the side effect of making IDirect3DDevice8::GetAvailableTextureMem() return 512MB. This fixes things on Windows and presumably, also on Linux.

https://pcgamingwiki.com/wiki/Shattered_Union#Issues_fixed
http://hawkdawg.com/txt/rt3/RT3-texture_fix_README.txt
https://steamcommunity.com/app/3960/discussions/0/530645961937729857/

Rather than downloading their binary, I added a compatibility profile for the game to the registry via protontricks -c 'wine cmd /C reg add "HKEY_CURRENT_USER\Software\Wine\AppDefaults\ShatteredUnion.exe\Direct3D" /v "VideoMemorySize" /t REG_SZ /d "2066"' 3960, which made it work. I determined the 2066 value was the upper limit after doing a binary search.

Reproduction

  1. Install Steam.
  2. Set Steamplay to apply to all games.
  3. Install Shattered Union.
  4. Start Shattered Union.
  5. Observe black screen and alt tab to find an additional dialog:

image

Proposed solution

We should modify Wine to implement a MaxVideoMemorySize that we can then set to 2066 in HKEY_CURRENT_USER\Software\Wine\AppDefaults\ShatteredUnion.exe\Direct3D. The current workaround works on systems that are broken by the bug in the original software. However, reporting more texture memory than is actually available on systems with less texture memory seems like a way of introducing a regression. A MaxVideoMemorySize quirk to enforce the minimum of the current texture memory and the MaxVideoMemorySize setting would be ideal.

Alternatively, we could just force it to 512MB (which is known to work for this game) and hope that nothing ever goes wrong should hardware with less texture memory be used with this game. Given that drivers should fallback on system memory for overcommit, that could be fine.

@aeikum What would you like to do here?

Aaeikum 2019-09-12 github

@ryao I haven't had a chance to test this, but apparently it's already been solved upstream. See https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/wined3d/directx.c#l650

To test this, set your prefix's Windows version to winxp. You can do this in Proton by using the PROTON_DUMP_DEBUG_COMMANDS option to dump the debug scripts, then run winecfg with /tmp/proton_$USER/run winecfg.

Aaeikum 2019-09-12 github

If it does help, we can set that as an app default for this game.

Rryao 2019-09-18 github

@aeikum That worked. :)

Launch options