Image spritesheets vs separate files

Discussion and feedback on Construct 2

Post » Wed Dec 28, 2011 9:20 pm

I noticed that when I export the project, all animation images are exported as separate files.

I was under the impression that generally it is better to combine separate files into 1 sprite sheet where possible, especially for web content to reduce file size and HTTP requests. For example Google does this


So I was just curious as to why C2 doesn't do this. Is there a reason separate files are better for html5 games? Is this a planned feature?wgfunstorm2011-12-28 21:21:09
B
22
S
9
G
5
Posts: 122
Reputation: 5,386

Post » Wed Dec 28, 2011 10:05 pm

It's a planned feature - it's simpler for the engine to use separate images for now.

However it's not entirely straightforward if it saves you any download size. If you have a sprite sheet like that and a single 16x16 image makes it just over 256 color, you end up saving the entire sprite sheet as PNG-32 which can be 2-3 times larger. Otherwise C2 would've spotted it's a 256 color image and automatically recompressed to PNG-8.

It's possible for C2 to work around that of course, but it's pretty complicated and in the mean time it's working fine soo....
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Dec 28, 2011 10:11 pm

Cool, I was mostly just curious. I agree it's not a big deal. Thanks!
B
22
S
9
G
5
Posts: 122
Reputation: 5,386

Post » Wed Dec 28, 2011 10:24 pm

What about texture changes on WebGL case ? Having a lot of texture changes can be a great performance dropper.Kiyoshi2011-12-28 22:25:27
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Wed Dec 28, 2011 10:29 pm

As a webdesigner, i know that google do this to make the navigator downloads all the icons even if this icon isn't on the screen yet, so when the user interact with the icons it does not need to download the new icon that appear.
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Wed Dec 28, 2011 10:37 pm

In webdesign, I don't think it's purely to do with pre-loading images. There's more than 1 way to do that, but with this method you also get other benefits eg

"The conclusion is the same: Reducing the number of HTTP requests has the biggest impact on reducing response time and is often the easiest performance improvement to make."
http://yuiblog.com/blog/2006/11/28/performance-research-part-1/
B
22
S
9
G
5
Posts: 122
Reputation: 5,386


Return to Construct 2 General

Who is online

Users browsing this forum: neverk, Psychokiller1888 and 14 guests