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 Export takes very long to load #73270

Closed
thinkrapido opened this issue Feb 14, 2023 · 6 comments
Closed

HTML5 Export takes very long to load #73270

thinkrapido opened this issue Feb 14, 2023 · 6 comments

Comments

@thinkrapido
Copy link

Godot version

4.0.rc1

System information

Firefox 109.0.1 (64-bit)

Issue description

It takes a very long time to load the game in the local browser.

https://godotengine.github.io/godot-demo-projects/2d/dodge_the_creeps/ is much faster. It starts in an instance.

InstallTrigger is deprecated and will be removed in the future. [commons.js:2:1346463](moz-extension://763b49eb-c032-4817-889d-fd2f2a72fd85/commons.js)
USER ERROR: No GDExtension library found for current OS and architecture (web.wasm32) in configuration file: res://DodgeTheCreeps.gdextension [index.js:14009:18](http://[::1]:8000/index.js)
   at: load (core/extension/gdextension.cpp:530) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: Failed loading resource: res://DodgeTheCreeps.gdextension. Make sure resources have been imported by opening the project in the editor at least once. [index.js:14009:18](http://[::1]:8000/index.js)
   at: _load (core/io/resource_loader.cpp:222) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: Error loading extension: res://DodgeTheCreeps.gdextension [index.js:14009:18](http://[::1]:8000/index.js)
   at: load_extensions (core/extension/gdextension_manager.cpp:120) [index.js:14009:18](http://[::1]:8000/index.js)
Godot Engine v4.0.rc1.official.8843d9ad3 - https://godotengine.org/ [index.js:13994:16](http://[::1]:8000/index.js)
OpenGL API OpenGL ES 3.0 (WebGL 2.0) - Compatibility - Using Device: Mozilla - Radeon R9 200 Series [index.js:13994:16](http://[::1]:8000/index.js)
An AudioContext was prevented from starting automatically. It must be created or resumed after a user gesture on the page. [index.js:8704:14](http://[::1]:8000/index.js)
 [index.js:13994:16](http://[::1]:8000/index.js)
Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: Cannot get class 'Main'. [index.js:14009:18](http://[::1]:8000/index.js)
   at: instantiate (core/object/class_db.cpp:326) [index.js:14009:18](http://[::1]:8000/index.js)
USER WARNING: Node Main of type Main cannot be created. A placeholder will be created instead. [index.js:14009:18](http://[::1]:8000/index.js)
   at: instantiate (scene/resources/packed_scene.cpp:201) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: Cannot get class 'Player'. [index.js:14009:18](http://[::1]:8000/index.js)
   at: instantiate (core/object/class_db.cpp:326) [index.js:14009:18](http://[::1]:8000/index.js)
USER WARNING: Node Player of type Player cannot be created. A placeholder will be created instead. [index.js:14009:18](http://[::1]:8000/index.js)
   at: instantiate (scene/resources/packed_scene.cpp:201) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: In Object of type 'Node': Attempt to connect nonexistent signal 'body_entered' to callable 'Node::on_player_body_entered'. [index.js:14009:18](http://[::1]:8000/index.js)
   at: connect (core/object/object.cpp:1256) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: Cannot get class 'Hud'. [index.js:14009:18](http://[::1]:8000/index.js)
   at: instantiate (core/object/class_db.cpp:326) [index.js:14009:18](http://[::1]:8000/index.js)
USER WARNING: Node Hud of type Hud cannot be created. A placeholder will be created instead. [index.js:14009:18](http://[::1]:8000/index.js)
   at: instantiate (scene/resources/packed_scene.cpp:201) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: In Object of type 'Node': Attempt to connect nonexistent signal 'hit' to callable 'Node::game_over'. [index.js:14009:18](http://[::1]:8000/index.js)
   at: connect (core/object/object.cpp:1256) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: In Object of type 'Node': Attempt to connect nonexistent signal 'start_game' to callable 'Node::new_game'. [index.js:14009:18](http://[::1]:8000/index.js)
   at: connect (core/object/object.cpp:1256) [index.js:14009:18](http://[::1]:8000/index.js)
1: [index.js:13994:16](http://[::1]:8000/index.js)
USER ERROR: ParticlesShaderGLES3: Program linking failed: [index.js:14009:18](http://[::1]:8000/index.js)
<empty string> [index.js:14009:18](http://[::1]:8000/index.js)
   at: _display_error_with_code (drivers/gles3/shader_gles3.cpp:242) [index.js:14009:18](http://[::1]:8000/index.js)
USER ERROR: Method/function failed. [index.js:14009:18](http://[::1]:8000/index.js)
   at: _compile_specialization (drivers/gles3/shader_gles3.cpp:402) [index.js:14009:18](http://[::1]:8000/index.js)
USER WARNING: shader failed to compile, unable to bind shader. [index.js:14009:18](http://[::1]:8000/index.js)
   at: _version_bind_shader (./drivers/gles3/shader_gles3.h:219) [index.js:14009:18](http://[::1]:8000/index.js)
WebGL warning: getSyncParameter: ClientWaitSync must return TIMEOUT_EXPIRED until control has returned to the user agent's main loop. (only warns once)
WebGL warning: drawElementsInstanced: Drawing without vertex attrib 0 array enabled forces the browser to do expensive emulation work when running on desktop OpenGL platforms, for example on Mac. It is preferable to always draw with vertex attrib 0 array enabled, by using bindAttribLocation to bind some always-used attribute to location 0.
WebGL warning: getSyncParameter: ClientWaitSync must return TIMEOUT_EXPIRED until control has returned to the user agent's main loop. (only warns once) 2

Steps to reproduce

Any project will do it.

Export the project for HTML5

Minimal reproduction project

prj.zip

@thinkrapido
Copy link
Author

No it’s not. see provided blank project.

@thinkrapido
Copy link
Author

I reproduced it on Linux. No problems there.
It seems, that this issue is only on Mac, with Firefox and Chrome.

@Zireael07
Copy link
Contributor

cc @Faless (looks to be either GDExtension or shader related?)

@Faless
Copy link
Collaborator

Faless commented Feb 14, 2023

Some notes:

The local web server doesn't do caching (it's for development).
The binary size in Godot 4 has almost doubled (more external libraries in general, rtti, ICU/Harfbuzz DB for internationalization) so in general expects some (hopefully minor) slowdown.
GDExtension is not working in Godot 4 due to an emscripten issue emscripten-core/emscripten#15487 .
I see a lot of errors spammed there, that's definitely problematic and might slow down startup.

If the issue is only on MacOS (I tested FF + linux too and it loads as fast as usual for me) that might indeed be rendering related (maybe the Metal compatibility layer that apple forced on browsers is not very performant with some of our shaders?)

@Zireael07
Copy link
Contributor

The binary size in Godot 4 has almost doubled (more external libraries in general, rtti, ICU/Harfbuzz DB for internationalization) so in general expects some (hopefully minor) slowdown.

Unfortunately html5 was already very slow to start even back in 3.x due to sheer WASM payload size

@Calinou
Copy link
Member

Calinou commented Feb 14, 2023

Duplicate of #70691.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants