Tileset Gaps on Android

Hi, everyone!

Does anyone have a fix for the gap issue in tilesets when you deploy MZ games to Android?
In MV I was able to fix it setting "canvas" rendering in Community_Basic.js plugin.

I noticed that SceneManager.preferableRendererType method doesn't exist anymore in MZ rpg_managers file.

These following screen captures were taken from my real Android device (Samsung S7).

Spoiler: Img1
Screenshot_20210925-153614.jpg
Spoiler: Img2
Screenshot_20210925-153723.jpg


I'll apreciate any support from you guys!
It looks like it's only happening on that tree. Are you sure it's not something in the B tileset? Are you using ALL default tilesets or have you added your own images or edited the existing ones?

this doesn't happen when you playtest?
It looks like it's only happening on that tree. Are you sure it's not something in the B tileset? Are you using ALL default tilesets or have you added your own images or edited the existing ones?

this doesn't happen when you playtest?
Yes, I noticed that happens with all the trees...

After create a new game, I just spread some trees / grass on the map and deployed to web.

Like the issue is ocurring with images over each other. The tileset is the default RTP.
Playtest on Windows and Chrome by XAMPP (localhost) are all fine.

Seems like the webview on Android have problems to work with WebGL. I always have to change to canvas on MV because of these gaps between tiles.

I'm out of ideas to work around with MZ, except if I change to parallax that increases the size of the project.
I don't have a solution but can confirm that this issue can be replicated.

I have the same problem but my understanding is that they removed Android support when rolling out MZ. The touchscreen support works great though and getting an MZ game to run in a mobile browser is better than I expected. Anyways, I hope the info helps and best of luck as you seek a solution!

Spoiler: SAMPLE: Lines with mobile play
1632626531841.png
I've seen this problem in games made with HTML5 without using Rpg Maker. This issue may vary from WebView and Smartphone resolution.

I don't really remember the parameters I used to solve this, but it's almost certain that I changed the INDEX.HTML viewport.

Include metatag on index.html:
HTML:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, minimal-ui" />
Or:
HTML:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />

If none of this works, change the user-scalable=no to "yes" and try to zoom in or out with two fingers touching the screen.

I'm currently getting an android device to test.
I may have found the solution! It worked for me in this project.

If you could test it, @Quexp , will save me some time in other projects deployment.

The change is in Main.js file:

onEffekseerLoad() {
this.eraseLoadingSpinner();

PIXI.settings.RENDER_OPTIONS["height"] = 624;
PIXI.settings.RENDER_OPTIONS["width"] = 816;
PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH;


SceneManager.run(Scene_Boot);
}

Just before Scene_Boot, add these 3 lines of PIXI settings. In my case, the project resolution is 816x624 (default RPG Maker MZ).
The original width and height was 800x600. Oddly, even on Android emulation the bug wasn't occuring.

The lines are gone, finally! I found this tip on the following link (from ivanpopelyshev):
https://github.com/pixijs/tilemap/issues/16

I'll make some more tests and tell you if it's a permanent solution.

Thanks!
I tried the above suggestions but no change. It was worth a try though! My game is set for 624x846, on Itch, but tried the 816 width to see what'd happen. No luck. That link was interesting though. Thanks for sharing!

I'm happy enough as I'll be targeting Windows users but hit me up if you need anything else tested. 🙂
I'm using Android 5, I created an APK with any game I downloaded from RMMZ and the problem doesn't happen, I don't know if it's because the WebView was updated:

If anyone has a game hosted on GameJolt or Itch.io and can pass the link I can test it to try to understand the cause of the problem.
@Dev_With_Coffee - here's mine. I'll see if I can find other MZ in-browser games to see if they have it too.

Edit:
- Here's another in case it helps.
- This one seems to be okay too.
Indeed it's a device issue, @Dev_With_Coffee .
On my device (Samsung S7 - Android 8.0.0) the glitch was gone with those PIXI settings.
As far as I learned, it may be related with the interpolation when scaling the tiles to the device screen. It's frustrating to not know if the current PIXI setting will affect other Android environments.

I tried to add the 3 lines of code to my other MV projects and it worked, again, on my device.

@Quexp , I recommend you to play with the PIXI settings. I found the following documentation with new tips:

// Use the native window resolution as the default resolution
// will support high-density displays when rendering
PIXI.settings.RESOLUTION = window.devicePixelRatio;

// Disable interpolation when scaling, will make texture be pixelated
PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;
Link: https://pixijs.download/dev/docs/PIXI.settings.html

I think it's possible to include these settings as a plugin for changing in-game by the user in case of damaged images.

As my problem is solved, the thread may be closed.
It's up to you keep this thread open until a solution that covers everyone's glitches.

