ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
23.91k stars 1.04k forks source link

Sims 3 (47890) #2502

Open Ruedii opened 5 years ago

Ruedii commented 5 years ago

Compatibility Report

System Information

I confirm:

Symptoms

Launcher won't launch (Game Launcher Requires .Net on Wine. Uses modules not currently found in WineMono) Game will launch bypassing launcher, but download and online functionality does not work as it calls the launcher.

Reproduction

Download game Attempt to launch

Related Issues

Proton Needs Wine-Mono Support #18

Ruedii commented 3 years ago

Update! Really positive! I can now get the launcher working for all but the welcome screen by simply disabling jscript.dll in winecfg!

Big step forward, narrows down the problem library. I remember reading something from Apsyr about them having to replace the welcome page on Mac because of bad Javascript. This could be the same issue.

Ruedii commented 3 years ago

Seems it didn't quit properly but that bug doesn't affect functionality. (A lot of games leave straggling processes in Proton right now.)

Still it is nice that it is down to jscript.dll (and possibly a few ActiveX dlls that would be called next in the sequence.)

Before, when the crash was on Microsoft C Runtime calls there was no workaround other than skipping the launcher.

Ruedii commented 3 years ago

Update: It seems Store download functionality depends on JScript.dll Defeats the whole purpose of keeping the launcher. I will experiment further soon to see if an alternative tweak can get it working without breaking store download functionality and login functionality.

The fault is clearly on JScript as called from ieframe. So the bug is most likely on JScript if someone wants to investigate how JScript is executing in that ieframe.

However, JScript is also used elsewhere

However, the lead that JScript.dll is the problem component is VERY useful in addressing the issue. It is likely an XML but or JavaScript bug causing the issue. I will try ieframe.dll next since that is further up the chain of failure, but might not also be used elsewhere. I will need to do a lot of black box testing to do to find the right dll to retain store download functionality. This can also verify that the Javascript in that IE Frame is the issue.

Still, this is a big step forward. Clean handling by MSVC is very useful for these bugs.

So here is my thinking and approach I am working from at the moment.

My current suspicion (Not certainty.) The JavaScript on the welcome page is bad, but works in Windows.

To find workaround: Find a dll called exclusively by the welcome panel that detects the fault, but doesn't prevent login and download functionality.

To fix the issue: Research the exact JScript functions triggering the fault. Either add a quirk filter or adjustments to JScript.dll behavior to address the problem.

Additional fix needed to mitigate issues: Change the manner in which JScript faults on bad JavaScript code to be non-fatal in this use case. A malfunction is better than a Crash to Desktop.

Ruedii commented 3 years ago

Status report on continued attempts to get download functionality working: Disabling ieframe instead of jscript fails to start launcher. Trying mshtml instead. Will get back with status.

Ruedii commented 3 years ago

No Good.

Launcher loads, login works in game but not in launcher. Launcher crashes on game's call to download store item.

Will fetch log later.

Ruedii commented 3 years ago

I just thought of something important. The panel and script in question worked on the Crossover variant of Wine-Browser back a few years ago when I was testing for their program (I discontinued because I'm busy testing for proton.)

At the time it was not working fully in Wine-Mono and required Microsoft DotNet packages. I should see if it works with Wine Mono and Crossover Browser later. If Valve is still working with Codeweavers on Wine Proton maybe they should see about having a version of Crossover Browser element adapted.

madewokherd commented 3 years ago

There are no differences in jscript.dll between CrossOver and upstream Wine.

jiminorris commented 3 years ago

As long as I've had dotnet20 and vcrun2005 installed, too, the Launcher has worked on all versions of Proton here. I'm running successfully on 6.3-4 now.

Ruedii commented 3 years ago

The difference in crossover is when you install the crossover browser component.

I suspect there is a difference in the manner in which the crossover browser handles javascript. It may install an appropriate tweak for the class of IE-Specific code that is causing the crash, or it may simply handle the fault gracefully.

I will double check if it still works on Crossover in this manner since I haven't in a while.

Ruedii commented 3 years ago

As long as I've had dotnet20 and vcrun2005 installed, too, the Launcher has worked on all versions of Proton here. I'm running successfully on 6.3-4 now.

To repeat, I am running WITHOUT the added Microsoft components, to ISOLATE what is causing the crash.

JScript.dll causes the crash when .Net and MSVC are NOT installed.

I repeat: MSVC and .Net are NOT INSTALLED.

You seem to have trouble with this concept repeatedly. We are discussing isolating the bug and finding where it is. We are NOT discussing what third party components need to be installed need to be installed to make it work perfectly. That information is not any help.

madewokherd commented 3 years ago

The only thing the "CrossOver Explorer" install does is make a shortcut to iexplore.exe and, for some reason, override jscript.dll to builtin.

I checked for changes in CrossOver's iexplore.exe, mshtml.dll, ieframe.dll, and jscript.dll. Here's what I've come up with:

tannisroot commented 3 years ago

@madewokherd would it be possible for you to format-patch some of those changes (the ones that aren't pointless) to the components mentioned and upload them here in an archive? i would be willing to test to see which one of them is fixing the launcher.

madewokherd commented 3 years ago

We don't have the changes in commit form, we just merge Wine in every time there's a release.

The only one I'd expect to make a difference is the threading stuff in ieframe, so I'll try to pull out a diff for that.

madewokherd commented 3 years ago

Diff attached for the ieframe.dll hack that works around document objects being requested from the wrong thread.

ieframe-marshaldocument.txt

Ruedii commented 3 years ago

We don't have the changes in commit form, we just merge Wine in every time there's a release.

The only one I'd expect to make a difference is the threading stuff in ieframe, so I'll try to pull out a diff for that.

I suspect that is it.

However, a more permanent solution would be to put in a quirk to handle bad Javascript.

I should fetch a list of web files pulled by launcher to see if I can track down the bug. You don't happen to know an easy program to do this? If not I'll search around next time I'm bored. (This may be a while because I got a few new games. Still need to make whitelist reports for them, though. They all work beautifully in proton. In some ways they work better than the Linux versions on the two that have experimental Linux builds.)

tannisroot commented 3 years ago

@madewokherd Unfortunately that hack does not help with this issue, so it must have been a red herring.

gofman commented 3 years ago

@madewokherd @tannisroot Actually, we have this hack in Proton (in stable since 6.3-3 and in Experimental) and it actually works here and fixes the issue (turning it on avoids the crash and let me start the game from launcher). The hack was auto enabled for The Bus which is otherwise crashing on launch. Unfortunately, when I was adding the environment variable for it into Proton, I apparently could not distinguish between the '1' character and character with code 1, and thus turning this hack on for arbitrary game currently requires setting WINE_GECKO_MAIN_THREAD environment variable to the character with hex code \x01. I am not sure it is doable through Proton launch options, but the following string inside user_settings in user_settings.py file helps: "WINE_GECKO_MAIN_THREAD" : "\x01",

aeikum commented 3 years ago

Proton Experimental was updated today and should fix the Sims 3 launcher issue.

Edit: Hearing reports that it is actually still broken.

bonacan commented 3 years ago

Is it just me or required registry entries for the game is not added to the Proton prefixes anymore? I am currently using Steam client beta, and tried almost every single Proton version, went as back as Proton 4.11, and every time, the game didn't launch because registry entries required for this game is not added for some reason (checked with regedit). Because of that, the game does not run for me.

If I add the registry entries myself, the game runs, however the launcher issue is still there for me. (On Proton Experimental)

FYI, I am on Elementary OS 6, and Steam is a dpkg install, not flatpak.

Edit: Further tested the launcher with Proton Experimental (after adding the registry entries to make it work), it appears to be more stable compared to the previous Proton versions. It doesn't crash immediately like before, but it still eventually crashes after a few seconds. Also, if you start the game before the launcher crashes, and then quit the game after it launches, the launcher process stays open in the background for some reason and doesn't get closed unless you kill it yourself.

Ruedii commented 2 years ago

Doesn't work yet, but no longer has hard crash.

Window disappears and process hardlocks.

According to the log it is getting pretty far too. It's actually succeeding in starting to render the page.

While there are some fixmes on Javascript, I don't know if that is what is causing it.

What is the current javascript interpreter being used? If we are using the one that ships with Gecko is there a way to get Mono JScript working for it. That would be closer to bug for bug replication of IE's Javascript.

Ideally we could import the JScript and XML modules from .Net core, but I understand some of them have certain incompatibilities, and rebuilding everything on .Net Core might be even more difficult. Additionally, the Windows versions may glitch on Wine's libraries.

madewokherd commented 2 years ago

Wine has its own jscript implementation that's used with Gecko. I don't know the details, but I doubt another API could be swapped in while keeping the COM integration working.

Ruedii commented 2 years ago

Sims 3 launcher is no longer crashing on load.

The welcome page's render is incomplete but this doesn't crash the launcher. Game works fine as far as I can tell.

I haven't fully tested shop downloads but they might not be working. It also could be that the server is just down or one of those first launch glitches was happening.

This is major progress! I hope other games held back by broken .Net launchers have the same progress, even though most of them aren't dependent on their launchers in any way. At most the launchers just provide config options and possible pretouch some game files to speed caching. In some cases they do nothing but display a splash screen.

Ruedii commented 2 years ago

Update:
Downloads clearly do not work from in game. It causes the launcher to crash when that happens. I will later see if the same happens when using a URI to start the download.

p.s. One of the reasons to test using a URI to start the download is it will give a cleaner log.

vulongm commented 2 years ago

I notice after installing, Steam doesn't seem to be running the install scripts (_install.vdf files) which setups the registry for Sims specific things resulting in the error "Unable to start. Please reinstall the base game."

Ruedii commented 2 years ago

With the latest version it is still crashing when initializing upload and download.

myo commented 2 years ago

I'm getting "Unable to start. Please reinstall the base game" on Proton experimental.

myo commented 2 years ago

Thanks for the fix guys @kisak-valve

riddemon commented 2 years ago

I'm getting "Unable to start. Please reinstall the base game" on all proton versions (including experimental) @bonacan can you please write here the registry keys you added ?

Pop_OS 20.04 LTS GPU: Nvidia GTX 980ti Driver version: 470.86

riddemon commented 2 years ago

@kisak-valve any solution?

Ruedii commented 2 years ago

Have you tried deleting your compat data directory and verifying the game files?

The compat directory is: steamapps/compat/47890

This is where steamapps is the main subdirectory of your Steam Library folder.

This is basically the virtual Windows installation for the game. Deleting it will revert it to the default Proton install.

My game will launch just fine, but it crashes if I try to download or upload something to/from the Sims 3 website. It now actually logs in under the launcher properly, though, which it didn't on my last testing cycle. (Progress is progress.)

I'm going to be trying with a fresh install today, because I haven't in a few months.

I always check first vanilla without any bugfix mods and then with them. (NRAAS Error-Trap and such.)

Update: Launcher still crashes when I attempt to download Sims3 store items.

myo commented 2 years ago

@kisak-valve we will need a way to run install.vdf files whenever we want from the client to add the required registry fields. Make the option user-friendly and call the option "rerun installation script" under context menu > manage.

kisak-valve commented 2 years ago

Hello @myo, friendly reminder that I'm a moderator for Valve's issue trackers on Github, and not a Steam developer myself. Your request is already being tracked at https://github.com/ValveSoftware/steam-for-linux/issues/6346.

myo commented 2 years ago

@kisak-valve I can tell, you're more productive than all the developers at valve, they couldn't add this entry in the menu that executes already existing code in 3 years. Thank you for assistance and sorry for duplicate, only checked this repository then I realised it isn't the right one to request it in.

Ruedii commented 2 years ago

Found the issue with getting downloads from the store working.

This is logged to the proton log when the launcher receives the message from the game to download something from The Sims 3 Store.

It is clearly an issue in IPC between Native code and Mono code. I am not sure of the specifics, though.

[00000768:] EXCEPTION handling: System.Runtime.InteropServices.MarshalDirectiveException: [MarshalAs] attribute required to marshal arrays to managed code.

Unhandled Exception:
System.Runtime.InteropServices.MarshalDirectiveException: [MarshalAs] attribute required to marshal arrays to managed code.
  at (wrapper native-to-managed) Sims3Launcher.BusinessLogic+S3LEvents.DLStatusChangedProxy(Sims3Launcher.BusinessLogic/S3L_DownloadItem,intptr,uint)
[ERROR] FATAL UNHANDLED EXCEPTION: System.Runtime.InteropServices.MarshalDirectiveException: [MarshalAs] attribute required to marshal arrays to managed code.

@madewokherd It looks like it's to the next error now. The web panel is no longer throwing any fatal exceptions, and it's all in the mono to native and native to mono stack now.

riddemon commented 2 years ago

Have you tried deleting your compat data directory and verifying the game files?

Yes, I have tried multiple times. As stated in other replies the problem is that Steam recognizes .vdf files as corrupt and therefore will always be stuck in a loop of failing to verify them and redownloading them. (Which means that they're not run and the registry is incomplete)

riddemon commented 2 years ago

Does anyone know any solution? Maybe posting the registry keys for TS3 would be helpful

myo commented 2 years ago

Does anyone know any solution? Maybe posting the registry keys for TS3 would be helpful

You have them in the install.vdf file, I added each of them manually and it worked. Honestly can't believe "verify game integrity" doesn't verify registry keys as well.

riddemon commented 2 years ago

You have them in the install.vdf file, I added each of them manually and it worked. Honestly can't believe "verify game integrity" doesn't verify registry keys as well.

I tried this already with little to no success, can you please send me the part that is meant to be added? @myo

Edit: Just tried pasting the registry keys from all .vdf files with no success. Maybe I'm pasting the wrong ones? new keys.txt

Ruedii commented 2 years ago

In that case, try wiping the entire wine virtual drive, and uninstalling and reinstalling the game.

For me, usually wiping the drive works. I've had no problems with it setting the right registry keys. You are loading up the launcher at least once? You must launch through the launcher the first time you launch the game to set the registry keys, then log in through the game to your EA account once. This connects your game with the origin DRM. Then you can log out, and launch, bypassing the launcher if you wish to do so (most often for privacy reasons, as the standard network services for social connections to the forum do work on Linux, even if store downloads, content showcase uploads, and screenshot/video uploads (via Sims 3 Website) don't work. I just use Steam screenshots instead, so I don't care about any of that.

Message ID: @.***

riddemon commented 2 years ago

try wiping the entire wine virtual drive, and uninstalling and reinstalling the game.

I already wiped the compat data (and therefore the virtual drive) and reinstalled the game multiple times

You are loading up the launcher at least once?

yes, I am. The launcher itself doesn't open either.

then log in through the game to your EA account once.

I played TS3 less than 3 months ago: the game worked flawlessly without it.

Ruedii commented 2 years ago

What version of Proton are you using?

riddemon commented 2 years ago

I'm currently using Proton 6.3-8 (which worked 3 months ago). However I tried every Proton version and nothing changes

riddemon commented 2 years ago

@Ruedii any solution?

wwboyer commented 2 years ago

You have them in the install.vdf file, I added each of them manually and it worked. Honestly can't believe "verify game integrity" doesn't verify registry keys as well.

I tried this already with little to no success, can you please send me the part that is meant to be added? @myo

Edit: Just tried pasting the registry keys from all .vdf files with no success. Maybe I'm pasting the wrong ones? new keys.txt

Looking at your keys file, It seems like you need to replace the instances of %INSTALLDIR% with the actual directory it's installed to on the prefix (I think it's C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Sims 3) and instances of %CDKEY% with the CD Key of the expansion pack (You can find these by right clicking The Sims 3 in your Steam library then going to Manage -> CD Keys).

riddemon commented 2 years ago

@wwboyer no, this doesn't solve the problem. Any other idea?

riddemon commented 2 years ago

Can anyone actually help me? It's a bit annoying to have to post a comment twice to get someone's attention...

Ruedii commented 2 years ago

Can anyone actually help me? It's a bit annoying to have to post a comment twice to get someone's attention...

This isn't really the place for advanced support.
Again, installed out of box and it worked for me. Are you sure it is the registry? Have you checked that your distro and computer meets Proton's minimum requirements?

I've found flatpak installs of Steam do not play nice with proton without some coaxing, BTW.

Anyhow, as of my report so far on progress: For me, launcher is working almost fully.

Layout less mangled, but still limited images on welcome page in launcher. Login now works in launcher. Downloads hang the launcher on C++ native call instead of crashing. I haven't tried uploads yet.
This hanging the launcher causes it to be impossible to switch back to the game.

riddemon commented 2 years ago

Are you sure it is the registry?

Pretty sure as steam keeps trying to download .vdf files and I can see the registry lacks some informations.

Have you checked that your distro and computer meets Proton's minimum requirements?

Yes. I play other games using Proton.

I've found flatpak installs of Steam do not play nice with proton without some coaxing, BTW.

I have installed Steam from the official website.

What's the place where I should be looking for "Advanced support" then? I contacted EA, who told me to contact Valve (steam support). I contacted the steam support, who told me to ask on the proton git.

Ruedii commented 2 years ago

The valve steam package is very much out of date. Use the one from your distro.

On Thu, Jun 16, 2022, 5:32 AM riddemon @.***> wrote:

Are you sure it is the registry?

Pretty sure as steam keeps trying to download .vdf files and I can see the registry lacks some informations.

Have you checked that your distro and computer meets Proton's minimum requirements?

Yes. I play other games using Proton.

I've found flatpak installs of Steam do not play nice with proton without some coaxing, BTW.

I have installed Steam from the official website.

What's the place where I should be looking for "Advanced support" then? I contacted EA, who told me to contact Valve (steam support). I contacted the steam support, who told me to ask on the proton git.

— Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/Proton/issues/2502#issuecomment-1157442797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYFL2JDSUL55P2USGUU7ULVPLYDFANCNFSM4HDV2HMA . You are receiving this because you were mentioned.Message ID: @.***>

riddemon commented 2 years ago

@Ruedii I already tried with different versions of Steam. Besides this the one from the Website used to work...

Can you PLEASE just send me the registry keys or tell me what I am missing in my file?