Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

Does DOTS work for WebGL builds?

Discussion in 'Data Oriented Technology Stack' started by Arowx, Apr 27, 2019.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,547
    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?
     
    deus0 and Nyanpas like this.
  2. squarelover

    squarelover

    Joined:
    Nov 14, 2012
    Posts:
    21
    probably not lol
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    2,551
    Why did you bump a 5 month old post
     
  4. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,547
    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 https://gist.github.com/mtrive/01374844278d2ec377c7f6bbc4df4e6a#file-enablethreads-cs

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3.  
    4. [InitializeOnLoad]
    5. class EnableThreads
    6. {
    7.    static EnableThreads()
    8.    {
    9.        PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm;
    10.        PlayerSettings.WebGL.threadsSupport = true;
    11.        PlayerSettings.WebGL.memorySize = 512;
    12.    }
    13. }
    • 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?
     
    Last edited: Oct 4, 2019
  5. Shack_Man

    Shack_Man

    Joined:
    Jun 7, 2017
    Posts:
    261



    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.
     
    Nyanpas, deus0 and duzbot like this.
  6. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    316
    Your better bet might be to make a pure DOTS project with project tiny since that's designed for web from the ground up.
     
    Nyanpas and Antypodish like this.
  7. deus0

    deus0

    Joined:
    May 12, 2015
    Posts:
    37
    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.
     
    Last edited: Aug 27, 2020
    Nyanpas likes this.
  8. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    469
    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.
     
  9. Shack_Man

    Shack_Man

    Joined:
    Jun 7, 2017
    Posts:
    261

    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....
     
    Rallix, deus0 and Nyanpas like this.
  10. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    282
    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.
     
    deus0 likes this.
  11. WAYN_Games

    WAYN_Games

    Joined:
    Mar 16, 2019
    Posts:
    481
    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.
     
    deus0 and Nyanpas like this.
  12. deus0

    deus0

    Joined:
    May 12, 2015
    Posts:
    37
    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? :) 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!
     
    Last edited: Aug 27, 2020
unityunity