Search Unity

ETA for Unity 2018.3

Discussion in 'Web' started by nsmith1024, Jul 20, 2018.

Thread Status:
Not open for further replies.
  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello,

    I heard that Unity 2018.3 will have worker threads that will be able to automatically download and decode images from the internet on a separate worker thread from the main thread.

    I need this feature really bad because right now im downloading up to 20 images at random times while the game is running, each image causes the whole game to freeze, so it almost unusable, many people complain to me about it.

    Without the worker thread i will be doomed, i may as well hang it all up, cash in the chips, call it a day, throw in the towel, the fat lady will finally sing, game over, you see what i mean!

    Anybody knows the ETA for 2018.3 and the worker threads?

    Thanks
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    2018.3 will be the last release before 2018.4 LTS and it will be released sometime before the end of the year.

    I would not recommend to rely on multi-threading yet:
    • it's still in development on our side and there is a risk that it will slip to 2019.x (we will try to keep you updated on this)
    • most likely will be an experimental feature at the beginning.
    • there is no browser that supports WebAssembly thread yet.
    • if what you need is multi-threading in C#, then I can tell you it will not be available at the beginning
     
    twobob likes this.
  3. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello, thanks for the reply, how do you recommended i stop the freeze when i download photos. The whole game freeze and its really bad.

    Is there any way possible in the world, i will do anything!

    Is it possible to create java script code and have it create the worker thread for me, have the thread download the image, then some how get the image back to unity when its all done?

    Or maybe another way? right now im screwed!

    Thanks
     
  4. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    I'd recommend using UnityWebRequestTexture (combined with DownloadHandlerTexture) over the generic version when dealing with downloading textures. While it's not threaded like in the standalone build platforms, it's still noticeably faster (and thus less freezing) due to what I assume is a closer to native way of converting the downloaded data into a texture.
     
  5. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    I tried it using the code here, but it still freeze, i tried both codes on this site, same result.

    https://docs.unity3d.com/Manual/UnityWebRequest-RetrievingTexture.html
     
  6. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    are these photos in asset bundles?
     
  7. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello Sir, the photos are downloaded from an internet server at run time because its not known ahead of time which photos will be needed and there are a lot of photos. Its not in any asset bundle, its just raw JPG or PNG files that are on the server.

    For example the game player walks past something in the 3D scene, and the game would download several photos of something relevant to that location in the scene and shows them.

    Everything is perfectly smooth until it starts downloading the photos, then it becomes like an earthquake where everything starts shaking as it downloads the photos, the game stops and starts, stops and starts, stops and starts, over and over, then goes back smooth again after all photos have been loaded. Sometimes it has to download maybe 10 or 20 photos, so you can imagine how it looks. Seconds later when the player walks past something else it tries to again get photos and stuttering starts again.

    You can see the stuttering yourself, just make a simple game where you have a cube spinning, maybe use a rotate inside the update function. Make sure the cube has been spinning for around 10 seconds, then in the code start downloading a photo from any website you will see the cube stop spinning as the photo is being downloaded, and then start again, this is what happens over and over in my game. Even if you use a coroutine it still happens. Its important to wait for around 10 seconds after the cube start spinning before downloading the photo to notice the freeze. You can use an invoke(myDownload,10) something like that.

    I wish there was a way to fix it.

    The game also randomly downloads and plays video clips, just the same as it download the photos. Its actually streaming the videos instead of trying to download the whole thing before playing. But the game does NOT stutter while doing that. Im using the old WebGLMovieTexture which uses the browser built in video player, and there is NO stuttering its perfectly smooth while playing the videos. So it must be possible to get around the stuttering somehow because the browser itself must have threads it uses to get photos and play the video instead of doing it on the main UI thread which will freeze the UI.

    Maybe there is a way to stream the photos using the browser threads itself instead of trying to download the whole photo in one shot causing a big stop in the game. I have no idea just trying to figure out how to solve it.

    Thanks for any help, i have had this problem for a year now and i cant really release the Unity game fully until this is fixed somehow. With each Unity release i keep hoping the problem will go away, but its still there.
     
    Last edited: Jul 31, 2018
  8. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,168
    I heard it would be at the end of last month. Does it have any hope for this month
     
  9. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    No. Take into consideration that we just released 2018.2 last month we usually release every 3/4 months.
     
  10. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    It seems a pretty specific use-case so, I would not wait for Unity to fix this problem for you. In addition, Wasm threading is still not ready.
    Have you considered using WebWorkers to download the photos?
     
    twobob likes this.
  11. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,168
    I don't know that the cycle was also about beta

    I might not be clear but 2018.3 I was talking about is 2018.3 beta. Which normally beta was not released as much long after the last release
     
  12. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I see. 2018.3 should be entering Beta in the next few weeks.
     
    twobob, TerraUnity and Thaina like this.
  13. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    So... clooose... New Terrain system... Only waited 4 years.... so close....
     
  14. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    ya we really need a terrain system that does tunnels lol.
    Anyways I'm a bit surprised on the lag issue when downloading a photo? I don't think I ever noticed any lag when downloading profile pictures from inside my game. Course there isn't any animation playing so I guess I couldn't tell maybe?
    I use Best HTTP PRO for all my web requests. Downloading pics is the same thing as downloading any kind of data. My entire game is web base and its always downloading stuff and I never see any freezing.
    The game downloads planet pictures as you scroll through the galaxy for example as well.
    https://assetstore.unity.com/packages/tools/network/best-http-10872

    Make an account and test my game out @nsmith1024
    Also my game is a perfect example of what a Web GL game should look like with all the fixings.
    I use custom version control, full screen and custom UI for downloading/loading the game.
    https://dakara.systemlords.26horses.com/
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I am locking this now, please direct specific questions about WebGL solutions in their own thread as this thread was about when 2018.3 would arrive (which is also not something we encourage topics on).

    As answered by Unity staff, there is nothing Unity can do about this and it would be better to depend on what you have in front of you. Please make a new post for non beta WebGL related questions by all means.
     
Thread Status:
Not open for further replies.