Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

webgl memory settings missing?

Discussion in '2020.1 Beta' started by bugfinders, Apr 12, 2020.

  1. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,793
    So, I made the most feeble dots based game, compiled it up, but, it claims out of memory, surprising considering how small and feeble it is, however, the memory settings are no longer in the webgl player settings menu. So it not entirely helpful of it to tell me to go change it in the webgl player settings.

    So, what can I do? seriously? its tiny.. the publishable build is... 8mb

    PS yes this is with 2020.1b5
     
  2. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    Add the Emscrypten Settings build component into your build configuration asset and pass the argument "-s TOTAL_MEMORY=512MB" (without quotes, adjust the memory size as you wish)
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,793
    Hi Thanks, Ive not heard of the Emscrypten Settings build component nor would I be entirely sure how to add it to the build configuration asset - Ive edited assets in text form before, but having no familiarity I wouldnt know how to add it
     
    brunocoimbra likes this.
  4. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,793
    @brunocoimbra thanks for liking but perhaps you could explain more so I can achieve this?
     
  5. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    Sorry, I thought you were able to do that. All dots based project should be compiled with the Build Configurations file, there you can add build components and edit the necessary settings. If you don't know what I am talking about, take a look at the Unity samples.
     
  6. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,793
    @brunocoimbra I get the impression you dont know. Ive seen the unity samples, but I hadnt seen any that are designed for webgl build, in fact most dots stuff is usually demonstrated from the editor only, it also doesnt sound normal to add a component to the build asset as the build asset is usually controlled by the unity editor and its not like we get to just drag/drop items on it.
     
  7. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
  8. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,793
    Thank you for some useful information

    Well, other than a mention in the unity docs that the class exists there doesnt seem to be any documentation or mentions anywhere that google could find, having not looked into project tiny, its therefore not surprising I hadnt seen this, and of course this doesnt really explain how to use it only that it can be.. Looking at the project tiny docs it seems this is currently specific to project tiny.. which Im not using, but that doesnt really explain anything only that its there.

    However, it does seem similar to the contents of some of the projectsettings.asset in the projectsettings folder. I had a look at the configuration assets and yes, it does seem useful however, it needed a "pipeline that derived from IBuildPiplineComponent" and.. I didnt see anything that sounded like that in the folder you listed..

    If this is likely to be a new way to go, it would be useful to have some documentation on how to take a non project tiny, and not preexistingly setup project into this. As, Im using webgl, not projecttiny - maybe I should be, maybe that would help but as I understand UI is still not supported that does put a bit of a drag to it.
     
  9. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    Oh, sorry, I misunderstood when you told that it was tiny haha

    Anyways, the Build Configuration flow is supposed to be used with all dots projects (not only tiny projects): https://github.com/Unity-Technologi.../master/ECSSamples/Assets/BuildConfigurations

    But, as far as I know, there is not a build component to adjust WebGL memory size in non-tiny projects. Not sure if it would work, but you could create a build component yourself to set that.
     
  10. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,793
    Well, the line "webGLEmscriptenArgs" in the projectsettings asset, took the command and I think to an extent did use it, but its still complaining.. the game is the crappiest thing, its a tower defense with at most (currently) like 30 entities on the go.. it has 3 real simple systems (move, die because of health and shoot nearest thing) TBH I submitted a bug to unity because I think the memory issue actually comes from a bug, if you try play it it throws a trying to run loop error and says to log bug with unity but it does it quietly in the browser console so I think its throwing itself into some kinda stack overflow type barf..

    shame because while dots isnt "live" yet while its fun making it in the editor I do feel it isnt real until your mates have poked at it at least.
     
  11. replay11

    replay11

    Joined:
    Dec 24, 2007
    Posts:
    168
    I'm having the same issue. I'm just using the Unity 2D Game Kit project and publishing to WebGL... what a nightmare! First the thing never finishes loading and had to research that online .. .then I fix that and now the WebGL memory error and Unity has gone and removed the ability to change that in Player Setting in 2020.3 (the version I'm using). I'm trying to upload to a Learning Management System LMS and if I modify the loader.js file and manually increase the memory I get an error message. I need to be able to change the memory amount in the Player Settings, but now Unity has removed that option? WTF??? Unity is killing me with this WebGL publishing option... they need to simplify the process. And considering this is their example on their LEARN site it's quite an embarrassment that it doesn't work.
     
    TOES and bugfinders like this.
  12. TOES

    TOES

    Joined:
    Jun 23, 2017
    Posts:
    134
    I wonder if Unity care about WegGL at all, I am wasting so much time trying to make this work that it would probably be a lot faster to go for Three.js or something "native", completely opposite of what Unity claims to do for developers. I love to work in Unity on other platforms, but what a complete nightmare Unity is to develop in when it comes to WebGL! and it is soooo slooow when compiling!!
     
    bugfinders likes this.