4 ms·
There are a lot of restrictions when using multiple threads in the browser. You need to spawn workers and they can only share certain things in memory between t
by Kiro 3y ago
There are a lot of restrictions when using multiple threads in the browser. You need to spawn workers and they can only share certain things in memory between the threads (transferable objects and SharedArrayBuffer for generic data). For everything else you need to pass messages back and forth between the workers.
Another problem is that SharedArrayBuffer was disabled by default after Spectre and in order to enable it you need to send certain headers from the server (Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy). I don't know if itch.io has support for that, but maybe.
I haven't used Godot but I'm thinking that the multithreaded models game engines are using don't convert very well to SharedArrayBuffers. It's a very crippled form if you're used to say C#.
- a1o 3y agoI think this is also not available in either iPhone or iPad Safari.
- aezart 3y agoItch does support the headers for SharedArrayBuffer, but it causes problems if you want to have both a web player and a downloadable version of the game. It was recently fixed for Chrome, but in Firefox trying to download a game from a page with SharedArrayBuffer results in the browser blocking the download from the CDN.
- omoikane 3y agoSharedArrayBuffer can be enabled on itch.io with one checkbox. https://itch.io/t/2025776/experimental-sharedarraybuffer-support https://itch.io/t/2025776/experimental-sharedarraybuffer-sup...
- a1o 3y agoCan you do that and still ping a server outside of itch.io? Say for analytics or for online gaming.
- omoikane 3y agoI haven't tried accessing any external network resources, but the article above suggest it wouldn't work: If your game accesses resources on other domains then those requests will fail by default.