Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Cross-Origin Isolation to unblock WASM SharedArrayBuffers?

A topic by Kettlecorn created Apr 20, 2021 Views: 3,457 Replies: 20
Viewing posts 1 to 16
(+7)

I've been writing a custom engine for web using WebAssembly. It has some cool stuff like procedural audio that's shown off a tiny bit in this demo.

To make that audio work I need SharedArrayBuffers, and SharedArrayBuffers require CORS flags to be set as detailed here: https://developer.chrome.com/blog/enabling-shared-array-buffer/

Right now my engine works on itch.io in Chrome without the CORS headers set, but that's temporary and Chrome will be disabling support next month. It's likely very difficult to make my engine work without SharedArrayBuffers, but I'd really like to host my future work on itch.io.

I noticed there was some discussion of this issue around half a year ago: https://itch.io/t/1028526/cross-origin-policies-for-webassembly

Has any further progress been made on this front?

(2 edits) (+6)

Godot released support for multi-threading today (version 3.3), which requires SharedArrayBuffers. In order to use it in Firefox I’d need the Cross-Origin-Embedder-Policy and Cross-Origin-Opener-Policy headers to be set. Without it, I fall back to loading the game on the main thread which causes everything to freeze (ruins immersion).

Don’t see these headers currently, would really like them!

(+1)

I also want to register my interest in having these headers added. Mainly for the Godot multi-threading support. I appreciate that it's not as simple as just adding the headers as it may break older game, but if a solution could be found that'd be very nice. :)

Admin(+7)

Hello,

We experimented with these changes a while back but it can create incompatibility with existing games if were to just change the headers on all existing projects.

It’s likely we’ll deploy a secondary CDN configuration, and let all newly uploaded projects run through there, and let old projects migrate if they want.

(+1)

Thanks for the response!

Is there a loose timeline on when these changes might occur?

As I mentioned initially Chrome will make a change sometime next month that will make it so SharedArrayBuffers no longer work, at which point no browser will support such content on itch.io.

Admin (1 edit) (+1)

Do you have a build uploaded on an itch.io page you want to test with? I can flip the switch for that page

I don't know if they have one, but I have one here to test with: https://nisovin.itch.io/seven-thread-test

Using Godot 3.3.

Thanks! This is the page I've been testing my engine on: https://kettlecorn.itch.io/rusty-audio-test

If you can flip the switch for that page that would be excellent!

I also have a Godot 3.3 Game Demo Export here if you could flip the switch on it as well, please.

(1 edit)

Heya, our game could use a nudge as well https://lemonsaurus.itch.io/quadropus
Thanks :)
Nevermind, we disabled threading in the code and works now

I would also like to test! If you can flip the switch for https://lilydev.itch.io/rhythm-mmo, please let me know! :)

(+1)

I am also very interested in this optional setting! I am sure all godot developers have encountered this audio issue in some form or another. Being able to share games through the web without stuttering would be amazing!

(+2)

Any updates on this? I really think this is going to be an important feature for web-based games. Supposedly Chrome will start requiring these headers this month.

(+2)

Also looking for an update on this. Being able to play web builds of games/apps built with things such as Godot or Love.js (Love2D) on Firefox (and Chromium based browsers come version 92). Source on the chromium claim: https://blog.chromium.org/2021/05/adjusted-timeline-for-sharedarraybuffers.html

Deleted 3 years ago
Deleted 3 years ago
(+2)

Some additional info: I noticed there's now a concrete date when Chrome will require cross-origin isolation to use SharedArrayBuffers: July 20th.

Chrome 92 is making these changes and it will start rolling-out July 20th: https://blog.chromium.org/2021/06/chrome-92-web-apps-as-file-handlers-new.html

(1 edit) (+5)

Just chiming in that I’m also seeing this error on my game: https://opyate.itch.io/pop1

These headers work for me locally:

“Cross-Origin-Opener-Policy”: “same-origin”

“Cross-Origin-Embedder-Policy”: “require-corp”

Newgrounds supports these headers: https://www.newgrounds.com/bbs/topic/1468978

Thanks for spending time on this!

(+1)

Same issue with another Godot 3.3 game: https://dexterminator.itch.io/solemates

(+1)

Need these header too +1

Deleted 3 years ago
(+2)

Thinking you missed it, they did respond above. They have a working configuration you could try if your game needed it.

Please stop replying with these non-constructive comments (it distracts from legitimate updates), please and thank you.

Deleted 3 years ago
Moderator

I'm locking this topic to stop you from bumping it abusively. It's starting to bother people.

Moderator

Please be kind to the community, and make sure to follow the rules that everyone else does. You’ve started posting similar comments on unrelated posts, and harassing other users, which is against the rules.

You are currently banned from posting to the Itch.io community. You are welcome to contact support with details if you’d like the ban reverted.

In either case, make sure to read the community rules and be respectful.

Moderator locked this topic
Moderator unlocked this topic
Moderator locked this topic
Admin unlocked this topic
This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.