Is this sprite 8Mb or 18MB ?????

Discussion and feedback on Construct 2

Post » Wed Dec 31, 2014 7:40 pm

Hi and HNY all

I have been working on a mobile game for the last couple of weeks, and I've been watching my memory usage carefully throughout the process. At some point today, while working on my event sheets, I realized that some of my sprites have doubled the utilized memory.

I stripped down the project to a single sprite (both on my current project and on yesterday's project) and you can see for yourself.... on the "18Mb" project the sprite is 18Mb, while on the yesterday's version it is only 8MB! In both versions the sprite has the same attributes (Height/Width/Frame Count etc)....

What am I missing here ????
You do not have the required permissions to view the files attached to this post.
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Wed Dec 31, 2014 8:34 pm

downscaling on project properties, on one is set to medium on the other to high, don't use high, not recommended.
Image
B
80
S
30
G
12
Posts: 517
Reputation: 12,713

Post » Wed Dec 31, 2014 10:16 pm

Thnx @Lof. Since I focus on getting drunk at the moment I will look tomorrow. I did change some project properties...
HNY
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Thu Jan 01, 2015 7:51 am

Changing my settings back to medium quality on Downscaling resolved the issue.

I must admit that I am quite puzzled by the fact that downscaling (which by nature uses less pixels than the native size) effects the memory usage in such a way (more than x2 mem usage! ). @Ashley can you clarify please?
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Thu Jan 01, 2015 9:55 am

From what i remember, when you're setting it to high images are always exported in powers of 2, that means if you're using a 513+ sprite it will be rendered as 1024, this results in a more crisp rendering and scaling, but naturally effects memory usage.

If you're aiming for mobile, forget about it, go as low as you can both with your sprites and with the window size.
Image
B
80
S
30
G
12
Posts: 517
Reputation: 12,713

Post » Thu Jan 01, 2015 9:58 am

Image
B
80
S
30
G
12
Posts: 517
Reputation: 12,713

Post » Thu Jan 01, 2015 10:27 am

thnx Lof

Here's the sections on Ashley's tutorial that answers the question:
The fact most images come out a power-of-two size has another benefit: some platforms, especially mobile ones, only support mipmapping with power-of-two size source images. Mipmapping is a rendering technique that basically enables high-quality downscaling, so objects resized small use real antialiasing to look better. This means after exporting some sprites may be able to resize smaller with better rendering quality on some platforms.

Note that if you set the Downscaling project property to 'High quality', images on spritesheets are always padded out to power-of-two sizes in order to mitigate two minor rendering issues. This negates the memory saving of spritesheets and so should not be used for no reason. For more information see Memory usage.
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Sat Jan 03, 2015 2:03 pm

Look it up in the manual:

Downscaling
Adjusts the tradeoff between rendering quality and memory use when resizing images to smaller than their original size (downscaling). The options are:
...
High quality: mipmaps are enabled and the spritesheet after export pads out all images to power-of-two sizes. This can significantly increase memory use, but can resolve two minor rendering issues: light fringing that can sometimes occur along the borders of downscaled objects, or a quality change in the last frame of an animation. Do not use this mode unless a rendering artefact is specifically observed and selecting this mode can be observed to resolve it: the increased memory usage can be very significant, and is not a cost that should be added for no reason.


If you just go blindly changing options without understanding what they do, then you will end up confused like this. Since a lot of people seem to make this mistake with this option, the next build warns you when choosing 'high quality' downscaling mode.
Scirra Founder
B
399
S
236
G
89
Posts: 24,539
Reputation: 195,422

Post » Sat Jan 03, 2015 2:53 pm

Thnx Ashley.
BTW, this happened unintentionally while tweaking other settings.
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Sat Jan 03, 2015 4:47 pm


there are two points in that tutorial that arent true i think

- Don't bother trying to run the exported image files through other compression tools or services. Construct 2 is probably already doing a very good job."

try running the exported images trough pictureslash.com , i ALWAYS get improvements with that, expecially if i have some big images with much details and transparency then it saves between 30-50% of download size compared to the brute png compression of construct2.

- Don't try to manually delete audio files before exporting. Construct 2 automatically removes any that are definitely not needed on export.

i just exported a game where i imported like 20 sound effects and only used three and every single sound file is also in the export folder
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests