Retera / WarsmashModEngine

An emulation engine to improve Warcraft III modding
GNU Affero General Public License v3.0
231 stars 42 forks source link

Display arsflash engine is starting But there's no interface #50

Open kero990 opened 1 year ago

kero990 commented 1 year ago

I completely followed the instructions to download Eclipse Temurin JDK 17 and modified warsmashini. During runtime, I did not see any valuable errors, but there was no interface.

$ ./gradlew desktop:runGame

> Task :desktop:runGame
Warsmash engine is starting...

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 5s
12 actionable tasks: 1 executed, 11 up-to-date

Subsequently, the terminal returned to the cursor and no new interface appeared.

use '--warning-mode all'

$ ./gradlew desktop:runGame --warning-mode all

> Configure project :desktop
The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the mainClass property instead. See https://docs.gradle.org/7.3.3/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details.
        at build_9icoz8pbo8didwitz51ii716m$_run_closure2.doCall(/media/inspur/_dde_data/compile/WarsmashModEngine/desktop/build.gradle:27)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Task :desktop:runGame
Warsmash engine is starting...

BUILD SUCCESSFUL in 8s
12 actionable tasks: 1 executed, 11 up-to-date

My current environment is arm64 Linux, debian10, OpenJDK17U jdk Aarch64 Linux Hotspot 17.0.8.1_1

Retera commented 1 year ago

Hmm, so, I tested something similar to this on arm linux a few weeks ago and I had a lot of trouble with it specifically because of the GPU in my arm linux device not supporting enough of the OpenGL stuff and so it resulted in a messed up visual that I didn't spend the time to figure out how to fix yet. It might be that some of the GLSL shader code in Warsmash does not fully conform to specification, or maybe it just requires a higher OpenGL version than what was available on my arm64 device.

