Skip to content

Commit f480213

Browse files
authored
Merge pull request #9913 from adamscott/exporting-for-web-update
Update "Exporting for the Web" to include 4.3 features
2 parents fb685d9 + a2c8428 commit f480213

File tree

1 file changed

+42
-14
lines changed

1 file changed

+42
-14
lines changed

tutorials/export/exporting_for_web.rst

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,40 @@ in the user's browser.
1717
.. attention::
1818

1919
Projects written in C# using Godot 4 currently cannot be exported to the
20-
web. To use C# on web platforms, use Godot 3 instead.
20+
web. See `this blog post <https://godotengine.org/article/platform-state-in-csharp-for-godot-4-2/#web>`__
21+
for more information.
22+
23+
To use C# on web platforms, use Godot 3 instead.
2124

2225
.. tip::
2326

2427
Use the browser-integrated developer console, usually opened
25-
with :kbd:`F12` (:kbd:`Cmd + Option + I` on macOS), to view
28+
with :kbd:`F12` or :kbd:`Ctrl + Shift + I` (:kbd:`Cmd + Option + I` on macOS), to view
2629
**debug information** like JavaScript, engine, and WebGL errors.
2730

31+
If the shortcut doesn't work, it's because Godot actually captures the input.
32+
You can still open the developer console by accessing the browser's menu.
33+
34+
.. note::
35+
36+
Due to security concerns with ``SharedArrayBuffer`` due to various exploits,
37+
the use of multiple threads for the Web platform has multiple drawbacks,
38+
including requiring specific server-side headers and complete cross-origin isolation
39+
(meaning no ads, nor third-party integrations on the website hosting your game).
40+
41+
Since Godot 4.3, Godot supports exporting your game on a single thread, which
42+
solves this issue. While it has some drawbacks on its own (it cannot use threads, and is
43+
not as performant as the multi-threaded export), it doesn't require as much overhead to install.
44+
It is also more compatible overall with stores like `itch.io <https://itch.io/>` or Web publishers like
45+
`Poki <https://poki.com/>`__ or `CrazyGames <https://crazygames.com/>`__. The single-threaded export
46+
works very well on macOS and iOS too, where it always had compatibility issues with multiple threads
47+
exports.
48+
49+
For these reasons, it is the preferred and now default way to export your games on the Web.
50+
51+
For more information, see `this blog post about single-threaded Web export
52+
<https://godotengine.org/article/progress-report-web-export-in-4-3/#single-threaded-web-export>`__.
53+
2854
.. seealso::
2955

3056
See the
@@ -232,6 +258,17 @@ player to click, tap or press a key/button to enable audio, for instance when di
232258
.. warning:: Access to microphone requires a
233259
:ref:`secure context <doc_javascript_secure_contexts>`.
234260

261+
.. warning::
262+
263+
Since Godot 4.3, by default Web exports will use samples instead of streams
264+
to play audio.
265+
266+
This is due to the way browsers prefer to play audio and the lack of processing power
267+
available when exporting Web games with the **Use Threads** export option off.
268+
269+
Please note that audio effects aren't yet implemented for samples.
270+
271+
235272
Networking
236273
~~~~~~~~~~
237274

@@ -275,13 +312,6 @@ to remap them based on model/vendor/OS due to privacy considerations.
275312

276313
.. warning:: Requires a :ref:`secure context <doc_javascript_secure_contexts>`.
277314

278-
Boot splash is not displayed
279-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280-
281-
The default HTML page does not display the boot splash while loading. However,
282-
the image is exported as a PNG file, so :ref:`custom HTML pages <doc_customizing_html5_shell>`
283-
can display it.
284-
285315
.. _doc_exporting_for_web_serving_the_files:
286316

287317
Serving the files
@@ -293,8 +323,8 @@ used, see :ref:`doc_customizing_html5_shell`.
293323

294324
.. warning::
295325

296-
If either :ref:`thread support or extension support <doc_exporting_for_web_thread_extension_support>`
297-
are enabled, the exported project will require
326+
Only when exporting with **Use Threads**, to ensure low audio latency and the
327+
ability to use :ref:`class_Thread` in web exports, Godot 4 web exports use
298328
`SharedArrayBuffer <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer>`__.
299329
This requires a :ref:`secure context <doc_javascript_secure_contexts>`,
300330
while also requiring the following CORS headers to be set when serving the files:
@@ -325,9 +355,7 @@ The other exported files are served as they are, next to the ``.html`` file,
325355
names unchanged. The ``.wasm`` file is a binary WebAssembly module implementing
326356
the engine. The ``.pck`` file is the Godot main pack containing your game. The
327357
``.js`` file contains start-up code and is used by the ``.html`` file to access
328-
the engine. The ``.png`` file contains the boot splash image. It is not used in
329-
the default HTML page, but is included for
330-
:ref:`custom HTML pages <doc_customizing_html5_shell>`.
358+
the engine. The ``.png`` file contains the boot splash image.
331359

332360
The ``.pck`` file is binary, usually delivered with the MIME-type
333361
:mimetype:`application/octet-stream`. The ``.wasm`` file is delivered as

0 commit comments

Comments
 (0)