PhoenicisOrg / scripts

Phoenicis scripts
GNU Lesser General Public License v3.0
64 stars 49 forks source link

Update Space Engineers, pass appId as number, remove faudio and disable NVAPI workarround #1119

Open Zemogiter opened 4 years ago

Zemogiter commented 4 years ago

Description

By using the PPA linked in the script, vanilla Space Engineers is nearly free of audio stutters. Introducing mods changes that for the worse but nothing we can do about that.

What works

Everything

What was not tested

Nothing

Test

Zemogiter commented 4 years ago

Blocked until #1137 is merged

Zemogiter commented 4 years ago

Blocked until #1138 is fixed.

Zemogiter commented 4 years ago

Ready for review.

Zemogiter commented 4 years ago

@madoar can't test beause of https://github.com/PhoenicisOrg/phoenicis/issues/2115#issuecomment-558359796 UPDATE: @plata suggested mvn install before mvn exec:java and it helped. But now I have this issue #1143 which prevent me from testing. But I know the game works because I've updated Lutris script to work practicly the same as this one. See https://github.com/PhoenicisOrg/scripts/issues/1143#issuecomment-568417453

Zemogiter commented 4 years ago

Blocked until https://github.com/PhoenicisOrg/scripts/issues/1148 is fixed

Zemogiter commented 4 years ago

OK so after all "blocked by x" or "blocked until x is fixed/merged" comments have been solved, I've copied the version of this script from this repo to a local one. Clicking "install" results in this error:

TypeError: undefined is not a function
    at <js> QuickScript(Unnamed:25:926-972)
    at <js> SteamScript(Unnamed:15:679-685)
    at <js> :program(Unnamed:12:492-508)
    at org.graalvm.polyglot.Context.eval(Context.java:370)
    at org.phoenicis.scripts.engine.implementation.PolyglotScriptEngine.evalAndReturn(PolyglotScriptEngine.java:73)
    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)
madoar commented 4 years ago

Can you locate where exactly this occurs?

Zemogiter commented 4 years ago

Where, as-in what line of the script cause the error? Update: terminal log

[WARNING] 
java.lang.ClassCastException: class java.lang.String cannot be cast to class org.graalvm.polyglot.Value (java.lang.String is in module java.base of loader 'bootstrap'; org.graalvm.polyglot.Value is in unnamed module of loader java.net.URLClassLoader @328902d5)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:235)
    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)
madoar commented 4 years ago

You misunderstood me. I want to know where in the script code the error occurs, i.e. which accessed variable is undefined.

Zemogiter commented 4 years ago

@madoar I get it now but now I get this error when clicking on "install" button in any script. And everytime the same error shows up in terminal log.

plata commented 4 years ago

@Zemogiter please be sure to really use the latest master of the sofware, i.e. do mvn clean package (or mvn clean install for mvn exec:java).

Zemogiter commented 4 years ago

How to make the link in wizard.message clickable?

plata commented 4 years ago

I think that's not possible. The message step uses a plain text if I remember correctly.

Zemogiter commented 4 years ago

Lutris script have a pulse_latency: true option and I would like to know how to set this up in POL5.

plata commented 4 years ago

See https://github.com/lutris/lutris/blob/ad819ea0b5bde4ffd86e0803d45262341e3e7a64/lutris/game.py#L447

There are two options: Write a new verb or use the existing .environment() of QuickScript.

Zemogiter commented 4 years ago

@plata got it. Went for the second option. I'll see if it removes audio stutter like in Lutris script.

Zemogiter commented 4 years ago

After all those commits the game is working and the only audio stutter is at the main menu for about 5 first seconds of the song. However that is present on Windows as well. Ready for review.

plata commented 4 years ago

@madoar would you like to review this (you requested the last changes)?

Zemogiter commented 4 years ago

Blocked until #1198 is merged.

Zemogiter commented 4 years ago

I have a problem. Merging #1198 in local repo results in this error when verifying steam installer:

org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: invokeMember (writeValue) on JavaObject[org.phoenicis.tools.config.CompatibleConfigFileFormat@3324f53a (org.phoenicis.tools.config.CompatibleConfigFileFormat)] failed due to: UnsupportedTypeException
    at <js> createContainer(Unnamed:359:13215-13271)
    at <js> prefix(Unnamed:79:2538-2603)
    at <js> go(Unnamed:129-131:7060-7201)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy67.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:830)

[WARNING] 
org.graalvm.polyglot.PolyglotException: TypeError: invokeMember (writeValue) on JavaObject[org.phoenicis.tools.config.CompatibleConfigFileFormat@3324f53a (org.phoenicis.tools.config.CompatibleConfigFileFormat)] failed due to: UnsupportedTypeException
    at <js>.createContainer (Unnamed:359)
    at <js>.prefix (Unnamed:79)
    at <js>.go (Unnamed:129)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy67.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:830)
plata commented 4 years ago

It works if you do not use the .environment?

Zemogiter commented 4 years ago

@plata removed .environment from SE script, still crashes at the same point with the same message

plata commented 4 years ago

Then, how can it be related to #1198?

Zemogiter commented 4 years ago

Then I guess it's not.

Zemogiter commented 4 years ago

OK so I've removed any changes to QuickScript and SteamScript regarding environment() and pasted the changes from this PR to the local repo execpt the aforementioned environment(). Once I get to the step when the Steam installation should start, it dosen't and I get no error in terminal. It's stuck at "Please follow the steps of Steam installation...." message.

plata commented 4 years ago

Other Steam app installations work?

Zemogiter commented 4 years ago

Just tried the Space Colony steam script and the steam installer launched just fine. UPDATE: The script went though .preInstall() fine but upon launching steam again it crashed with this error:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - /home/jonasz/.Phoenicis/containers/wineprefix/Space Colony/drive_c/Program Files/Steam/Steam.exe (no such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154)
    at org.phoenicis.tools.win32.ExeAnalyser.isArchitecture(ExeAnalyser.java:61)
    at org.phoenicis.tools.win32.ExeAnalyser.is64Bits(ExeAnalyser.java:46)
    at <js> run(Unnamed:407:15350-15396)
    at <js> run(Unnamed:172:5961-6051)
    at <js> runInsidePrefix(Unnamed:139:4721-4822)
    at <js> go(Unnamed:174:8729-8833)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy68.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:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at java.base/java.lang.Thread.run(Thread.java:832)
Caused by host exception: java.io.FileNotFoundException: /home/jonasz/.Phoenicis/containers/wineprefix/Space Colony/drive_c/Program Files/Steam/Steam.exe (no such file or directory)

The issue is because its steam.exe not Steam.exe

plata commented 4 years ago

If the executable has been renamed, it must be changed in https://github.com/PhoenicisOrg/scripts/blob/dc0dd769a70e00c1d42c23545a282a27d8b8d5a2/Engines/Wine/QuickScript/Steam%20Script/script.js#L17