Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crashes on startup on M2 mac #687

Closed
hesselink opened this issue Sep 12, 2023 · 8 comments · Fixed by #689
Closed

Game crashes on startup on M2 mac #687

hesselink opened this issue Sep 12, 2023 · 8 comments · Fixed by #689

Comments

@hesselink
Copy link

What you were trying to do

I downloaded the game using Steam on macos 13.5.2 (M2 mac). Then I clicked Play.

What actually happened

After starting, nothing happens. Looking in the game directory, I found a crash log (see below).

How to reproduce

No response

Game version

2.1.0

Log details

com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdx-box2d64.dylib' for target: Mac OS X, 64-bit
        at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:120)
        at com.badlogic.gdx.physics.box2d.Box2D.init(Box2D.java:32)
        at org.destinationsol.SolApplication.<init>(SolApplication.java:132)
        at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:135)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/lw/33dwv_5s409dw0y3xy6_s71n0828yj/T/libgdx<MY_USER>/d01668c7/libgdx-box2d64.dylib
        at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:316)
        at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:116)
        ... 3 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/lw/33dwv_5s409dw0y3xy6_s71n0828yj/T/libgdx<MY_USER>/d01668c7/libgdx-box2d64.dylib
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2408)
        at java.base/java.lang.Runtime.load0(Runtime.java:785)
        at java.base/java.lang.System.load(System.java:2011)
        at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:322)
        at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:291)
        ... 4 more

Operating System

MacOS

Additional Info

No response

@hesselink hesselink added the bug label Sep 12, 2023
@Cervator
Copy link
Member

That's unfortunately due to being on an M2 (or M1 really) Mac :-( Thank you for including that information, that makes it very clear.

I'm not sure if there's a native lib ready for that OS flavor quite yet, but if there is then we might be able to fix it. @BenjaminAmos may be able to find out at some point 👍

@BenjaminAmos
Copy link
Contributor

We'll need to use at least libGDX 1.11 for macOS ARM support (changelog). We're currently on 1.9.14. Upgrades in the past have been fairly trouble-free, so it shouldn't be too difficult.

@BenjaminAmos
Copy link
Contributor

I've attempted to fix this with #689.

@hesselink
If you've got time then I'd appreciate if you could test the changes and let me know if they work. You can get a build of the game with the M1/M2 changes here. To start the game, run the solOSX.sh script.

@hesselink
Copy link
Author

@BenjaminAmos Thanks, that was quick! I've just tested it. There's a small typo in the shell script (an X missing from the jre directory name, I've commented on the relevant line). After fixing that, the game starts for me!

@lectricas
Copy link

any progress on this?

@BenjaminAmos
Copy link
Contributor

The changes I proposed apparently work, so I'll try and give #689 another test this week and see if I can merge them in. I can't test that it works personally but it should work after that. The project is very slowly maintained on my part at the moment, unfortunately.

@lectricas
Copy link

lectricas commented Nov 29, 2023

@BenjaminAmos I've copypasted everything from this into my project and it compiled and started.

But now the buttons are messed up and I can't press them. Can you move me into the right directinon where to dig in?

Screenshot 2023-11-30 at 02 05 51

@BenjaminAmos
Copy link
Contributor

I think you've just resized the game window to be too small. Can you make it a bit larger by dragging the window corners around?

Not being able to press the buttons at all is a bit concerning. Is the display using any sort of DPI scaling? There's some code that checks the display density on Android but I'm not sure if that code is used in the desktop build.

// Mobile screen densities can vary considerably, so a large digital resolution can be displayed
// on a very small screen. Due to this, it makes sense to scale the UI roughly proportionally
// to form a more sensible default. Otherwise, the UI may appear to be too big/small.
// On very large mobile screens, such as tablets, you may need to adjust the UI scale further in the game options.
if (solApplication.isMobile()) {
baseUIScale = Gdx.graphics.getDensity() / MOBILE_UI_DENSITY;
} else {
baseUIScale = 1.0f;
}

If all else fails, you can try to manually adjust the window size and scale by editing engine/src/main/resources/settings.ini. The x value is width and the y value is height. nuiUiScale is the UI scaling factor. I've previously found that 800x600 is the smallest playable resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants