0 Favourites

Performance Tips Question

  • In the performance tips there is a paragraph that I would like to know more about:

    "Image formats (e.g. JPEG, PNG-8, PNG-32) affect the download size but have no effect on runtime performance (they are all decompressed to 32-bit bitmap on startup)."

    When the images are decompressed, do they go into RAM?

    How decompressed do the images get?

    Example: A solid black 1000x1000 pixel .png is 6k, but the same 32bit bitmap is 3,907k

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • The images go in to RAM and also in to VRAM (graphics card memory) if the rendering is hardware accelerated, which it usually is these days.

    They get decompressed to the same size as the image saved as a 32-bit bitmap, so yes, a 1000x1000 pixel image will always take about 4mb of memory alone. This isn't much when both your computer and graphics card have gigabytes of memory, but bear in mind 4mb is still a lot for a single image on mobile.

    The various compressed formats just package the data in to a smaller filesize. Compressed images cannot be drawn though, so it's normal to decompress the images in to memory whenever they are loaded.

    We have plans for a feature to load textures layout by layout (like Classic can) somewhere on the todo list, to save memory with very large projects.

  • Thank you, this clarifies a lot for me. I have been going based on the size of the C2 project, but I really need to go back and double check all my files with this in mind. For example I have an animation that is mostly black with eyes looking around, C2 sees it as being a tiny amount of data, but decompressed this would be huge.

  • scirra.com/manual/134/performance-tips

    ize, angle or opacity of sprites/tiled backgrounds has no effect when hardware acceleration is in use

    So does that mean, the practice of using 2^X sized images no longer matters like it did Construct Classic? For instance using multiple 256x256 sized images rather than a single 400x250 sized image?

  • Performance wise non-power-of-two textures are no different than power-of-two textures. It was the same with CC.

    The reason for power-of-two textures was purely for memory efficiency.

    In CC non-Power-of-two textures were reported by the runtime to take as much video memory as the closest 2^X texture would take. Most graphics cards now can handle any sized texture as well as 2^X textures. Whether the texture is re sized up to a 2^X texture in memory or not is hardware specific.

  • Thanks Rojo.

  • R0J0hound is right, the texture size affects memory usage and not runtime performance.

    The power-of-two thing is annoyingly complicated: on desktop, you can probably forget it completely, almost all desktop computers now can support non-power-of-two textures. However, mobiles and tablets have weaker, simpler hardware and might still internally use power of two, but you can't easily tell, because the graphics card can make the support invisible (it will pretend it's using a non-power-of-two even if behind the scenes it's using power of two). TBH, I'd forget about it, it's a pain - just test your game regularly to make sure it works on mobile and you'll be fine.

  • Hi Ashley, this is a post of 2012, so i wold like to know if

    the "We have plans for a feature to load textures layout by layout (like Classic can) somewhere on the todo list, to save memory with very large projects." its done in the releas 163 of construct.

    I have made a game for mobile and when in older devices its crash on starting, i think is because the RAM.

    Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
331 35,567
Lordshiva1948's avatar
Lordshiva1948
Unread hot topic
353 32,068
yojona's avatar
yojona
Unread sticky
192 1,337,381
Kyatric's avatar
Kyatric Construct Team Support