MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.69k stars 1.34k forks source link

feat: upgrade to Gestalt 8 #5267

Closed BenjaminAmos closed 3 months ago

BenjaminAmos commented 3 months ago

Contains

This pull request upgrades the version of Gestalt used by Terasology to 8.0.0-SNAPSHOT. It only contains the changes needed to get the game running again. Further improvements, such as the integration of gestalt-di, may be made in the future.

How to test

Essentials

Outstanding before merging

This depends on MovingBlocks/gestalt#144 and MovingBlocks/TeraNUI#75.

Additional Notes

The following module-space changes also depend on this pull request:

soloturn commented 3 months ago

for me on java-21, linux, this fails:

> Configure project :engine-tests
Scanning for version in module.txt for engine-tests
Version for project ':engine-tests'.name loaded as 5.4.0-SNAPSHOT for group org.terasology.engine

FAILURE: Build failed with an exception.

* What went wrong:
'int com.github.zafarkhaja.semver.Version.getMajorVersion()'
jdrueckert commented 3 months ago

@soloturn I believe that this is because the Jenkins job on merging https://github.com/MovingBlocks/gestalt/pull/141 failed, so I guess a new gestalt artifact with that change was never published to artifactory. I triggered a new jenkins run of gestalt's develop: https://jenkins.terasology.io/job/Libraries/job/Gestalt/job/develop/2 Let's see if that works and if it does and publishes the artifact, maybe you can retry.

soloturn commented 3 months ago

@soloturn I believe that this is because the Jenkins job on merging MovingBlocks/gestalt#141 failed, so I guess a new gestalt artifact with that change was never published to artifactory. I triggered a new jenkins run of gestalt's develop: https://jenkins.terasology.io/job/Libraries/job/Gestalt/job/develop/2 Let's see if that works and if it does and publishes the artifact, maybe you can retry.

created https://github.com/MovingBlocks/gestalt/pull/145 to change artifactory url to new one for gestalt.

soloturn commented 3 months ago

gestalt now got published, as snapshot, still same error here:

gradle --console=plain clean extractConfig extractNatives distForLauncher testDist

jdrueckert commented 3 months ago

@soloturn I cannot reproduce the issue you're seeing locally on my machine. Can you please check if your workspace is out of date or there are any other caching effects? If unsure, can you please test in a fresh workspace?

soloturn commented 3 months ago

@soloturn I cannot reproduce the issue you're seeing locally on my machine. Can you please check if your workspace is out of date or there are any other caching effects? If unsure, can you please test in a fresh workspace?

@jdrueckert what does this error message mean, and which part of the code calls what and why? when using --stacktrace one sees that this seems to be in gestalt. when i switch to develop branch the error is gone, switching to this pr branch it is there again. i deleted the gradle cache, did a git clean -xfd .

java.lang.NoSuchMethodError: 'int com.github.zafarkhaja.semver.Version.getMajorVersion()'
    at org.terasology.gestalt.naming.Version.getMajor(Version.java:90)
    at org.terasology.gestalt.module.dependencyresolution.DependencyInfo.getMaxVersion(DependencyInfo.java:86)
    at org.terasology.gestalt.module.dependencyresolution.DependencyInfo.versionRange(DependencyInfo.java:126)
    at org.terasology.gradology.ModuleMetadataForGradle.versionStringFromGestaltDependency(module_build.kt:69)
    at org.terasology.gradology.ModuleMetadataForGradle.gradleModule(module_build.kt:80)
    at org.terasology.gradology.ModuleMetadataForGradle.moduleDependencies(module_build.kt:65)
    at Terasology_module_gradle$4.invoke(terasology-module.gradle.kts:59)
    at Terasology_module_gradle$4.invoke(terasology-module.gradle.kts:53)
    at org.gradle.kotlin.dsl.ProjectExtensionsKt.dependencies(ProjectExtensions.kt:237)
    at Terasology_module_gradle.<init>(terasology-module.gradle.kts:53)
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
    at TerasologyModulePlugin.apply(TerasologyModulePlugin.kt:13)
    at TerasologyModulePlugin.apply(TerasologyModulePlugin.kt:6)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
soloturn commented 3 months ago

after merging andi switching over modules "inventory" and "furnishings" to feat/gestalt-8-upgrade for me the game compiles again, and gradle game exeuctes. when libs/teraNUI is present it crashes with the following exceptions:

21:12:59.449 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: ModuleTestingEnvironment-0.3.3-SNAPSHOT
21:12:59.531 [main] WARN  o.t.g.module.sandbox.APIScanner - Class not found

java.lang.ClassNotFoundException: org.terasology.engine.rendering.assets.mesh.MeshBuilder.TextureMapper
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at org.terasology.gestalt.module.sandbox.APIScanner.scan(APIScanner.java:54)
        at org.terasology.engine.core.module.ModuleManager.setupSandbox(ModuleManager.java:264)
        at org.terasology.engine.core.module.ModuleManager.<init>(ModuleManager.java:95)

21:12:59.652 [main] WARN  o.t.g.module.sandbox.APIScanner - Class not found
java.lang.ClassNotFoundException: org.terasology.furnishings.logic.trunk.package-info
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at org.terasology.gestalt.module.sandbox.APIScanner.scan(APIScanner.java:54)
        at org.terasology.engine.core.module.ModuleManager.setupSandbox(ModuleManager.java:264)

21:12:59.653 [main] WARN  o.t.g.module.sandbox.APIScanner - Class not found
java.lang.ClassNotFoundException: org.terasology.furnishings.logic.door.package-info
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at org.terasology.gestalt.module.sandbox.APIScanner.scan(APIScanner.java:54)
        at org.terasology.engine.core.module.ModuleManager.setupSandbox(ModuleManager.java:264)
        at org.terasology.engine.core.module.ModuleManager.<init>(ModuleManager.java:95)

21:13:03.145 [main] ERROR o.t.e.core.ComponentSystemManager - Failed to initialise system org.terasology.engine.logic.console.ConsoleSystem@3a13f663
java.lang.NullPointerException: Cannot invoke "org.terasology.nui.UIWidget.getClass()" because "root" is null
        at org.terasology.engine.rendering.nui.internal.NUIManagerInternal.addOverlay(NUIManagerInternal.java:496)
        at org.terasology.engine.logic.console.ConsoleSystem.initialise(ConsoleSystem.java:35)
        at org.terasology.engine.core.ComponentSystemManager.initialiseSystem(ComponentSystemManager.java:211)
        at org.terasology.engine.core.ComponentSystemManager.initialise(ComponentSystemManager.java:194)
        at org.terasology.engine.core.modes.StateMainMenu.init(StateMainMenu.java:67)
        at org.terasology.engine.core.TerasologyEngine.switchState(TerasologyEngine.java:606)
        at org.terasology.engine.core.TerasologyEngine.changeState(TerasologyEngine.java:588)
        at org.terasology.engine.core.TerasologyEngine.initializeRun(TerasologyEngine.java:427)
        at org.terasology.engine.core.TerasologyEngine.run(TerasologyEngine.java:414)

21:13:03.301 [main] ERROR o.t.engine.core.TerasologyEngine - Uncaught exception, attempting clean game shutdown
java.lang.NullPointerException: Cannot invoke "org.terasology.nui.UIWidget.getClass()" because "root" is null
        at org.terasology.engine.rendering.nui.internal.NUIManagerInternal.createScreen(NUIManagerInternal.java:371)
        at org.terasology.engine.rendering.nui.internal.NUIManagerInternal.createScreen(NUIManagerInternal.java:347)
        at org.terasology.engine.rendering.nui.internal.NUIManagerInternal.pushScreen(NUIManagerInternal.java:398)
        at org.terasology.engine.rendering.nui.internal.NUIManagerInternal.pushScreen(NUIManagerInternal.java:393)
        at org.terasology.engine.rendering.nui.internal.NUIManagerInternal.pushScreen(NUIManagerInternal.java:89)
        at org.terasology.engine.core.modes.StateMainMenu.init(StateMainMenu.java:74)

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000078
soloturn commented 3 months ago

