What would you advise me to do?

0 favourites
  • 6 posts
  • I have a large map in my game and I have separated it in 14 parts, which I made them all 900x1145 big by mistake. That froze my phone and I have reduced it to 450x573. But the game's performance is still not ideal and I think additional reducing of the image sizes would screw the quality of the map for better displays...

    Should I consider dividing my map image into another 14 parts (28 in total) ?

    What is the minimum size of an image that will look nicely on every display without causing the game to lag?

  • Are you using one giant image or something for your map?

    If you are, the "map size" isn't the issue... it's the fact you're using one massive image to show it. Never, ever, ever.... ever use one giant image for things like that if you want it to run nicely on a lot of devices. For PC it's not so much of a problem because graphics cards these days have like 8gb of RAM and stuff like that, but it will kill a tablet or phone, or even an older desktop computer.

    Break up your images into small tiles, or separate images to build your map from "pieces" - this will help a lot.

    If you already have broken up the map graphics into several pieces - this could also be a problem if there are simply too many objects. A decent PC can handle a good 10,000 static objects without much problem, but I notice even 2,000 objects can slow down my phone. If this is the case, then you may need to make some way of only creating the map tiles/objects if they should exist on the screen at the time, and literally destroy/delete everything that's not visible to the player.

    Have you got some example of how you are making your map? It will be helpful for a better suggestion to fix the issue.

    ~Sol

  • Hi, thanks for replying. Yes, my map is a large image so I cut it in pieces and use them in my project as sprites (if I make tiles from it, I won't be able to rescale the images and can't use image points).

    The layout of the map has over 300 objects and I am scrolling the UI over it.

    You mentioned about destroying anything that isn't visible, but as far as I know, off-screen objects are not rendered by the graphics card so it won't be a problem...

  • Rendering isn't a problem, but active object count can still be an issue if you have loads of stuff going on.

    Often my projects end up being loaded with crazy amounts of moving and complex math with the visible objects, and so anything that the player can't see is often destroyed or majorly simplified in it's calculations in order to save processor time.

    Ultimately, you need to just make sure you aren't making images that are too big... OR making too many objects in total that are moving or have some "every tick" math tied to them (like loops every tick, or tracking coordinates, etc).

    Having a single large picture is the big killer though, especially when it comes to mobile platforms. I would recommend to keep you images to as small of a size as feasible, especially if you have a lot of repeating or re-used imagery. If your map has a road on it for example, you can make a few road tiles and create every length of road from 4-5 small images, rather that having a giant image of a road for example.

    Hopefully this will help.

    *EDIT*

    What I meant by making tiles isn't necessarily making a "tilemap" - just cut the map into smaller pieces and still use them as sprites if you want. I often make my own "tile map" by using a loop to place sprites all over the layout as the "tiles" so I can still use collision polygons, image points, and all that stuff. Again, there is a balance point between having too big of an image, and too many objects!

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a large map in my game and I have separated it in 14 parts, which I made them all 900x1145 big by mistake. That froze my phone and I have reduced it to 450x573. But the game's performance is still not ideal and I think additional reducing of the image sizes would screw the quality of the map for better displays...

    Should I consider dividing my map image into another 14 parts (28 in total) ?

    What is the minimum size of an image that will look nicely on every display without causing the game to lag?

    Phones often need to process images as power of 2 sizes (2048, 1024, 512, 256, 128, 64, 32), so it will upsize to the next power of 2 filling in the rest of the image with blank space.

    This means your 900x1145 will be treated as 2048x2048 which takes 16MB and your 450x573 will be treated as 1024x1024 which takes 4MB.

    If you can, break the large map image up into pieces no bigger than 512x512 (which only takes 1MB each), although 1024x1024 may work just as well depending on layout dimensions. For example, if the layout height is 2048, then two 1024x1024 images would work just as well, if not better than 4 512x512 images, but if the layout height is 1536, then 3 512x512 images would work better then two 1024x1024 images.

  • Hi, thanks for the very useful information. Yes, I think I could manage to make all parts of the map 512x512.

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