x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

packaging size of html5 in ue4.16 over 200MB

Hi there,

I have just tried packaging in 4.16 an empty HTML5 project and I found that UE4Game.asm.js size is 200MB; MyProject.data is 100MB.

On the other hand packaging has not created gz files....

Am I missing something?

Thanks

Product Version: UE 4.16
Tags:
more ▼

asked Jun 08 '17 at 02:44 PM in Packaging & Deployment

avatar image

rsoriano
5 1 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

I wonder if UE 4.16 added a checkbox in project packaging settings menu to enable compression. If compression is enabled, the files should come out with suffix "gz". If there is no explicit setting to enable compression, try doing a Shipping build, that should be minified and enable compression for deployment purposes.

more ▼

answered Jun 08 '17 at 08:13 PM

avatar image

juj
1.2k 15 4 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

If for some reason UE4 does not automatically compress the .data and .asm.js files, you can manually gzip compress them with 7-zip. However when doing so, take a peek at the file sizes. I know UE4 is able to compress .data files by itself, so if the size of the .data file does not shrink when you manually compress, then there is no use in gzip compressing it for the web server, since it contained compressed data already and UE4 internally manages that.

The size of the .asm.js file however should dramatically get smaller when you gzip compress it. This file is only needed if you wish to host the old asm.js fallback for the page as well for compatibility reasons. WebAssembly is the new standard, which currently works on Firefox and Chrome, and Edge and Safari support is coming up soon.

The trick to make the page ask for these gz versions is to edit the main generated .html files and search for ".data" and ".asm.js" to find where the data file is loaded. To load the gz version, you can just add the suffix .gz to the filenames. the html file does so by default by using the "Module.locateFile()" function, search for its uses in the html file to see how its operationg.

more ▼

answered Jun 10 '17 at 07:33 AM

avatar image

juj
1.2k 15 4 17

avatar image rsoriano Jun 12 '17 at 11:08 AM

Thanks a lot, we already tried compressing all files with gzip but as I said it doesn't load the.data file. I've searched in the html code as you say an indeed there is something interesting:

 // Asset packages do not benefit from gzip compression because they are already compressed at UE4 packaging time,
 // and uncompressing very large gzip files would just slow down startup times.
 if (!dataFileIsGzipCompressed && name.split('.').slice(-1)[0] == 'data') serveGzipped = false;

I changed the the condition to true and it worked. Now it's just a matter of deciding if we preffer to decrease downloading or decompressing times.

Thanks juj ;)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
more ▼

answered Jun 08 '17 at 03:52 PM

avatar image

Sertac Ogan
1.5k 30 10 46

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Thanks for answering,

Sertac, we tried it and indeed reduced the package size on 60MB.

Juj, there is a "compress files during shipping packaging" which created a couple of gz files, but none for the biggest files (.data and .asm.js)

I tried to make it manually with 7zip and it works with all files but it still asks for the .data file so it can't be compressed (at least didn't work for me.

I'll let you know if we find out something else

more ▼

answered Jun 09 '17 at 11:20 AM

avatar image

rsoriano
5 1 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question