Question for math expert in image formats and Memory

  • Hi i was thinking about how to construct my game level for best eficiency and performance on mobile phones. My game ground(floor) is only black, 100% black. The resolution of each tile is about 1280*300 pixels(not a squares but shapy bezier floor. Well but it look it is waste of memory if the tile is only black and the resolution is so big. so i was trying to find way how to put the level together with using only one black pixel, but then it would take me ages to recreate the shape of the tile with only one black pixel. So it would be super great if exists some plugin that will copy one pixel over the shape of the tile. Anyone experienced such thing?

  • ex32

    Your 1280x300px image could be being decompressed to 2048x2048 which takes up 16MB in memory, if you got the biggest dimension down to 1024, then it might only take up 4MB which is a huge saving ... our-memory

    Another way would be to use a TileMap

    Take a look at the example here from R0J0hound: simple-scorched-earth-span-class-posthilit-worms-span-game_p1146985?#p1146985

    Or you could use Tiled Background to fill in large areas and use smaller sprites for curves and slopes

  • That shapy bezier floor, does it have a repeating pattern? You can break it into two TiledBackground objects.

    Say, one TiledBackground with curvy top stretched horizontally. And a small black square (also TiledBackground), stretched in both ways.

    Even if the curvy part of the floor doesn't have a pattern, you can crop it to something like 1280x50 and fill the remaining 250px with a tiled background black square. This will save quite a lot of memory.

  • Thank you , i will try both options .

  • ok i cropped the bezier curvy floor , and the rest below is tileable background. but the problem is , there is a white line in between the tileable tiles? what do i do now?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Zoom in the image, you should see the line of white pixels.

    Or simply create a new Tiled Bachground 4x4px and fill it with black color.

  • tiled background 4*4 pixels works nicely, thank you but i dont see any difference in Memory usage. I created 1 tile background 4*4 pixels , made it wide , and it uses 4.9Mb of memory , and then i created image 2048*2048 , and it uses 4.9MB of memory , i am confused

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