Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 progress bar is not accurate #6563

Closed
d954mas opened this issue Apr 29, 2022 · 4 comments · Fixed by #6634
Closed

HTML5 progress bar is not accurate #6563

d954mas opened this issue Apr 29, 2022 · 4 comments · Fixed by #6634
Labels
bug Something is not working as expected html5 Issue related to the HTML5 platform
Projects

Comments

@d954mas
Copy link
Contributor

d954mas commented Apr 29, 2022

Describe the bug (REQUIRED)
Web. Progress bar show percentage
-start from 50
-then return to 40
-then load from 50-100

To Reproduce (REQUIRED)
Make web build.
Show percent of loading(or look at progress bar)

Expected behavior (REQUIRED)
Progress bar go from 0-100

Defold version (REQUIRED):

  • Version 1.3.0

Platforms (REQUIRED):

  • Platforms: HTML5
  • OS: Windows 10 (firefox, chrome)

https://user-images.githubusercontent.com/2655263/165980108-95738858-0111-4eb0-9e1f-e4a53948118b.mp4
2022-04-29_18-45-33

@d954mas d954mas added the bug Something is not working as expected label Apr 29, 2022
@aglitchman
Copy link
Contributor

  • Version 1.3.0

Have you tried to disable Wasm Streaming? i.e. by adding EngineLoader.stream_wasm = false; into your .html file.

@d954mas
Copy link
Contributor Author

d954mas commented Apr 30, 2022

With EngineLoader.stream_wasm = false;
progress bar is correct

@britzl
Copy link
Contributor

britzl commented May 2, 2022

Note: From 1.3.1 the WASM streaming is turned off as default and it is available as an option in game.project in the HTML5 section.

But regardless of that there's an issue with the progress bar calculation in dmLoader.js that we need to look into when was streaming is enabled.

@britzl britzl added the html5 Issue related to the HTML5 platform label May 2, 2022
@britzl britzl added this to To do in 1.3.4 via automation May 2, 2022
@britzl
Copy link
Contributor

britzl commented May 19, 2022

The problem is that there's now out-of-the-box way to get the wasm streaming progress and instead we simply ignore the progressbar:

https://github.com/defold/defold/blob/dev/com.dynamo.cr/com.dynamo.cr.bob/src/com/dynamo/bob/bundle/resources/jsweb/dmloader.js#L136-L148

The proper solution seems to be to implement a custom ReadableStream and get progress from it. See:

https://stackoverflow.com/questions/65491241/get-webassembly-instantiatestreaming-progress

We're open for a PR to dmLoader.js!

@britzl britzl changed the title Web. Progress bar bad percentage HTML5 progress bar is not accurate May 25, 2022
@britzl britzl moved this from To do to In progress in 1.3.4 May 27, 2022
1.3.4 automation moved this from In progress to Done May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected html5 Issue related to the HTML5 platform
Projects
No open projects
1.3.4
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants