Does DOTS work for WebGL builds?

Just tried building the Samples to WebGL and the scenes load but they are blank is there a way to get DOTS to build and work to WebGL?

2 Likes

probably not lol

Why did you bump a 5 month old post

The ForEach and ForEachWithEntityChanges, IJobForEach, IJobForChunk Samples Work!

Subscene shows an empty scene.

SpawnFromMono appears to work but has a cube out of position(bug)???

The SpawnFromEntity and SpawnAndRemove does not, they crash with out of bounds errors.

– Update if you add this file to your project in the Editor folder Unity Editor script to enable WebAssembly multithreading · GitHub

using UnityEditor;
using UnityEngine;

[InitializeOnLoad]
class EnableThreads
{
   static EnableThreads()
   {
       PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm;
       PlayerSettings.WebGL.threadsSupport = true;
       PlayerSettings.WebGL.memorySize = 512;
   }
}
  • SpawnFromEntity - works!
  • SpawnFromMono - works for a bit then gets an out of bounds error (512 mb).
  • SpawnAndRemove - works for a bit then gets an out of memory error (1024 mb).
  • Subscene - still empty?

It’s a step forward but still buggy, is there a memory leak?

@UT please add these Editor settings back into the build settings UI for WebGL?

I followed this tutorial and got it to run fine in Unity itself (thanks to a quick fix provided by a youtube comment). But when publishing for webGl the game runs but nothing moves…
Has anyone some updates on DOTS and WebGL? I understand that this is not really a priority but I think webGL is the best way to get players and thus feedback. Would love to play around with DOTS there.

3 Likes

Your better bet might be to make a pure DOTS project with project tiny since that’s designed for web from the ground up.

2 Likes

It makes way more sense to just build your project with ecs and ship to web and other platforms rather the limit yourself with tiny. Unless your target market is purely for that platform.
Its a real shame Dots WebGL builds have just been (PostPoned!) like this.

1 Like

WebGL builds never worked on mobile, so there is that, and they were really heavy.

If your web build is over 100 mb, it’s much better to do an app and link it on a website than running it in a browser sandbox anyway.

That leaves out uploading to sites like newgrounds, which imo is still the best way for beginners to get feedback. When people have to download it, you get a lot less plays and comments. You can upload a crappy game made in a few days and get a few thousand plays along with ratings and comments. Try that on the play store…

Unfortunately WebGL itself limits quite a lot of stuff. I was trying to get VFX graph to work, but right now it seems impossible since WebGL doesn’t support compute shaders. And since almost no professional developers/studios focus on webGL, I can understand that Unity doesn’t invest it’s resources into making things work in WebGL.

Somehow I still have slight hope for ECS on WebGL…

3 Likes

I agree with all the points made about WebGL being an excellent entrypoint for new gamers. The archaic distribution model of a huge dinosaur-sized download needs to go. Stream the content you need when you need it and decide to keep it if you want it, gradually downloading the game as you play it.

Web is the future.

2 Likes

I agree with the WebGL being great for beginier developper to publish easily game, it’s also a great format for GameJams, which if suportted properly could give a bit more wind in the DOTS sails I think.

As to download a game as you play it, I believe that i’t’s the purpose of the adressable package.

2 Likes

Also, im a big fan of removing the default unity packages for my dots project since its entirely dots. However some of the new packages rely heavily on those packages. It’s gotten better but there’s still issues with removing all the default packages while using the new DOTS package (Relies on XR, VR, UI, Physics and Animation modules for minor things)
I’m waiting for WebGL Dots support, but I can’t find any ETA’s on it. Anyone know? :slight_smile: Im using Hybrid Renderer, Universal RP and Input System.
Edit: I found out somewhere that Unity will take roughly a year before we get the goods. It’s hard for a new indie dev to get people to play games without it though like others have said!

2 Likes