Search Unity

Bugs in Chrome: Stuttering and JavaScript error on reloading page

Discussion in 'Web' started by Birkeman, Jul 2, 2015.

  1. Birkeman

    Birkeman

    Joined:
    Apr 22, 2013
    Posts:
    21
    We are in the middle of porting a mobile title to the web for a client and have tried to use WebGL to get the game to run in Chrome. We can run the game but experience a large lag spike when gameplay starts. It seems to be slightly related to providing input to the game, maybe triggering physics and collision calculations or playing back audio from collisions but we have also seen it when the game is just running on its own. I have also tried to build the game both with Unity 5.0.1 and 5.1.1 to see if that would make a difference but it did not have an impact. There is a good chance the problem is caused by an exception being thrown since we can't get the build to run if we don't have exceptions enabled.

    We also get a JavaScript error alert when reloading the page. I have uploaded a screenshot of that.

    These bugs only happen in Chrome. On Firefox the game runs perfectly but of course it's Chrome we want to support with WebGL.

    Since it is client work I can't share that much more here but if someone from Unity wouldn't mind taking a look we can send you a copy of the project.
     

    Attached Files:

    Last edited: Jul 2, 2015
  2. PlatformSix

    PlatformSix

    Joined:
    Feb 27, 2014
    Posts:
    57
    I also get a lot of stuttering right at the start of my projects... Not sure about the exceptions issue you're running into, but part of it may be related to decompression or parsing. Does the stuttering occur when using the Release (not Compressed) folder built with Optimization level Slow (fast builds)?

    The error screenshot does suggest something related to input too as you said, with registerMouseEventCallback...
     
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    We fixed a similar issue in 5.1.1p1 (http://unity3d.com/unity/qa/patch-releases). You may want to try that version instead.
     
  4. Birkeman

    Birkeman

    Joined:
    Apr 22, 2013
    Posts:
    21
    Thanks! just did a build with the p1 release and it solved the reload error. Still have the lag spike though.

    Unfortunately I get a "dead tab" error when the build is not set to slow builds.
     
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Have you tried to look at it with the profiler ? Perhaps you are just instantiating some objects ?
     
  6. Birkeman

    Birkeman

    Joined:
    Apr 22, 2013
    Posts:
    21
    I can't get it to connect to the player (with autoconnect enabled in build settings) and we don't have that lag spike on editor/webplayer/standalone/mobile builds.
     
  7. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    any error in the browser console ?
    what's your OS / Browser ?
     
    Last edited: Jul 2, 2015
  8. Birkeman

    Birkeman

    Joined:
    Apr 22, 2013
    Posts:
    21
    Oh hey Marco first realised it was you now :) No I don't get anything in the browser console even with full exceptions enabled.

    So jeah just to reiterate we can only get the build to run when we do a slow optimized build, exceptions are enabled and we then have stuttering without any exceptions.
     
  9. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Hey Alexander...so regarding the profiler I would suggest you give it a try with an empty project. For the exception, would you be able to reproduce the problem with a small project so that we could look at it ?
     
  10. Birkeman

    Birkeman

    Joined:
    Apr 22, 2013
    Posts:
    21
    The exception is fixed now by applying the p1 patch build. I'll see if we have time to create a test case for the stuttering issue.

    When I make a build from a clean project to test profiling I get a JavaScript alert saying there's a syntax error about an unknown number.
     
  11. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    we just release a new patch today (5.1.1p3), you can try to see if that helps.