Thanks to all of you!
YAY - I'm glad you got your game working! Congrats. Thanks for sharing your resolution too. 🙂
@sateliteixeira I did the test on a virtual Android 5.0 and a device "Samsung S4 (GT-I9515)", none had the problem, when I saw this problem it was before updating the WebView but I can't guarantee.

@Dev_With_Coffee - here's mine. I'll see if I can find other MZ in-browser games to see if they have it too.

Edit:
- Here's another in case it helps.
- This one seems to be okay too.
I will test it on Android 10 and 11 as soon as possible.
Hmm, I'm curious so see if I can update Webview.

EDIT: Updated, no luck. Also tried Beta and Canary versions with no success. If you want, I can try more PIXI settings later. It wouldn't be until tomorrow though.

Also, no need to rack your brain over it unless you're doing it for yourself or the community. 🙂
The problem is known and if you know where it comes from you can even replicate it on a PC.

Basically those lines are an artefact of the engine having problems with a screen size that is not a multiple of the grid size. If the screen size is slightly larger than the mapgrid, some tiles get randomly spaced that way because the engine tries to fill the screen to fit the tiles on both sides.

The usual solution on the PC is something you probably have read multiple times: make the screen size a multiple of the grid size (48x48), that is where those numbers come from.

I assume that some android devices have problems with unusual screen sizes and force the default sizes on their games. And then it depends on the device if the correct but unusual screen sizes can be forced in to prevent the effect.
That makes sense!

This has been an interesting thread and I learned a few extra things from you guys too.
Also, no need to rack your brain over it unless you're doing it for yourself or the community. 🙂
It's for the community and out of curiosity.

not a multiple of the grid size
This makes perfect sense, I saw this in WebBrowser games made with older API's that were placed inside IFRAMEs, so I deduced that it would be the invisible scrollbar that would be breaking the screen.
The strange thing is that RMMV does not seem to happen and so it is assumed that in RMMZ this would also be "fixed" or adapted.
I made new tests and the only thing I needed to work properly is PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH; before Scene_Boot in main.js file.

My device's resolution screen is 2560x1440 and my game's resolution is 848x480 (for bigger sprites on the screen).

Funny because I tried to emulate the glitch with a resolution not been multiple of 48 pixels (tile measure). Even so, the glitch is gone.

I'm building an APK file on Android Studio with WebView in fullscreen. Was good to know that the glitch occurs in webpages also.

My Android System WebView is deativated on the device and Chrome version is 94.0.4606.61 on the app info.

Android devices, man... What a pain!
I made new tests and the only thing I needed to work properly is PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH; before Scene_Boot in main.js file.

My device's resolution screen is 2560x1440 and my game's resolution is 848x480 (for bigger sprites on the screen).

Funny because I tried to emulate the glitch with a resolution not been multiple of 48 pixels (tile measure). Even so, the glitch is gone.

I'm building an APK file on Android Studio with WebView in fullscreen. Was good to know that the glitch occurs in webpages also.

My Android System WebView is deativated on the device and Chrome version is 94.0.4606.61 on the app info.

Android devices, man... What a pain!
I had already given up hope of fixing this problem. Thanks for sharing!
This thread helped me solve my problem. However, there's a new problem with my mobile version. Every time the map loads, it "freaksout" for 1 second before it looks right. Here's a screen shot of the map freaking out before it jumps back to normal. It's not a big issue but it makes the app look very un trust worthy.
Screenshot_20220319-230419_Monster Hunters Frost Giant.jpg
Screenshot_20220319-230305_Monster Hunters Frost Giant.jpg
I made new tests and the only thing I needed to work properly is PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH; before Scene_Boot in main.js file.

My device's resolution screen is 2560x1440 and my game's resolution is 848x480 (for bigger sprites on the screen).

Funny because I tried to emulate the glitch with a resolution not been multiple of 48 pixels (tile measure). Even so, the glitch is gone.

I'm building an APK file on Android Studio with WebView in fullscreen. Was good to know that the glitch occurs in webpages also.

My Android System WebView is deativated on the device and Chrome version is 94.0.4606.61 on the app info.

Android devices, man... What a pain!


Thank you for the solution. After all this time, have you noticed any negative side effects? Do you add the line only for Android export or do you leave it in the project overall? During my short testing on Windows, I didn't notice any issues, but I've only been using MZ for 2 days.

btw this is my code now for android using VisuStella MZ for testing

JavaScript:
    onEffekseerLoad() {
        this.eraseLoadingSpinner();
        PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH;
        SceneManager.run(Scene_Boot);
    }

Original thread: https://forums.rpgmakerweb.com/threads/tileset-gaps-on-android.140779/