exch-bms2 / beatoraja

Cross-platform rhythm game based on Java and libGDX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] mouse.setGrabbed may cause game suddenly lag

Merrg1n opened this issue · comments

Hello,
I use beatoraja 0.8.4 to play bms. My computer CPU is AMD Ryzen 5800X and GPU is NVIDIA Geforce RTX3070, I use Zulu OpenJDK 17.0.2 and I didn't change JVM options in the start.bat, I think my computer can run bearoraja on 4k and 480 fps prefectly, but it suddenly lag during play :(
So I test it with VisualVM 2.1.2 on Windows 10 21H2, and VisualVM show that mouse.setGrabbed use too much cpu time in renderer thread, here is the screenshot.
屏幕截图 2022-04-06 231847
I downloaded the source code and commented out this line, compiled a jar and test found it reduce the suddenly lag. I think this line may cause the game suddenly lag during play, but commenting out this line will break the function of hiding the mouse cursor.

I solved this problem by setting the java process priority to high, seems to be a problem of old version lwjgl.

commented

I solved this problem by setting the java process priority to high, seems to be a problem of old version lwjgl.

This doesn't fix mine, the sound does not stutter but the notes were frozen and warp (I used slow motion camera on phone captured what happened)
Happen few times per song