Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.64k stars 2.96k forks source link

Wrong size of UI on iPad #8626

Closed phoskee closed 1 year ago

phoskee commented 1 year ago

Platform: iOS

Build: 144.1

Issue: As the screenshot, the UI does not respect the actual screen size. Instead, the touch area works as it should

Steps to reproduce: Just open the app

Link(s) to mod(s) used: None

Save file: The (zipped) save file you were playing on when the bug happened. THIS IS REQUIRED FOR ANY ISSUE HAPPENING IN-GAME OR IN MULTIPLAYER, REGARDLESS OF WHETHER YOU THINK IT HAPPENS EVERYWHERE. DO NOT DELETE OR OMIT THIS LINE UNLESS YOU ARE SURE THAT THE ISSUE DOES NOT HAPPEN IN-GAME. IF YOU DO NOT HAVE A SAVE, DON'T WASTE TIME OPENING THIS ISSUE.

If you remove the line above without reading it properly and understanding what it means, I will reap your soul. Even if you're playing on someone's server, you can still save the game to a slot.

(Crash) logs:

last log:
[I] [GL] Version: GLES 2.0.0 / Apple Inc. / Apple M1 GPU
[I] [GL] Max texture size: 4096
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 0
[I] [RAM] Available: 214748364.7 GB
[W] Shader shaders/screenspace.vert | shaders/arkycite.frag:
Fragment shader:
WARNING: 0:34: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)
WARNING: 0:43: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/mud.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/tar.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/slag.frag:
Fragment shader:
WARNING: 0:30: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/cryofluid.frag:
Fragment shader:
WARNING: 0:31: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[I] [Mindustry] Version: 144.1
[I] [IOSApplication] resumed
[E] Failed to read schematic from file '/private/var/mobile/Containers/Data/Application/C3EECC5C-7281-4661-B40E-C2C71FBFD0B2/Library/local/schematics/1670566787748.msch'
[E] java.io.IOException: Not a schematic file (missing header).
    at mindustry.game.Schematics.read(Schematics.java:532)
    at mindustry.game.Schematics.read(Schematics.java:521)
    at mindustry.game.Schematics.loadFile(Schematics.java:138)
    at mindustry.game.Schematics.load(Schematics.java:84)
    at mindustry.game.Schematics.loadSync(Schematics.java:74)
    at arc.assets.AssetManager$2.loadSync(AssetManager.java:357)
    at arc.assets.AssetLoadingTask.handleAsyncLoader(AssetLoadingTask.java:117)
    at arc.assets.AssetLoadingTask.update(AssetLoadingTask.java:73)
    at arc.assets.AssetManager.updateTask(AssetManager.java:590)
    at arc.assets.AssetManager.update(AssetManager.java:439)
    at arc.assets.AssetManager.update(AssetManager.java:464)
    at mindustry.ClientLauncher.update(ClientLauncher.java:206)
    at arc.backend.robovm.IOSGraphics.lambda$draw$0(IOSGraphics.java:235)
    at arc.backend.robovm.IOSGraphics$$Lambda$1.run(Unknown Source)
    at arc.backend.robovm.IOSGraphics.runProtected(IOSGraphics.java:258)
    at arc.backend.robovm.IOSGraphics.draw(IOSGraphics.java:233)
    at arc.backend.robovm.IOSGraphics$1.draw(IOSGraphics.java:102)
    at arc.backend.robovm.IOSGraphics$1.$cb$drawRect$(IOSGraphics.java)
    at org.robovm.apple.uikit.UIApplication.main(Native Method)
    at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:433)
    at mindustry.ios.IOSLauncher.main(IOSLauncher.java:248)

[I] Total time to load: 1154ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Fetched 44 community servers.
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=970.0 h=1389.0
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed

Place an X (no spaces) between the brackets to confirm that you have read the line below.

Anuken commented 1 year ago

Which iPad model is this? I can't reproduce this on an iPhone.

phoskee commented 1 year ago

iPad Pro m1 11"

Nick-Miras commented 1 year ago

I'm also having this issue on an Ipad Air 5. IMG_0199

Anuken commented 1 year ago

@phoskee @Nick-Miras Is this a new bug? Did you have this issue in previous versions of the game?

phoskee commented 1 year ago

Happened after last update

Anuken commented 1 year ago

I can't reproduce this issue on an iPad simulator either, so I may need more logs.

Can either of you try installing Mindustry through TestFlight (here is the invite link) and sending me your logs if the issue is not fixed with that version?

EDIT: It seems the build will only become available on TestFlight once it is reviewed by Apple, which can take 1-2 days...

phoskee commented 1 year ago

Ok

Anuken commented 1 year ago

Should be available for testing now, use the link above. I got access to an iPad Air 5 device, and it doesn't happen there either, so something very strange is going on.

phoskee commented 1 year ago

App crash on startup Until the last update everything worked perfectly, I will take a look at the code between versions to see what changed

Anuken commented 1 year ago

