Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Games made with certain versions of Unity won't start under certain timezones #944

Closed
joaofcvale opened this issue Aug 30, 2018 · 22 comments

Comments

@joaofcvale
Copy link

Some games have an issue that is only present for certain timezones (in my particular case, America/Sao_Paulo). Those games don't run on Steamplay for me, even though others report completely stable performance; and I was able to run them with wine using a workaround I don't know how to replicate on Proton. When running with wine, I have to set the TZ environment variable with the wine command, otherwise the game crashes at start (without even showing the splash screens or opening videos). For example: WINEPREFIX="/home/user/.wine" TZ=America/New_York wine "/home/user/.wine/drive_c/Program Files (x86)/Steam/steamapps/common/Dungeon of the Endless/DungeonoftheEndless.exe"

The problem occurs with games by different publishers: Offworld Trading Company and Dungeon of the Endless are two that work with just this tweak, while other games from Amplitude Studio's Endless series (Endless Legend, Endless Space, Endless Space 2) also require this fix but have other problems that I couldn't fix (they start but then crash, or crash when starting a game). I was able to debug this problem to run the games under wine by looking into the game logs, inside the game folders, and identifying the message "NotSupportedException: Can't get timezone name.", which I then researched online and found this workaround. At the time I didn't save any of those results, but some were from Brazilian pages and others were found specifically for one of the games I was trying to run. Those games were all made with the Unity engine and I believe they use mono. Isolated reports I found over the internet suggest that the problem seems related to a bug in some versions of Unity, or some versions of mono. The issue was also reported in #292 for yet another Unity game. In the community-made Steam Play Compatibility Reports, I saw at least one entry indicating that someone else had this problem, for the game Endless Space Collection (I wasn't able to reproduce his workaround with steam play, though):

For some people game only works with launcher options: "TZ= %command%" (space between = and %command%), that is, unset the timezone variable.

The fix works when I set TZ= (empty string), TZ=America/New_York, TZ=America/Brazil (not a real timezone) and many other timezones like America/Bahia, America/Santarem, America/Halifax, Europe/Paris and America/Fake, Fake/Fake, Asia/Sao_Paulo, America/North_Dakota/New_Salem, Antarctica/Troll, Asia/Yangon, America/Rio_Branco. But using TZ=America/Sao_Paulo didn't work, and neither did America/Santiago, America/Campo_Grande, Asia/Tehran, America/Cuiaba - all real, canonical timezones. All the timezones that failed had DST rules; from those that worked, none of those in Brazil (Santarem, Bahia and Rio_Branco) had, but others had, some were not real timezones, and an empty variable worked.

Note that 1) America/Sao_Paulo is my real timezone, as recognized by Kubuntu 18.04; I have tried tzselect, timedatectl, and ls -l /etc/localtime to check this as well as the GUI options. 2) The TZ environment variable is empty or not set for my system; using echo $TZ on a fresh terminal session returns a blank line. 3) Checking the Windows registry for the wine prefix, under HKLM/Software/Microsoft/Windows/CurrentVersion/Time Zones, there is the timezone E. South America Standard Time, that contains the entry America/Sao_Paulo - so it seems the timezone is installed. But in HKLM/System/CurrentControlSet/Control/TimeZoneInformation it is empty; in system.reg (the actual file under linux, in the prefix folder), I have "StandardName"="" and "TimeZoneKeyName"="".

I never had any problems with those games on Windows (running on the exact same computer), even though I live in the same timezone. In a previous install of Ubuntu 17.10, I also did not have this problem and the games worked under wine without the workaround; I can't remember what my timezone was set as, and obviously did not know to check the TZ variable or the registry.

I don't know if this is within the scope of wine/proton bugfixing, but thought I would report it anyway. I tried to be as comprehensive as possible with the results of my tests, I hope this isn't too much information. I could provide the logs from the games I tested (though after so many tests the logs have some 17k lines with the same message over and over) or my system information if relevant.

@ricardoalcantara
Copy link

ricardoalcantara commented Aug 30, 2018

I had the same problem to run Battlerite, I did what you recommended and I run steam like that
TZ=America/New_York steam
in the command line and it just worked.

@saboya
Copy link

saboya commented Aug 30, 2018

This is probably due to outdated Timezone registry in Wine. DST rules probably changed for the problematic timezones, and since Wine tries to match based on those as well, it fails. Exporting the timezone registry entries from a up-to-date Windows installation and importing them in Wine might fix the issue.

This started to happen to me a few months ago when Hearthstone stopped working all of a sudden, and I never figured out why, until yesterday, and then I found this bug report.

@saboya
Copy link

saboya commented Aug 30, 2018

So yeah, it's exactly what I had guesses. Brazil DST time rule changed earlier this year, according to IANA's archive: http://mm.icann.org/pipermail/tz-announce/2018-January/000048.html

Brazil's DST will now start on November's first Sunday.

In Windows, this is stored in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Time Zones, and in wine this is populated by the file https://github.com/wine-mirror/wine/blob/master/loader/wine.inf.in

In that file, E. South America Standard Time still has the old value, which is basically the third Sunday of October, but now it should be the first Sunday of November.

The following patch should fix the issue:

From 1cd0eb47162d793a8b2b66a15c773e532e8d46e8 Mon Sep 17 00:00:00 2001
From: Rodrigo Saboya <[email protected]>
Date: Thu, 30 Aug 2018 09:24:23 -0300
Subject: Fixing Brazil's EST DST start date.

---
 loader/wine.inf.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 4f241c0447..f10284bedc 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2806,7 +2806,7 @@ HKLM,%CurrentVersionNT%\Time Zones\E. Australia Standard Time,"TZI",1,a8,fd,ff,f
 HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"Display",,"America/Sao_Paulo"
 HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"Dlt",,"E. South America Daylight Time"
 HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"Std",,"E. South America Standard Time"
-HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"TZI",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,03,00,00,00,00,00,00,00,00,00
+HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"TZI",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00
 HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time\Dynamic DST,"2015",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,df,07,02,00,00,00,16,00,00,00,00,00,00,00,00,00,df,07,0a,00,00,00,12,00,00,00,00,00,00,00,00,00
 HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time\Dynamic DST,"2023",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,e7,07,02,00,00,00,1a,00,00,00,00,00,00,00,00,00,e7,07,0a,00,00,00,0f,00,00,00,00,00,00,00,00,00
 HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time\Dynamic DST,"2026",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,ea,07,02,00,00,00,16,00,00,00,00,00,00,00,00,00,ea,07,0a,00,00,00,12,00,00,00,00,00,00,00,00,00
-- 
2.16.4

Or applying this to the registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Time Zones\E. South America Standard Time]
"Display"="America/Sao_Paulo"
"Dlt"="E. South America Daylight Time"
"Std"="E. South America Standard Time"
"TZI"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,00,00,00,\
  00,00,00,00,00,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00

It's likely that there are other timezones that need adjustment, but I don't have the time to do this. I hope this is of some help.

@aeikum
Copy link
Collaborator

aeikum commented Aug 30, 2018

@saboya Did you test that this change actually fixes the issue?

@saboya
Copy link

saboya commented Aug 30, 2018

@aeikum Yes, it does fix the issue.

@joaofcvale
Copy link
Author

I tested the fix (manually altering the registry inside a normal wineprefix) and it works. It works omitting TZ=, works with TZ=America/Sao_Paulo, but crashes with TZ=America/Cuiaba (expected as it was not changed for this timezone).

@saboya
Copy link

saboya commented Sep 12, 2018

America/Sao_Paulo fix is merged upstream:

https://source.winehq.org/git/wine.git/commit/b29cdbd5f23548d9631e5c98ec923b6d2d16a3f8

@lieff
Copy link

lieff commented Sep 12, 2018

Shadows: Awakening also Unity game. And it needs better winetricks mf installer or better implementation support in wine #1102

@aeikum
Copy link
Collaborator

aeikum commented Sep 26, 2018

The timezone update will be in the next Proton 3.7 release. Thanks, @saboya !

@aeikum aeikum added this to the Next Release milestone Sep 26, 2018
@aeikum
Copy link
Collaborator

aeikum commented Dec 11, 2018

This has been fixed for a long time.

@aeikum aeikum closed this as completed Dec 11, 2018
@Saroumane
Copy link

This is probably due to outdated Timezone registry in Wine. DST rules probably changed for the problematic timezones, and since Wine tries to match based on those as well, it fails. Exporting the timezone registry entries from a up-to-date Windows installation and importing them in Wine might fix the issue.

This started to happen to me a few months ago when Hearthstone stopped working all of a sudden, and I never figured out why, until yesterday, and then I found this bug report.

Hello saboya, I would like to know how you launch Hearthstone with Steamplay. In fact I think a lot of people would be interested !!

@saboya
Copy link

saboya commented Mar 27, 2019

@Saroumane I don't actually run Hearthstone with Steamplay, sorry. It was just the way I happened to stumble upon the problem described in this issue, that wasn't Proton-specific and was caused by Wine.

@vakulenchuk
Copy link

The timezone log spam is back.

It seems Brazil DST rules have changed again: http://mm.icann.org/pipermail/tz-announce/2019-July/000056.html

I don't know what exactly has to change in this case, but it should be a simple fix.

@kisak-valve
Copy link
Member

Hello @vakulenchuk, please open a new issue report.

@Uramekus
Copy link

the new bug is the same as the old one, I've filed a bug under https://bugs.winehq.org/show_bug.cgi?id=47564, so please avoid duplicates.

@JaegerCaiser
Copy link

I changed timezone of machine to UTC, worked fine. In fact I trying a long time make this works.

The timezone Americas/Sao_Paulo don't works. Using WineHQ 4.13 (Staging)

@aeikum
Copy link
Collaborator

aeikum commented Aug 9, 2019

This has been fixed upstream (again) and will be in the next Proton build https://source.winehq.org/git/wine.git/commit/2859c22cc6c10a7f3aa5e853b0151284b96be235

@Patola
Copy link

Patola commented Aug 14, 2019

Confirmed, this bug shows up with Zenith, appid 438420, using launch options "TZ= %command%" solves the issue by zeroing the timezone variable.

@aeikum
Copy link
Collaborator

aeikum commented Aug 27, 2019

The upstream commit in Wine has been applied to Proton 4.11-3. Please retest.

@kisak-valve kisak-valve added the Need Retest Request to retest an issue with vanilla Proton label Aug 27, 2019
@FurtadoPires
Copy link

The upstream commit in Wine has been applied to Proton 4.11-3. Please retest.

Having problems with 4.11-3
Game: Gauntlet
Machine info
Time Zone America/Sao_paulo

@kisak-valve
Copy link
Member

Hello @FurtadoPires, your new Proton log no longer has a hint that the crash is timezone related. It would be a good idea to add a link to the log in #312 (comment) so it doesn't get lost.

@aeikum aeikum removed this from the Next Release milestone Sep 18, 2019
@kisak-valve
Copy link
Member

Closing as fixed.

@kisak-valve kisak-valve removed the Need Retest Request to retest an issue with vanilla Proton label Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests