battlecatsultimate / BCU-java-PC

battle cats ultimate, a fan-made battle cats emulator.
87 stars 72 forks source link

BCU can't access files on build #111

Closed Gootzi closed 5 months ago

Gootzi commented 5 months ago

Errors and fails to load JOGL shaders, animations, and language files.

BCU works completely fine on release builds, but on builds built with IntelliJ artifacts, they have file problems.

*could be a library issue? But I'm not certain which it could be.

MandarinSmell commented 5 months ago

You have to write class path properly, otherwise it won't work

Gootzi commented 5 months ago

I'll try that

Gootzi commented 5 months ago

Is this proper? image

MandarinSmell commented 5 months ago

For us, we used space separator for MANIFEST.MF file. I doubt it will bring any difference tho. However, considering BCU failing to load resource files, jar file may not contain resource files, and maybe that's the cause of problem. Also adding such class path means external libraries must be contained as jar files in said path, so make sure required files are all prepared properly

MandarinSmell commented 5 months ago

Check if resource folder is marked properly, and your artifact puts resource files together into jar file as well

Gootzi commented 5 months ago

Is it correct that the main jar has the manifest located in src\main\META-INF\MANIFEST.MF ? As shown. image

MandarinSmell commented 5 months ago

Errors and fails to load JOGL shaders, and language files.

This means jar file has failed to grab resource file, and this is what I just suggested above

animations,

It's obvious error that caused by shader not being loaded. BCU tries to create Program (glCreateProgram), and it will try to attach shader (glAttachShader) to it. Since jar file has failed to get shader file from resource, BCU will fail to create program, leading to crash

MandarinSmell commented 5 months ago

Is it correct that the main jar has the manifest located in src\main\META-INF\MANIFEST.MF ?

We have put it in ./src/META-INF/ folder. It's due to wonky behavior or IntelliJ IDEA, what it puts as default is ./src/resources/META-INF/

Gootzi commented 5 months ago

Okay. I would also like to know: is src\main\resources the right spot to set resource folder?

MandarinSmell commented 5 months ago

Yes, that's where IDEA project initializer creates as default

Gootzi commented 5 months ago

The resource files are in the root directory of the jar: these ones. image

JAR contents: image

MandarinSmell commented 5 months ago

If jar file still shows error, at least it should have created error log in logs folder. Read stacktrace in there. There's not much that we can help now

Gootzi commented 5 months ago

The classpath only includes files from BCU_lib. Could that be a classpath issue?

MandarinSmell commented 5 months ago

class path is group of paths that jar file can link other classes to. It's used for connecting separated 3rd party libraries (as form of jar file) into main jar file. It doesn't perform more job than that

Gootzi commented 5 months ago

Ah..... I don't think it's within my ability or my IDE's ability to solve this, so..

Gootzi commented 5 months ago

Fixed it. Something was wrong, no idea what, but cloning it without the terminal worked