What does the Minify Script actually do?

Discussion and feedback on Construct 2

Post » Thu Oct 24, 2013 10:02 am

I know it does make the download "smaller and harder to decompile" but by what means?

At first I assumed it would resize pictures and compress audio (in case I have a 10 megapixel background image I forgot about etc). It could also delete unused things I added to the project. Another thing it could do is renaming assets (e.g. to "3241.ogg" instead of "Super Cool Corporate Music Bought at www.xxxxx.xxx for five dollars.ogg").

Does it do any of the above? If not, what does it do?
B
16
S
7
G
1
Posts: 158
Reputation: 3,125

Post » Thu Oct 24, 2013 10:18 am

@pirx

export your project with minification and without,

then look at the source code of c2runtime.js
and you will see what it does
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Thu Oct 24, 2013 10:24 am

I'll do that when I'm at my c2 computer. But solely from your reply I infer that probably all it does is a messy js file

So anyway it would be nice to have a script that does the things I mentioned one day.
B
16
S
7
G
1
Posts: 158
Reputation: 3,125

Post » Thu Oct 24, 2013 11:08 am

See also: Construct 2's export-time optimisations.

"Minify script" itself does not do what you suggested, but a bunch of similar optimisations happen anyway. "Minify script" actually means to run c2runtime.js through Google Closure Compiler's advanced mode. This makes the script much smaller and much harder to reverse engineer in to a project (which would have been very hard to begin with anyway).
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Thu Oct 24, 2013 11:43 am

Thanks for the clarification Ashley. I've just looked at a minified c2runtime and surely it wouldn't be easy to make sense of, let alone turn back into a project.

As to the link, I'm very interested in what optimizations are happening under the hood... and it turns out there's quite a lot of them. Great!
B
16
S
7
G
1
Posts: 158
Reputation: 3,125


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests