Cannot change strategy of configuration

elwis

New Member
Hi there,
I just forked and tried to build Terasology. However, I run into problems at once, I tried both my Fedora25 machine and my Windows10. Is it my Gradle version?

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\GameSrc\Terasology\facades\PC\build.gradle' line: 257

* What went wrong:
A problem occurred evaluating project ':facades:pC'.
> Cannot change strategy of configuration ':facades:pC:runtime' after it has been resolved.

Regards
 

oniatus

Member
Contributor
Architecture
Try to run the gradle commands with the gradlew script. I had the same issue when using my local (newer) gradle installation :
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Yep most likely that's Gradle version level. Always use "gradlew" :)

I believe Gradle 3 breaks with some of our existing edge cases for functionality. Something we need to update before we can upgrade.
 

elwis

New Member
So, now I'm getting closer. Better fire this one up in IntelliJ :)

Caused by: javassist.NotFoundException: org.terasology.rendering.nui.layers.ingame.inventory.
In v
entoryGrid
at javassist.ClassPool.get(ClassPool.java:452)
at org.terasology.module.sandbox.ModuleClassLoader$1.run(ModuleClassLoader.java:145)
at org.terasology.module.sandbox.ModuleClassLoader$1.run(ModuleClassLoader.java:142)
at java.security.AccessController.doPrivileged(Native Method)
at org.terasology.module.sandbox.ModuleClassLoader.findClass(ModuleClassLoader.java:1
42)
... 19 common frames omitted
09:41:01.556 [main] INFO o.terasology.engine.TerasologyEngine - Shutting down Terasology...
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Interesting. Javaassist is related to our deep dark Java secrets, but doesn't often get noticed (all the magic tends to stay behind the curtains).

Is there anything else higher in the log files? Sometimes it can be good to have the whole thing available, like attached to a post here or linked on Pastebin.

Anything at all unusual about your Java version or setup?
 

elwis

New Member
Oh my, it was not my intention to go where no mortals are supposed to go, deep down in the secret chambers of Javaassist.. I promise ;)

Well since I know nothing about Terasology (yet)I might be doing something completely stupid. I did find some modules to install and then I did what I found in some long forgotten wikipage, I ran this one:
[elwis@fedora25 Terasology]$ ./gradlew -PworldGen="WoodAndStone:throughoutTheAges" -PextraModules="AlterationEffects,AnotherWorld,An
otherWorldPlants,ClimateConditions,CopperAndBronze,Core,Crops,Fences,Fluid,Genome,GrowingFlora,Hunger,Journal,MarkovChains,MultiBloc
k,PlantPack,NameGenerator,Seasons,StructuralResources,ThroughoutTheAges,WoodAndStone,Workstation" server


My Java :
[elwis@fedora25 godotprojects]$ java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b16)
OpenJDK 64-Bit Server VM (build 25.111-b16, mixed mode)
[elwis@fedora25 godotprojects]$


The first ERROR in the log are this one:
21:09:40.388 [main] ERROR o.terasology.engine.TerasologyEngine - Uncaught exception, attempting clean game shutdown
java.lang.NoClassDefFoundError: Lorg/terasology/rendering/nui/layers/ingame/inventory/InventoryGrid;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)


I haven't had the time to dwelve deeper in IntelliJ but hopefully I will in the weekend when all the bread & butter coding is done.
Thanks for helping!
 
Last edited:

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Weekend is good, there is no rush, we'll be here :)

You have picked starting with a pretty complex approach, and it may indeed be somewhat out of date. You're also running a command meant to launch a headless server from source including a pile of extra config :D

What happens if you simply run the "TerasologyPC" run configuration you should have in IntelliJ after loading the generated Terasology.ipr you get from "gradlew idea" ? Or if you run via pure Gradle using "gradlew game" ?
 

elwis

New Member
So, I really did something completely stupid then :)
Well "./gradlew game" got me to the main menu, looks nice (but that dropdowncontroller is partly hidden by the buttons at least on Fedora).

However, pushing play got me back to the same old error about the missing inventorygrid, is the module the problem?
http://pastebin.com/cUcDJ5gR

Would be nice to take a closer look at the sourcecode and see what kind of fun I could do with this codebase.
Regards
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
You still have extra modules enabled (possibly stored from the last time you tried via command line). I can spot the "Throughout the Ages" world generator plus see "AnotherWorld" in the log snippet. Again though, better to submit the whole log, there is all kinds of nice diagnostic logging earlier (you can look through it and erase the path to your user directory, that's really the only bit of potentially sensitive info)

If you were to switch the gameplay template to any other entry it'll "reset" and only go with the modules required for the template. Try out "Core" for the basics or "JoshariasSurvival" for something a bit more advanced but better maintained :)

Alternatively you can delete your config.cfg - that might be a good idea anyway as it helps start clean. When running from source it should generate in the workspace root directory.

As for the OpenJDK vs Oracle JDK mention (I think that was somewhere - long day) then that's still bizarre. But I wonder if it happens with a minimal module set?
 

elwis

New Member
Ah, I'll do some cleaning then, it will probably help. My problem with the default startup was complaint about not having a world generator but I'll try the "JoshariasSurvival". Clean and simple makes debugging easier :)

Thanks again - pizza's on me!
 

elwis

New Member
Finally.. some time to play. So I removed the config.cfg and did a fersh "gradlew game" command. But what kind of modules do i need to play a "CORE" game? There are no world genarators available it says so I can't create any single player game.
I wasn't able to try "JoshariasSurvival" since it required "Thirst" which wasn't avialable. The only one that allows me to even try to start a game is "Throughout the ages", I'm definitely missing something regarding the architechture here, better peek at in IntelliJ i suppose.
 

Isaac

New Member
Contributor
World
GUI
If you're missing any world generators, it might be a good idea to rebuild the project once using "gradlew jar" before running "gradlew game".

As for the missing dependencies, strange as "gradlew" should have downloaded what was required. Could you also try to download the Thirst module manually using "gradlew fetchModuleThirst" and see if those solves the problem? (You can fetch any module using "gradlew fetchModuleNameOfModule")

Sidenote: JoshariasSurvival is an exciting module that contains many more advanced gameplay mechanics but you could also start with just the Core Gameplay template first to get a hang of Terasology :)
 
Last edited:

elwis

New Member
Oh yes.. of course.. now I finally have som worldgenerators, that did the trick for sure. Huge thanks! Now I'll examine the game and have a look at the code and see if I can develop some weird module for this.
 
Top