[Android] Tiles (Quads?) rendering problem on some android devices

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
ohai
Prole
Posts: 20
Joined: Thu Jan 21, 2021 9:06 pm

[Android] Tiles (Quads?) rendering problem on some android devices

Post by ohai »

Hi everyone!

I recently posted my android game in "Games and Creations". In there, user darkfrei posted a problem with the game. I tried to reproduce it on my side, but unfortunately I don't own many devices, and everything works fine on PC, my and my friends devices, android emulators on multiple android versions and screen sizes. I know that on bluestacks it's fine, and only tried android studio's x86 images using liko-love, because official android love release doesn't support x86, and emulated arm images are so slow that adb times out trying to install the app. Because I couldn't reproduce it, I decided to put it aside and hoped that it's a one-off with this particular device (darkfrei said it's Lenovo yoga tab 3 10).

Unfortunately, I recently got informed by another person, that he has this same exact problem. He provided me with a screenshot (attached to the post) very similar to darkfrei's. He says he uses Cloudfone Excite Prime with android 5.1. Because I'm kinda out of options, I'm asking for your help.
I have a theory that it has something to do with older android versions, because both problematic devices are a bit old. As I said I couldn't reproduce it on x86 emulators of those older versions, but I guess it's no surprise that the problem only occurs on physical/arm devices.

It seems very strange to me that the everything else besides the level itself renders correctly. The only thing that seems to be unique to the tile rendering is the usage of quads. Here is my related code:
First, I take the tilemap image and cut it into adequate quads (quadMargin is used to avoid tile bleeding):

Code: Select all

  for i = 0, tileset.tilecount - 1 do
    local x = (i % tileset.columns) * tileset.tilewidth
    local y = math.floor(i / tileset.columns) * tileset.tileheight
    quads[i + 1] = love.graphics.newQuad(x + quadMargin, y + quadMargin,
      tileset.tilewidth - quadMargin - quadMargin,
      tileset.tileheight - quadMargin - quadMargin, tilemap:getDimensions())
  end
Then, I render it like this (1.035 scale is used because of quadMargin):

Code: Select all

  for j = 0, self.height - 1 do
    local y = j * self.tileHeight
    for i = 1, self.width do
      local x = (i - 1) * self.tileWidth
      local tile = layer[(j * self.width) + i]
      if tile > 0 then
        love.graphics.draw(self.tilemap, self.quads[tile], x, y, 0, 1.035)
      end
    end
  end
I don't use any custom shaders for drawing this, the only shader in the entire game is used to create the "tongue wiggle", and it seems it renders fine even on those older devices.
Is there anyone who experienced similar problems on android? Or do you maybe see something I'm doing wrong that could be architecture/device/platform-dependent?

Sorry for the wall of text. If you ploughed through and read it all - thank you already. I'll be grateful for any sort of help, because the only alternative for me is to cut out older android support (5.1 at least).
Attachments
Screenshot_2021-01-28_204144.jpg
Screenshot_2021-01-28_204144.jpg (130.77 KiB) Viewed 3869 times
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: [Android] Tiles (Quads?) rendering problem on some android devices

Post by grump »

Tileset image dimensions may be too large for the device, which would result in clamped pixels on affected quads.

love.graphics.getSystemLimits().texturesize is the maximum texture size.
User avatar
ohai
Prole
Posts: 20
Joined: Thu Jan 21, 2021 9:06 pm

Re: [Android] Tiles (Quads?) rendering problem on some android devices

Post by ohai »

grump wrote: Thu Jan 28, 2021 4:22 pm Tileset image dimensions may be too large for the device, which would result in clamped pixels on affected quads.

love.graphics.getSystemLimits().texturesize is the maximum texture size.
Holy maccaroni I think you are right. Tileset image for my first world is kinda huge...
Thank you very much!
Post Reply

Who is online

Users browsing this forum: No registered users and 226 guests