How do I reduce tile background size or rescale? Game crashes because sprite bigger than 4096 pixel

0 favourites
  • 11 posts
From the Asset Store
Vintage steam pixels for your UI! 125 unique assets in a single pack!
  • I'm making an endless runner and to get around having to make multiple objects as backgrounds, background elements, like trees, clouds, are painted onto the tiled background.

    The exported png size isn't big, it's like 5.8 kb, but the pixel size is 480 by 4270, so it crashes. I know.

    But is there an alternative that I can reduce the pixel size while using tiled backgrounds and making sure it scales to 480 by 4270? Or bad practice and I need to find an alternative solution?

  • Tiled background is the way to go, and preferred practice. Have you tried reducing the width to 4096 as suggested by Construct?

  • Tiled background is the way to go, and preferred practice. Have you tried reducing the width to 4096 as suggested by Construct?

    oosyrag I did try that, and yeah it works. The game is intended to be an android app, and normal playing works. But let's say the player goes to another app to do something very quickly, like reply in a messaging app. When going back to the game, the app freezes and crashes.

    I have 2 levels so far, level one is 480 x 1708 which works flawlessly, and I experimented with 480 x 2562. Which crashes upon going to do something else on the phone.

    Level 3 is even bigger at 480 x 4270 which doesn't work.

    That's why I'm wondering if I can reduce the pixel size while retaining the same general image, of the ... image.

    Because the Tiled Background scales to the size of the image, which i set to be the 9:16 screen size or 480 x 854. I can't make it smaller, since it won't fit the screen.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Are you painting the entire level inside the specified width of a tiled background? That doesn't do anything, the point of a tiled background is that it's supposed to tile and repeat with little to no overhead, so you can have an infinitely wide tiled background as long as the repeating texture is less than 4096.

  • Are you painting the entire level inside the specified width of a tiled background? That doesn't do anything, the point of a tiled background is that it's supposed to tile and repeat with little to no overhead, so you can have an infinitely wide tiled background as long as the repeating texture is less than 4096.

    oosyrag Yes I'm painting the level within the width of the tiled background. The game is about dodging and catching bullet objects, so the tiled background, serves as a vista that endlessly repeats.

    I tried with moving sprites for background management, but there was always a small white gap that I couldn't figure out how to remove, so I went with the Tiled Backgrounds instead.

    The problem is now that the texture size is too big. I guess I need to go back to the sprite method : (

  • If it's repeating anyway, why do you have to have the base texture over the limit? Just scale it down.

  • If it's repeating anyway, why do you have to have the base texture over the limit? Just scale it down.

    oosyrag

    Because it has to. I don't know any other way to make the backgrounds look like the way I want it too, to work within a way I can make it work.

    drive.google.com/drive/folders/1osSzHnduqW3tj-A3trWNbSUH_JmnTHOD

    link to my background art and simple construct file.

  • There is a image transform, scale x and y in the tiled background properties you might have missed, I think that's what you want.

    Then make the base texture half as large pixel wise, but scale 200%.

  • There is a image transform, scale x and y in the tiled background properties you might have missed, I think that's what you want.

    Then make the base texture half as large pixel wise, but scale 200%.

    oosyrag

    Yeah, this is what exactly I am looking for! Thank you! I scaled my tiled backgrounds by 50 percent, then re-upscaled in construct using 200%!

    Btw, another random question. When I started using construct, I used to get warnings about not going beyond 2048 pixels for sprites and textures. Now 4096 is the limit.

    Is it still recommended to go below the 2048 limit or going in-between 2048 and 4096 is okay?

  • Here is an old but still relevant tutorial from Ashley:

    construct.net/en/blogs/construct-official-blog-1/remember-not-waste-memory-796

  • Btw, another random question. When I started using construct, I used to get warnings about not going beyond 2048 pixels for sprites and textures. Now 4096 is the limit.

    Is it still recommended to go below the 2048 limit or going in-between 2048 and 4096 is okay?

    Several years ago there were still a few percent of devices in use that only supported a maximum texture size of 2048, so going over that could cause issues on those devices. However by now basically all those devices have fallen out of use and 4096 can now be relied upon to work universally, and we updated Construct accordingly. In several more years we might be able to go to 8192 or 16384, but it depends how much longer devices that only support 4096 remain in use.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)