Ugh, looks like some build cache issue, as it worked on a simulator right before deploying. Uploaded a fresh new build, try that now.

phoskee commented 1 year ago

No way, do you need anything? image

Anuken commented 1 year ago

Send me the game (crash) logs again. I know it's not a crash, but those include useful system logs.

phoskee commented 1 year ago
last log:
[I] [GL] Version: GLES 2.0.0 / Apple Inc. / Apple M1 GPU
[I] [GL] Max texture size: 4096
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 0
[I] [RAM] Available: 214748364.7 GB
[W] Shader shaders/screenspace.vert | shaders/arkycite.frag:
Fragment shader:
WARNING: 0:34: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)
WARNING: 0:43: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/mud.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/tar.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/slag.frag:
Fragment shader:
WARNING: 0:30: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/cryofluid.frag:
Fragment shader:
WARNING: 0:31: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[I] [Mindustry] Version: 144.2
[I] [IOSApplication] resumed
[I] Total time to load: 1041ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Fetched 44 community servers.
Nick-Miras commented 1 year ago

Still the same. IMG_0200 crash log

Was the IpadOs version on the Ipad Air 5 device that you used updated to version 16.5?

Anuken commented 1 year ago

@phoskee Can you try tabbing in and out of the game a few times, and sending logs again?

phoskee commented 1 year ago
last log:
[I] [GL] Version: GLES 2.0.0 / Apple Inc. / Apple M1 GPU
[I] [GL] Max texture size: 4096
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 0
[I] [RAM] Available: 214748364.7 GB
[W] Shader shaders/screenspace.vert | shaders/arkycite.frag:
Fragment shader:
WARNING: 0:34: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)
WARNING: 0:43: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/mud.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/tar.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/slag.frag:
Fragment shader:
WARNING: 0:30: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/cryofluid.frag:
Fragment shader:
WARNING: 0:31: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[I] [Mindustry] Version: 144.2
[I] [IOSApplication] resumed
[I] Total time to load: 1041ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Fetched 44 community servers.
[I] Attempting to share file /private/var/mobile/Containers/Data/Application/0FD655F4-ABDA-47AC-B7D1-27700944CF71/Library/local/tmp/logs.txt
[I] Success! Presented /private/var/mobile/Containers/Data/Application/0FD655F4-ABDA-47AC-B7D1-27700944CF71/Library/local/tmp/logs.txt
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] resumed
[I] Attempting to share file /private/var/mobile/Containers/Data/Application/0FD655F4-ABDA-47AC-B7D1-27700944CF71/Library/local/tmp/logs.txt
[I] Success! Presented /private/var/mobile/Containers/Data/Application/0FD655F4-ABDA-47AC-B7D1-27700944CF71/Library/local/tmp/logs.txt
Anuken commented 1 year ago

I've identified the problem, a new build with a possible solution should be up in about 30 minutes.

phoskee commented 1 year ago

What might be?

Anuken commented 1 year ago

There were no changes in the screen code, so I can only assume something happened when I updated XCode versions. The real mystery is why this was never a problem in earlier versions.

Your device reports the screen scaling factor as 1.7195877, but the framework I use assumes it to either be >= 2.0 (retina screen), or 1.0. Since this screen scaling factor is neither, everything breaks.

A new build is available now.

phoskee commented 1 year ago

I am trying 4235, nothing is changed logs show same scale

Nick-Miras commented 1 year ago

Still not working. logs 4.txt IMG_0201

Anuken commented 1 year ago

Can you try tabbing in and out again and sending logs?

phoskee commented 1 year ago
last log:
[I] [GL] Version: GLES 2.0.0 / Apple Inc. / Apple M1 GPU
[I] [GL] Max texture size: 4096
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 0
[I] [RAM] Available: 214748364.7 GB
[W] Shader shaders/screenspace.vert | shaders/arkycite.frag:
Fragment shader:
WARNING: 0:34: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)
WARNING: 0:43: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/mud.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/tar.frag:
Fragment shader:
WARNING: 0:27: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/slag.frag:
Fragment shader:
WARNING: 0:30: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[W] Shader shaders/screenspace.vert | shaders/cryofluid.frag:
Fragment shader:
WARNING: 0:31: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

[I] [Mindustry] Version: 144.2
[I] [IOSApplication] resumed
[I] Total time to load: 972ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Fetched 44 community servers.
[I] [IOSApplication] paused
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
[I] [IOSApplication] paused
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] Status bar is not visible
[I] [IOSApplication] Total computed bounds are w=1389.0 h=970.0 nativeScale=1.7195877 device=null
[I] Insets: [0, 0, 0, 34]
[I] [IOSApplication] resumed
Anuken commented 1 year ago

Dependency didn't update correctly it seems; released another build. This one really should work - if it does not, send logs again (after tabbing in and out.)

Nick-Miras commented 1 year ago

Fixed. Thank you! IMG_0202

Anuken commented 1 year ago

Great! I'll submit it for review as a production release. Thanks for testing.