Quillraven / MysticWoods

A small RPG example for a YouTube tutorial series using Kotlin, LibGDX, LibKTX and GDX-AI.
https://quillraven.github.io/MysticWoods/
45 stars 4 forks source link

Night mode not rendered correctly #5

Closed omkar-tenkale closed 10 months ago

omkar-tenkale commented 10 months ago
image

Seems like the night mode layer is not placed correctly over main game It gets updated as player moves but its just not sized correctly

I'm running the project on mac in intellij with extra VM argument -XstartOnFirstThread as without it game wont launch with this error

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1046)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:88)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:138)
    at com.github.quillraven.mysticwoods.lwjgl3.Lwjgl3Launcher.main(Lwjgl3Launcher.kt:11)
    at com.github.quillraven.mysticwoods.lwjgl3.Lwjgl3Launcher.main(Lwjgl3Launcher.kt)
Caused by: java.lang.IllegalStateException: GLFW may only be used on the main thread and that thread must be the first thread in the process. Please run the JVM with -XstartOnFirstThread. This check may be disabled with Configuration.GLFW_CHECK_THREAD0.
    at org.lwjgl.glfw.EventLoop.<clinit>(EventLoop.java:30)
    ... 5 more
Quillraven commented 10 months ago

Seems to be a Mac issue? Can you try the latest Gdx-liftoff version for your project setup? There are always some fixes for MacOS which might fix your problem.

Otherwise, I suggest to play around with the RayHandler rendering. Since it works on my end I cannot really help with debugging, sorry.

Quillraven commented 10 months ago

One more thing comes to my mind. Can you try the browser version please? It should look like this: image

Link: https://quillraven.github.io/MysticWoods/

If it doesn't look like this then one reason could also be your resolution. From what I remember LibGDX has some issues with very big resolutions. I myself have 1440p.

edit: also try to debug if you are entering the resize method of the GameScreen correctly and if the proper width and height are passed to that method. Because this method is responsible for resizing the rayhandler.

omkar-tenkale commented 10 months ago

Its working fine on browser, so maybe there's something wrong with Lwjgl3Application I'm not able to do proper debugging at this moment, as i'm still learning libgdx and exploring this repo following the tutorials, so hoping to come back to this later.