when libs/TeraNUI is not present it starts up, JoshariasSurvival gets the following error:

21:32:31.052 [main] INFO  o.t.e.c.m.loadProcesses.RegisterMods - Activating module: WorldlyTooltip:1.3.0-SNAPSHOT
21:32:31.052 [main] INFO  o.t.e.c.m.loadProcesses.RegisterMods - Activating module: JoshariasSurvival:1.1.0-SNAPSHOT
21:32:31.083 [Thread-2] ERROR o.t.g.m.s.JavaModuleClassLoader - Denied access to class (not allowed with this module's permissions): org.terasology.gestalt.entitysystem.prefab.GeneratedFromRecipeComponent
21:32:32.712 [main] ERROR o.t.g.m.s.JavaModuleClassLoader - Denied access to class (not allowed with this module's permissions): org.terasology.gestalt.entitysystem.prefab.GeneratedFromRecipeComponent
21:32:32.728 [main] ERROR o.t.g.m.s.JavaModuleClassLoader - Denied access to class (not allowed with this module's permissions): org.terasology.gestalt.entitysystem.event.lifecycle.OnRemoved
21:32:32.729 [main] ERROR o.t.g.m.s.JavaModuleClassLoader - Denied access to class (not allowed with this module's permissions): org.terasology.gestalt.entitysystem.event.lifecycle.OnChanged
21:32:32.729 [main] ERROR o.t.g.m.s.JavaModuleClassLoader - Denied access to class (not allowed with this module's permissions): org.terasology.gestalt.entitysystem.event.lifecycle.OnAdded
21:32:35.861 [main] WARN  o.t.engine.core.internal.TimeBase - Delta too great (3096), capping to 1000
21:32:35.952 [main] WARN  o.t.e.p.serializers.PrefabSerializer - Prefab 'EdibleFlora:SeedCraftingRecipes' contains unknown component 'ListRecipes'
21:32:35.980 [main] WARN  o.t.e.p.serializers.PrefabSerializer - Prefab 'Behaviors:jobBuildBlock' contains unknown component 'Work'
21:32:36.122 [main] ERROR o.t.engine.core.modes.StateLoading - Error while loading org.terasology.engine.core.modes.loadProcesses.LoadPrefabs@66c58c03
java.lang.IllegalArgumentException: Unknown behavior node type set_speed
        at org.terasology.engine.logic.behavior.core.BehaviorTreeBuilder.createNode(BehaviorTreeBuilder.java:274)
        at org.terasology.engine.logic.behavior.core.BehaviorTreeBuilder.getCompositeNode(BehaviorTreeBuilder.java:224)
        at org.terasology.engine.logic.behavior.core.BehaviorTreeBuilder.deserialize(BehaviorTreeBuilder.java:146)
        at org.terasology.engine.logic.behavior.core.BehaviorTreeBuilder.deserialize(BehaviorTreeBuilder.java:48)
soloturn commented 3 months ago

with core gameplay, it shows lines of blocks

image

soloturn commented 3 months ago

core gameplay hammering looks like this

image

soloturn commented 3 months ago

the lines of blocks seem to be no regression, there before, also hammering was the same before, no regression. this screenshot is before the merge of gestalt-8.

image

soloturn commented 3 months ago

also flying trees were possible before, screenshot from before gestalt-8 merge.

image

jdrueckert commented 3 months ago

@soloturn as mentioned on Discord, next time please check back with us before just merging something - there might be reasons why we didn't merge yet.

for the rest you already noticed that it existed before-hand, I'll comment on them anyway