Player icon indicating copy to clipboard operation
Player copied to clipboard

Yume2kki: Instant Pan not working

Open coinsandboins828626 opened this issue 4 years ago • 7 comments

Name of the game:

Yume 2kki (recent version)

Player platform:

Android

Attach files (as a .zip archive or link them)

Save01.zip easyrpg_log[1].txt

Describe the issue in detail and how to reproduce it:

Specific to Android, Yume 2kki will crash in a few places while playing. The first is when entering Urotsuki's Dream Apartments from the black door in the Nexus, or entering that specific map from any other location. The next is when visiting the Witch's Room in Jigsaw Puzzle World. Finally, there is one more that occurs deeper in the game, when interacting with an NPC that would teleport you somewhere. Usually it goes like this: You enter another map, the new music will play for a bit with the screen still black, and then the game will crash without any error message whatsoever, going back to the game selection screen. The DreamApartments one is probably the easiest to reproduce, just sleep, go to the Nexus, and enter the black door and it should crash. It hasn't always been like this, though, I remember some versions ago it worked just fine, and I had no troubles. However, this was just for the Dream Apartments, I'm unsure how long the other two have been around.

coinsandboins828626 avatar Jul 21 '21 18:07 coinsandboins828626

IIRC I had the same problem with it crashing on Android just before entering the Vending Machine Factory, to make things easier I made a debug save just before the Vending Machine Factory, one before the Dream Apartments, and because I didn't know if by Witch's Room you meant the room with the witch in it or the room the witch was guarding I made saves just before both lol.

potentially crashes on android 2kki saves.zip

Hope this helps the devs

(Saves made in version 0.116 of 2kki running on EasyRPG Player version 0.6.2.3)

EDIT: Tested this on a Motorola e6 phone, all 3 areas in the saves I provided crash, I wonder if these areas work on a stronger phone?

EDIT2: Just to be sure this bug(?) isn't already fixed in master I retested on a contiuous build of EasyRPG Player I downloaded today, still crashes when entering those 3 areas on Android.

purupurupuruin avatar Jul 21 '21 20:07 purupurupuruin

This doesn't crash on Linux but UBSAN reports:

game_player.cpp:754:24: runtime error: shift exponent 53 is too large for 32-bit type 'int'

Ghabry avatar Jul 22 '21 14:07 Ghabry

Yeah this crashes on a 32bit Android (armeabi-v7a) but survives on aarch64

I/DEBUG   (  150):          #00  pc 00017804  /system/lib/libc.so
I/DEBUG   (  150):          #01  pc 0001ed6c  /system/lib/libc.so (__assert2)
I/DEBUG   (  150):          #02  pc 00354de0  /data/data/org.easyrpg.player/lib/libmain.so (_ZN11Game_Player10GetPanWaitEv)
I/DEBUG   (  150):          #03  pc 0032bbc2  /data/data/org.easyrpg.player/lib/libmain.so (_ZN20Game_Interpreter_Map16CommandPanScreenERKN3lcf3rpg12EventCommandE)
I/DEBUG   (  150):          #04  pc 0032a84a  /data/data/org.easyrpg.player/lib/libmain.so (_ZN20Game_Interpreter_Map14ExecuteCommandEv)
I/DEBUG   (  150):          #05  pc 0031904a  /data/data/org.easyrpg.player/lib/libmain.so (_ZN16Game_Interpreter6UpdateEb)
I/DEBUG   (  150):          #06  pc 00338bf4  /data/data/org.easyrpg.player/lib/libmain.so (_ZN8Game_Map22UpdateForegroundEventsER21MapUpdateAsyncContext)
I/DEBUG   (  150):          #07  pc 00338494  /data/data/org.easyrpg.player/lib/libmain.so (_ZN8Game_Map6UpdateER21MapUpdateAsyncContextb)
I/DEBUG   (  150):          #08  pc 003ed4ba  /data/data/org.easyrpg.player/lib/libmain.so (_ZN9Scene_Map12UpdateStage1E21MapUpdateAsyncContext)
I/DEBUG   (  150):          #09  pc 003ed346  /data/data/org.easyrpg.player/lib/libmain.so (_ZN9Scene_Map6UpdateEv)
I/DEBUG   (  150):          #10  pc 00396800  /data/data/org.easyrpg.player/lib/libmain.so (_ZN6Player6UpdateEb)
I/DEBUG   (  150):          #11  pc 003d71de  /data/data/org.easyrpg.player/lib/libmain.so (_ZN5Scene12MainFunctionEv)
I/DEBUG   (  150):          #12  pc 00395e54  /data/data/org.easyrpg.player/lib/libmain.so (_ZN6Player8MainLoopEv)
I/DEBUG   (  150):          #13  pc 00395d0c  /data/data/org.easyrpg.player/lib/libmain.so (_ZN6Player3RunEv)
I/DEBUG   (  150):          #14  pc 00375dca  /data/data/org.easyrpg.player/lib/libmain.so (SDL_main)
I/DEBUG   (  150):          #15  pc 0002d318  /data/data/org.easyrpg.player/lib/libSDL2.so (Java_org_libsdl_app_SDLActivity_nativeRunMain)

And crashes here because speed is 0:

return distance / speed + (distance % speed != 0);

Ghabry avatar Jul 22 '21 15:07 Ghabry

Simplest solution is replacing 2 << speed with 2 * (speed + 1). This gets rid of the overflow and will simply accept this crap.

Ghabry avatar Jul 22 '21 15:07 Ghabry

Sorry my solution is nonsense, the value is also totally wrong xD

The problem here is that this overflows the integer, so this should be sanitized.

Ghabry avatar Jul 22 '21 16:07 Ghabry

I will add a temporary patch that clamps the values but keep this here open and rename it to remind us to that the RPG_RT behaviour must be checked.

Ghabry avatar Jul 22 '21 17:07 Ghabry

This crash affected 7 users 20 times in the last 60 days on Android (according to crash reporting, ARM64 does not crash which would explain why almost nobody noticed this)

Ghabry avatar Jul 28 '21 13:07 Ghabry