Assuming your arm64 device has sufficient OpenGL capabilities unlike mine, however, the bug you are probably encountering is going to be logged in a Warsmash specific log file. From the looks of it, the code is compiling and executing for you but then failing and not showing the window. When this happens, two log files are created in ./core/assets/Logs. One of them is named <timestamp>.out.log and contains the standard output of Warsmash, and the other is named <timestamp>.err.log and contains the standard error output of Warsmash. Most likely, in your .err.log file there will be a message saying something like "unable to local bla.so" when it fails to locate the necessary .so native bindings for using OpenGL arm64. (Without additional native bindings, the standard Java libraries do not provide the OpenGL api. It's typically all handled automatically for all the available platforms, but arm64 did not become available on LWJGL until after the version of LWJGL currently in use on Warsmash.)

This failure to locate the .so file is not the same thing as the incorrect OpenGL version mentioned above. It can be fixed by going into build.gradle and changing the used LWJGL version to something newer or something like that if I recall. But there will be some compile errors to fix because of that. If we switch all the way to LWJGL3, we would lose surround sound and support for Reforged FLAC audio files and some other stuff because of how I hacked in overrides to the LibGDX bindings to use LWJGL2 features directly on Warsmash.

Edit: I pushed up my arm64 test branch here: https://github.com/Retera/WarsmashModEngine/tree/arm64-testing

As mentioned above, this branch did not work on my hardware but it's something that you could try. Basically it ports Warsmash to LWJGL3. For me, I got as far as the Frozen Throne style menu screen with the wind noise, but the 3D background was solid black except for the particles effects which were the only part of those that displayed. The buttons on the screen were also visible, because they use LibGDX Scene2D which has its own shaders (and those shaders were better at being cross platform than my stuff on Warsmash).

Edit 2: I was testing on a Vivante GC7000Lite GPU. According to Wikipedia, this only supports OpenGL ES 3.0 whereas I think some of the Warsmash stuff tries to use OpenGL 4 or OpenGL 4.5 stuff copied from HiveWE. OpenGL ES and OpenGL each have their own separate version numbers and at the moment I'm forgetting where on the internet I saw a table describing which versions correspond to which. But OpenGL 4.5 probably corresponds to a higher OpenGL ES version than ES 3.0.

kero990 commented 1 year ago

Thank you for your guidance I found these two log files, the out. log is empty, and the err. log content is as follows.

Exception in thread "main" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdx.so' for target: Linux, 32-bit
    at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:125)
    at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:33)
    at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.load(LwjglNativesLoader.java:47)
    at com.etheller.warsmash.desktop.DesktopLauncher.loadExtensions(DesktopLauncher.java:150)
    at com.etheller.warsmash.desktop.DesktopLauncher.main(DesktopLauncher.java:101)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: /tmp/libgdxinspur/887e5f75/libgdx.so: /tmp/libgdxinspur/887e5f75/libgdx.so: ELF Class error:ELFCLASS32 (Possible cause: can't load IA 32 .so on a AARCH64 platform)

Obviously, this is an attempt to call an x32 version of the libgdx. so library, but I have not found the way to call libgdx in your project, nor have I found a ready-made arm64 version of libgdx. I am not familiar with JAVA

In addition, I switched to the arm64 testing branch according to your suggestion and successfully entered the menu interface. Despite its obvious inability to recognize my Simplified Chinese environment, the menu text is all square, and it is also unable to recognize paths with Chinese characters. When I try to enter a Campaign, the program crashes. The log is very long, I attached it at the back. Because this copy of War3 is a freely downloaded version, I am not sure if any files are missing or if some patches have damaged the integrity of War3 itself. (For example, there is no war3local.mpq, but only war3xlocal, and I have removed the reference to the former.)

https://github.com/kero990/my_html/blob/master/1693551468944.err.log

To be honest, I would prefer to run the standard version, as arm testing clearly needs to improve the process. Assuming I find a libgdx for arm64

Retera commented 1 year ago

Another Chinese user described a 1-line fix to show the chinese characters on the menu buttons here: https://github.com/Retera/WarsmashModEngine/pull/46

In addition, the crash that you encountered on the campaign was in the main branch for all Warsmash users due to a bug and was not specific to you. So I fixed that crash in the main branch yesterday, and tried to merge the main branch into the arm64-testing for you today in case you wanted to try it.

kero990 commented 1 year ago

Hi, I pulled the latest code to continue trying to enter the game and added statements to fix Chinese.

Now he won't crash directly, but he will get stuck after reading the map. It is unclear whether this is a stuck process during map reading or a stuck process after entering the map. Subsequently, the screen will flash repeatedly on a particular image. For campaign missions, this image is a race image, while for custom maps, it is a background image similar to the main menu. Then we can only force an exit.

Also attach 2 logs for your analysis https://github.com/kero990/my_html/blob/master/1694661836085.out.log https://github.com/kero990/my_html/blob/master/1694661836098.err.log

Retera commented 1 year ago

Loading times are not optimized yet. Depending on your hardware and processor, loading might take a long time and appear to freeze on an image. If you allow it to load without forcing an exit, after a long time does it play?

kero990 commented 1 year ago

The CPU in my hand is actually PC grade (4-core 2.6-3.0g), but according to your suggestion, I left it for at least an hour after entering the map and confirmed that it remained unchanged but only flickered.

However, my platform does not support dxvk, and I am not sure if it is related.

Retera commented 1 year ago

My understanding of dxvk is that it is an abbreviation for Direct X Vulkan. However, the Warsmash project is not using Direct X, nor using Vulkan. So it is not related to dxvk and not having dxvk should not be an issue.

I looked at your logs some more and there are things happening in your setup that were not happening on my setup. You have some log lines indicating Warcraft 3 MPQ parsing failure:


block at 142B8D12 has detached sectors starting at 142B8E16 (4 bytes from end of sector table)
block at 13D8E3F2 has detached sectors starting at 13D8E4AA (4 bytes from end of sector table)
block at 14197D5F has detached sectors starting at 14197E2F (4 bytes from end of sector table)
block at 1464387E has detached sectors starting at 14643972 (4 bytes from end of sector table)
block at 13AB5CF0 has detached sectors starting at 13AB5D7C (4 bytes from end of sector table)
block at 135DD06E has detached sectors starting at 135DD0DE (4 bytes from end of sector table)
block at 1428E8AB has detached sectors starting at 1428E95F (4 bytes from end of sector table)
block at 13E458C6 has detached sectors starting at 13E45962 (4 bytes from end of sector table)

And I am not familiar with the cause of this error. This is coming from the MPQ parser that I am using, which is from here: https://www.hiveworkshop.com/threads/java-mpq-library-anyone.267416/

In addition, loading the UI files is having a token parse failure:

Loading TOC file: UI\FrameDef\FrameDef.toc
line 1:0 token recognition error at: ''
line 1:0 token recognition error at: ''
line 1:0 token recognition error at: ''
line 1:0 token recognition error at: ''
line 1:0 token recognition error at: ''
line 1:0 token recognition error at: ''

These are errors in the Warsmash understanding of the Warcraft 3 game and I am not sure if they are causing your problem. It might be that they are fine and not causing the problem, or it might be that they are related. Are you able to try an English version of Warcraft 3 to see if the problem is related to the Warcraft 3 installation that you have and some bug in Warsmash preventing it from parsing the Warcraft 3 install? I am not certain.

The other thing you can try is the "jstack" utility for Java, to ask the Java Virtual Machine that is running Warsmash to dump a stack trace of what is happening when it is stuck flickering.