scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Add The Sims 4

Open Zemogiter opened this issue 5 years ago • 29 comments

The game crashes at intro. wine.log It happens regardless of D9VK (tested without it - same crash).

Zemogiter avatar May 15 '19 15:05 Zemogiter

It seems to be an Origin related crash.

ImperatorS79 avatar May 15 '19 15:05 ImperatorS79

But origin stays functional after the crash.

Zemogiter avatar May 15 '19 15:05 Zemogiter

Oh, so I definitely cannot read wine crash dump ^^.

ImperatorS79 avatar May 15 '19 15:05 ImperatorS79

OK so I've tried the Lutris script here: https://lutris.net/games/install/13489/view But it has issues as well. It forces winxp so Origin can't be installed and even if it could the game wouldn't likey work. It also doesn't install the dotnet20sp2 verbs as well as vcruns. Here is my moddification of that script, after which the game installs and runs fine:

---
count: 1
next: 
previous: 
results:
- id: 13489
  game_id: 6382
  game_slug: the-sims-4
  name: The Sims 4
  year: 2014
  user: PolishWine
  runner: wine
  slug: the-sims-4-origin-d9vk
  version: Origin | D9VK | dotnet&vcrun
  description: Utilizes Vulkan to greatly improve perfomance. And dotnet&vcrun combo to prevent game installation errors. 
  notes: The game will most likely fail to launch with Origin-In-Game enabled. Please
    disable it in Origin's preferences to launch The Sims 4.
  created_at: '2019-05-21T12:32:58.659000Z'
  updated_at: '2019-05-21T12:32:58.659000Z'
  draft: true
  published: true
  published_by: 51687
  rating: '4'
  steamid: 
  gogid: 
  gogslug: ''
  humblestoreid: ''
  script:
    game:
      arch: win64
      exe: drive_c/Program Files (x86)/Origin/Origin.exe
      prefix: "$GAMEDIR"
    files:
    - d9vk: https://github.com/Joshua-Ashton/d9vk/releases/download/0.11/d9vk-0.11.tar.gz
    - updater: https://raw.githubusercontent.com/DrDoctor13/wine-origin-updater/master/updateorigin.sh
    - origin: https://origin-a.akamaihd.net/Origin-Client-Download/origin/live/OriginThinSetup.exe
    installer:
    - extract:
        file: d9vk
        dst: "$CACHE/d9vk-0.11/"
    - copy:
        dst: "$HOME/.local/share/lutris/runtime/dxvk/d9vk-0.11/"
        src: "$CACHE/d9vk-0.11/"
    - task:
        arch: win64
        description: Creating Wine Prefix...
        name: create_prefix
        prefix: "$GAMEDIR"
    - task:
        arch: win64
        name: winetricks
        prefix: "$GAMEDIR"
        app: nocrashdialog
    - task:
        app: dotnet20sp2
        description: Installing .Net
        name: winetricks
        prefix: $GAMEDIR
        silent: true
    - task:
        app: vcrun2010
        name: winetricks
        prefix: $GAMEDIR
        silent: true
    - task:
        app: vcrun2012
        name: winetricks
        prefix: $GAMEDIR
        silent: true
    - task:
        app: vcrun2013
        name: winetricks
        prefix: $GAMEDIR
        silent: true
    - task:
        arch: win64
        description: Installing Origin... Login window will pop-up and close.
        name: wineexec
        executable: origin
        args: "/silent"
        exclude_processes: Origin.exe OriginClientService.exe OriginWebHelperService.exe
          QtWebEngineProcess.exe
        prefix: "$GAMEDIR"
    - task:
        name: winekill
        prefix: "$GAMEDIR"
    - task:
        arch: win64
        description: Spoofing AMD RX 550...
        key: VideoPciVendorID
        value: 1002
        name: set_regedit
        path: HKEY_CURRENT_USER\Software\Wine\Direct3D
        prefix: "$GAMEDIR"
        type: REG_DWORD
    - task:
        arch: win64
        description: Spoofing AMD RX 550...
        key: VideoPciDeviceID
        value: 699f
        name: set_regedit
        path: HKEY_CURRENT_USER\Software\Wine\Direct3D
        prefix: "$GAMEDIR"
        type: REG_DWORD
    - task:
        name: winekill
        prefix: "$GAMEDIR"
    - chmodx: updater
    - merge:
        dst: "$GAMEDIR/drive_c/Program Files (x86)/Origin"
        src: updater
    wine:
      dxvk_version: d9vk-0.11
      overrides:
        nvapi,nvapi64: disabled
      dxvk: true
      version: tkg-4.0-x86_64
      esync: true
    system:
      exclude_processes: QtWebEngineProcess.exe ActivationUI.exe OriginWebHelperService.exe
      ondemand_command: "$GAMEDIR/drive_c/Program Files (x86)/Origin/updateorigin.sh"
      env:
        STAGING_SHARED_MEMORY: '0'
        __GL_SHADER_DISK_CACHE_PATH: "$GAMEDIR"
        __GL_SHADER_DISK_CACHE: '1'

