Defold: html5 progress bar stays at 0% when archive files are gzipped

Created on 14 Aug 2020  路  2Comments  路  Source: defold/defold

Describe the bug (REQUIRED)
If the files inside the archive folder are gzipped server-side (the arcdX files in particular), the progress bar is shown at 0% and stays there. It does not show any loading progress while the files are being downloaded. From 0%, it goes straight to the fully loaded app.

To Reproduce (REQUIRED)
Steps to reproduce the behavior:

  1. Open Chrome developer console
  2. Select a 3G network preset to simulate a slow connection
  3. Load the app's page
  4. After the engine has been loaded, note that the progress bar will be shown with 0% progress
  5. Progress bar stays at 0% all the time, then the app is fully loaded. No loading progress is shown at all

Expected behavior (REQUIRED)
Progress bar should show progress from 0% to 100% as the archive files get downloaded.

Defold version (REQUIRED):

  • 1.2.172

Platforms (REQUIRED):

  • Platforms: HTML5
  • OS: Windows 10
  • Browser: Google Chrome

Workaround (OPTIONAL):
Do not gzip the files in the archive folder. The progress bar will work as expected, but then you lose the advantage of further reducing download size.

Additional context (OPTIONAL):
File savings when you gzip the archive files are significant (25% or more). For html5 builds, it's very important that the app loads as quickly as possible, so using gzip server-side is almost mandatory. At the same time, the progress bar is also important as it gives the users a visual clue that something is happening in the background.

So we need the progress bar to work when the files in the archive folder have been gzipped.

bug html5

Most helpful comment

@d954mas I pushed a new commit to the PR. The new commit exposes the values on the EngineLoader object so that you can change them if you use your own engine_template.html

https://github.com/defold/defold/pull/5211/commits/65daeefe2aef68a6191218389d87ec493ddf03e9

All 2 comments

Hi cool feature.
It will be better if you move wasm size and percents to constants. So user can configure progress bar.

Thanks.

Use it in my current project. Worked good.

@d954mas I pushed a new commit to the PR. The new commit exposes the values on the EngineLoader object so that you can change them if you use your own engine_template.html

https://github.com/defold/defold/pull/5211/commits/65daeefe2aef68a6191218389d87ec493ddf03e9

Was this page helpful?
0 / 5 - 0 ratings

Related issues

subsoap picture subsoap  路  5Comments

aglitchman picture aglitchman  路  4Comments

aglitchman picture aglitchman  路  3Comments

horatiohafnaugels picture horatiohafnaugels  路  5Comments

kfsone picture kfsone  路  4Comments