How do i compress my project size?

Get help using Construct 2

Post » Mon Jan 30, 2012 6:29 pm

Hello!

I just wanted to ask if someone has some tips for compressing the file size of a project. At the moment my project is approx 20MB, and i should be able to get it way below 10.

- For example, is it better to use jpg where opacity isnt needed?

- Is it better to chop art up into small pieces, and use as few different sprites as possible?

- How big impact does the number of events have on the total project size?

- How big impact does the different "objects" (like touch, keyboard) have on the total project size?

- Should i make all art assets 1:1 in size, to reduce file size? What impact could this have on portability/scaleability?

- Does cloning objects/art assets duplicate the file, meaning double the size used? Or does it work the same way as copy/paste?

I really need to get a hang of this, as i'm targeting the mobile market.

Any help is greatly appreciated!
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Mon Jan 30, 2012 6:58 pm

You can find this stuff out by simply starting a blank .capx, adding something to it, and exporting, then check the file size. I was curious though, and did it for you.

[QUOTE=Era]- For example, is it better to use jpg where opacity isnt needed?[/QUOTE]

Can be, jpgs can be smaller than pngs if the conditions are right.

[QUOTE=Era]- Is it better to chop art up into small pieces, and use as few different sprites as possible?[/QUOTE]

Chopping a big picture into smaller pictures won't help the file size.

[QUOTE=Era]- How big impact does the number of events have on the total project size?[/QUOTE]

Not much. 10 events, with 50 conditions and 50 actions total, added 11k.

[QUOTE=Era]- How big impact does the different "objects" (like touch, keyboard) have on the total project size?[/QUOTE]

Again, not very much. Adding a unique text object to a project adds 8k to the exported project. A sprite, with a 1.5k image added 23k. The images and sounds generally take up far more space.

[QUOTE=Era]- Should i make all art assets 1:1 in size, to reduce file size? What impact could this have on portability/scaleability?[/QUOTE]

The ratio shouldn't matter for file size. Could matter for vram use.

[QUOTE=Era]- Does cloning objects/art assets duplicate the file, meaning double the size used? Or does it work the same way as copy/paste?[/QUOTE]

Cloning the 23k sprite added 2k - almost the entirety of which went to duplicating the image.Arima2012-01-30 19:03:18
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Mon Jan 30, 2012 7:13 pm

Thanks alot! Sorry, i didnt think of just testing it myself like that..

Thanks for the effort nonetheless, appreciate it.
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Mon Jan 30, 2012 7:33 pm

Transparency adds to file size as per every pixel it has to store data for RGBA instead of just RGA so thats an extra bit every pixel but we are not talking much here.

Jpegs are generally smaller and if you have access to photoshop or the like (gimp might do it) you can compress them in that and reduce the quality in trade for a reduced file size. No need to really go over 75% and you can keep reducing it way beyond that, it's only things like gradients that tend suffer. Try also reducing the colour count to see what you can get away with.

Reducing the size of the sprite (outside of constuct*) will also reduce the filesize. Less pixels means less data needed to be stored however when you scale the images back up you will see a noticable difference in quality.

Other things that you could try is to repeat the use of sprites. Using 7 different tree images? Break it down in a few parts and just make up lots of tree's using a combination of the pieces you have. Rotate/flip/scale to create variation. Use actions to animate it and remove frames from sprites.

*edited in light of mod comments see belowdsarchy2012-01-30 20:20:48
B
14
S
3
G
5
Posts: 41
Reputation: 3,490

Post » Mon Jan 30, 2012 7:35 pm

For references you can check this blog article about image compression in C2 to reduce the size of your final package.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Mon Jan 30, 2012 7:40 pm

[QUOTE=dsarchy]Reducing the size of the sprite will also reduce the filesize. Less pixels means less data needed to be stored however when you scale the images back up you will see a noticable difference in quality. [/QUOTE]

The way you phrased it might not be clear, so to make sure, reducing the size of the sprite's image in an image editor will reduce the filesize, but reducing the size of the sprite's instance in the layout editor won't.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Mon Jan 30, 2012 7:56 pm

In practice there are only two things that make up the filesize of Construct 2 games:

1) Audio
2) Images

For 1), just prefer to use a few short sound effects rather than lots of long audio clips. Music is going to take a lot (3-4mb for a single track) so you probably can only fit one track in, or maybe even just a short loop.

For 2), avoid using lots of animation frames. Also see the blog post Kyatric linked to for the image compression options that can help reduce the filesize.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Wed Apr 25, 2012 4:05 pm

Is there any way of reusing images for duplicate frames to reduce project size?

I'm trying to use two animation frames to create a complex flicker effect (one frame for 'off', one for 'on'), but I need to duplicate them each several times to get the right timing (the total animation is about 18 frames). It seems that C2 creates a new image for every frame, even if the frame is a duplicate, so the project size grows quickly as a result.

Any way to force reuse of just the two images? Or, is there some alternate way of creating the sequence that I could try?


--Joejoeykid62012-04-25 16:05:49
B
12
S
5
G
5
Posts: 26
Reputation: 4,001

Post » Wed Apr 25, 2012 4:15 pm

You could use:

every however many seconds
- set animation frame to 1-sprite.animframe
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Wed Apr 25, 2012 6:05 pm

@joeykid6 - did you know you can click on a frame and change its frame time in the property grid? E.g. a frame time of 2 means it's displayed twice as long as normal.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Next

Return to How do I....?

Who is online

Users browsing this forum: HugeCube, imnotspecial, tomi71, totoe, Yahoo [Bot] and 13 guests