The script above I can convert this to POL5 expect for the following:

  • missing nocrashdialog verb
  • dont know how to implement the exclude_processes part (and I dont know if its even necesseary)
  • I haven't found where Lutris stores the env values. The only option I can think of is writing them manually in /etc/enviroment

Zemogiter avatar May 21 '19 11:05 Zemogiter

@Zemogiter there is an issue on this repo already to add env variable for game execution #869.

ImperatorS79 avatar May 21 '19 11:05 ImperatorS79

OK but should nocrashdialog be in Plugins, Verbs or Settings?

Zemogiter avatar May 22 '19 08:05 Zemogiter

nocrashdialog is not a separate application (like e.g. .NET), therefore it should not be a verb but rather a plugin. If it should be configurable from the GUI, we also need a setting using this plugin. However, we must be careful not to overload the available settings in the GUI.

plata avatar May 25 '19 08:05 plata

Understood. Blocked until #954 is merged.

Zemogiter avatar May 27 '19 09:05 Zemogiter

Even with changes to the origin script from lutris the game still crashes wine.log Maybe we need their tgk-wine-4.0

Zemogiter avatar May 29 '19 07:05 Zemogiter

@Zemogiter Would proton build work?

qparis avatar Jun 07 '19 17:06 qparis

@qparis ~~no idea and I can't test because my ubuntu installation got broken every 30 seconds or so it becomes unresponsive and there is no solution online~~ UPDATE: Tried proton 3.16 x64 since its our only 64bit proton we have. Origin installation window is a white rectangle surrounded by black borders typical for origin installation windows.

Zemogiter avatar Jun 07 '19 18:06 Zemogiter

@madoar here is the eslint output:

/home/jonasz/Pobrane/scripts-master/Applications/Games/League of Legends/Online/script.js
  35:13  error  'regionID' is assigned a value but never used  no-unused-vars

/home/jonasz/Pobrane/scripts-master/Applications/Games/The Sims 4/Local/script.js
   3:7   error  'Resource' is assigned a value but never used  no-unused-vars
  29:36  error  'AppResource' is not defined                   no-undef
  34:62  error  'installerImplementation' is not defined       no-undef

/home/jonasz/Pobrane/scripts-master/Applications/Games/The Sims 4/Origin/script.js
   3:7   error  'Resource' is assigned a value but never used  no-unused-vars
  30:36  error  'AppResource' is not defined                   no-undef

/home/jonasz/Pobrane/scripts-master/Engines/Wine/Engine/Implementation/script.js
  392:52  error  'distribution' is not defined  no-undef

/home/jonasz/Pobrane/scripts-master/Engines/Wine/Engine/Object/script.js
   33:5   error  Missing JSDoc return description                                valid-jsdoc
   35:8   error  Missing JSDoc parameter description for 'wizard'                valid-jsdoc
   49:5   error  Missing JSDoc return description                                valid-jsdoc
   50:8   error  Missing JSDoc parameter description for 'path'                  valid-jsdoc
   57:5   error  Missing JSDoc return description                                valid-jsdoc
   59:8   error  Missing JSDoc parameter description for 'prefix'                valid-jsdoc
   60:8   error  Missing JSDoc parameter description for 'distribution'          valid-jsdoc
   61:8   error  Missing JSDoc parameter description for 'architecture'          valid-jsdoc
   62:8   error  Missing JSDoc parameter description for 'version'               valid-jsdoc
   85:5   error  Missing JSDoc return description                                valid-jsdoc
  120:5   error  Missing JSDoc @returns for function                             valid-jsdoc
  122:8   error  Missing JSDoc parameter description for 'executable'            valid-jsdoc
  123:8   error  Missing JSDoc parameter description for 'args'                  valid-jsdoc
  124:8   error  Missing JSDoc parameter description for 'wait'                  valid-jsdoc
  142:8   error  Missing JSDoc parameter description for 'executable'            valid-jsdoc
  143:8   error  Missing JSDoc parameter description for 'args'                  valid-jsdoc
  144:8   error  Missing JSDoc parameter description for 'workingDirectory'      valid-jsdoc
  145:8   error  Missing JSDoc parameter description for 'captureOutput'         valid-jsdoc
  146:8   error  Missing JSDoc parameter description for 'wait'                  valid-jsdoc
  147:8   error  Missing JSDoc parameter description for 'userData'              valid-jsdoc
  175:8   error  Expected JSDoc for 'application' but found 'name'               valid-jsdoc
  180:50  error  Unnecessary escape character: \-                                no-useless-escape
  180:52  error  Unnecessary escape character: \[                                no-useless-escape
  180:56  error  Unnecessary escape character: \/                                no-useless-escape
  180:58  error  Unnecessary escape character: \{                                no-useless-escape
  180:60  error  Unnecessary escape character: \}                                no-useless-escape
  180:62  error  Unnecessary escape character: \(                                no-useless-escape
  180:64  error  Unnecessary escape character: \)                                no-useless-escape
  180:66  error  Unnecessary escape character: \*                                no-useless-escape
  180:68  error  Unnecessary escape character: \+                                no-useless-escape
  180:70  error  Unnecessary escape character: \?                                no-useless-escape
  180:72  error  Unnecessary escape character: \.                                no-useless-escape
  180:76  error  Unnecessary escape character: \^                                no-useless-escape
  180:78  error  Unnecessary escape character: \$                                no-useless-escape
  180:80  error  Unnecessary escape character: \|                                no-useless-escape
  226:5   error  Missing JSDoc @returns for function                             valid-jsdoc
  228:8   error  Expected JSDoc for 'parameter' but found 'wineserver'           valid-jsdoc
  264:5   error  Missing JSDoc return description                                valid-jsdoc
  274:5   error  Missing JSDoc return description                                valid-jsdoc
  284:5   error  Missing JSDoc return description                                valid-jsdoc
  286:8   error  Missing JSDoc parameter description for 'architecture'          valid-jsdoc
  286:8   error  Expected JSDoc for 'architectureName' but found 'architecture'  valid-jsdoc
  301:5   error  Missing JSDoc return description                                valid-jsdoc
  303:8   error  Missing JSDoc parameter type for 'string'                       valid-jsdoc
  303:8   error  Expected JSDoc for 'distributionName' but found 'string'        valid-jsdoc

/home/jonasz/Pobrane/scripts-master/Engines/Wine/QuickScript/Quick Script/script.js
   56:5  error  Missing JSDoc @returns for function                     valid-jsdoc
   71:5  error  Missing JSDoc @returns for function                     valid-jsdoc
   73:8  error  Missing JSDoc parameter type for 'executable'           valid-jsdoc
   74:8  error  Missing JSDoc parameter type for 'args'                 valid-jsdoc
  130:8  error  Missing JSDoc parameter description for 'trustlevel'    valid-jsdoc
  130:8  error  Expected JSDoc for 'trustLevel' but found 'trustlevel'  valid-jsdoc
  138:5  error  Missing JSDoc @returns for function                     valid-jsdoc

/home/jonasz/Pobrane/scripts-master/Engines/Wine/QuickScript/Steam Script/script.js
  47:50  error  Unnecessary escape character: \"  no-useless-escape
  47:62  error  Unnecessary escape character: \"  no-useless-escape
  47:67  error  Unnecessary escape character: \"  no-useless-escape
  47:74  error  Unnecessary escape character: \"  no-useless-escape
  59:50  error  Unnecessary escape character: \"  no-useless-escape
  59:62  error  Unnecessary escape character: \"  no-useless-escape
  59:67  error  Unnecessary escape character: \"  no-useless-escape
  59:74  error  Unnecessary escape character: \"  no-useless-escape

✖ 67 problems (67 errors, 0 warnings)

Zemogiter avatar Aug 20 '19 20:08 Zemogiter

STAGING_SHARED_MEMORY: '0'
__GL_SHADER_DISK_CACHE_PATH: "$GAMEDIR"
__GL_SHADER_DISK_CACHE: '1'

@Zemogiter You can add those in a QuickScript using .environment('{ "var1": "value1", "var2": "value2"}')

ImperatorS79 avatar Aug 25 '19 17:08 ImperatorS79

However I doubt $GAMEDIR will work ^^^

ImperatorS79 avatar Aug 25 '19 18:08 ImperatorS79

This PR needs to be rebased

madoar avatar Sep 12 '19 18:09 madoar

@madoar done

Zemogiter avatar Sep 14 '19 07:09 Zemogiter

D9VK installation crashes:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: execute on JavaObject[org.phoenicis.scripts.wizard.UiSetupWizardImplementation@71d4ec6b (org.phoenicis.scripts.wizard.UiSetupWizardImplementation)] failed due to: Message not supported.
	at <js> go(Unnamed:57:2081-2088)
	at <js> :anonymous(Unnamed:25:1066-1084)
	at <js> go(Unnamed:55:1802-1836)
	at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
	at com.sun.proxy.$Proxy66.go(Unknown Source)
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

[WARNING] 
org.graalvm.polyglot.PolyglotException: TypeError: execute on JavaObject[org.phoenicis.scripts.wizard.UiSetupWizardImplementation@71d4ec6b (org.phoenicis.scripts.wizard.UiSetupWizardImplementation)] failed due to: Message not supported.
    at <js>.go (Unnamed:57)
    at <js>.:anonymous (Unnamed:25)
    at <js>.go (Unnamed:55)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy66.go (Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

Zemogiter avatar Dec 09 '19 10:12 Zemogiter

Can you find out where exactly the script crashes? My guess is that it is somewhere around the menu(...) call.

madoar avatar Dec 12 '19 20:12 madoar

I've copied the version of D9VK script from our repo and the error is gone. Now I eperience the https://github.com/PhoenicisOrg/scripts/issues/1148

Zemogiter avatar Dec 13 '19 09:12 Zemogiter

I'm at lost as to why the game crashes here but works fine under Lutris. The scripts are functionally identical! I've tried setting api-ms-win-core-path-l1-1-0 and msvcr120 as Native after stumbling upon similiar bugs in AppDB but it changes nothing. The wine.log mentions Fatal Python error: init_sys_streams: can't initialize sys standard streams but none of google results match the issue. wine.log

Zemogiter avatar Dec 20 '19 11:12 Zemogiter

Now this is odd. I've reported this problem on d9vk's repo https://github.com/Joshua-Ashton/d9vk/issues/478 and they suggested to retest on fresh wineprefix with no workarounds. I did and I get the same thing. However when I did the exact same thing on POL4 the game works just fine. Both prefixes were using wine 5.0-rc1

Zemogiter avatar Dec 24 '19 11:12 Zemogiter

With or without runtime?

plata avatar Dec 24 '19 16:12 plata

With runtime.

Zemogiter avatar Dec 24 '19 16:12 Zemogiter

Can you try without?

plata avatar Dec 25 '19 08:12 plata

I've changed this line:

        this._useRuntime = (propertyReader.getProperty("application.environment.wineRuntime") !== "true");

from false to true and I get the same error.

Zemogiter avatar Dec 25 '19 10:12 Zemogiter

To summarize for a better understanding:

  • PoL 4 works
  • PoL 5 doesn't work
  • plain Wine doesn't work

Is that correct?

plata avatar Dec 28 '19 12:12 plata

Haven't tested plain wine yet.

Zemogiter avatar Dec 28 '19 14:12 Zemogiter

Can you do that?

plata avatar Dec 28 '19 15:12 plata

Tried plain wine. I can't even get Origin to install. The usual installation wizard window shows up but it's blank. Tried full setup and thin installer.

Zemogiter avatar Dec 28 '19 16:12 Zemogiter