Search Unity

Web GL better than Web Player?

Discussion in 'Scripting' started by RoMax92, Jul 26, 2017.

  1. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    Hi, i want to create a web game for all platforms (PC, Android, iOS, etc),
    I just tried Web GL, and it works perfectly in all pc browsers, but on mobiles it's very slow, don't always run, and always pop up an allert, that says web GL is not supported by phones.
    I use Unity 5.6.2f1, and i know the build options for Web Player was removed in Unity 5.4, but why? Web GL is better than that? Doesn't exist another option for export a game direclty in HTML5?

    Thanks a lot for the support
     
  2. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Web Player doesn't work in Chrome. WebGL is slow on a mobile device. You are trying to find a one size fits all solution. I do not think that really exists. Remember, html5 is essentially Javascript (in browser) You are at the mercy of what the interpreter uses on the device. If you use a slow interpreter, you get slow performance.

    Your best bet it to build to the platform that you are working on. So, if you are building to a PC, use the standard player. Mac, use the player for a mac, android use the android builder and so on. Do not try to shoe horn your project into one export method.
     
    Kiwasi and RoMax92 like this.
  3. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    Ok, but how? If i export for Android, Unity Export an APK, so how can i run it on web player?
     
  4. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    You don't. You run it as a native Android app.

    This is the general trend in web gaming. No one wants to install and manage a bunch of plugins when the spec has progressed enough to include the functionality right in the various frameworks. This (and security vulnerabilities) is why Adobe is discontinuing Flash and why Unity doesn't use their own browser plugin anymore.
     
    Kiwasi and RoMax92 like this.
  5. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    So there are any ways to develop in Unity a game for web mobile use?
     
    Last edited: Jul 26, 2017
  6. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    I don't see a compelling reason as to why you would want to do that honestly.
     
  7. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    Building an app for Android or iOS is better than a web app that you try to run in a mobile browser. While webGL is improving, you're still going to get better performance out of an app then a mobile web experience. It's also likely to give your user a better experience.
     
  8. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    I know, my boss ask me that for work. We want a method to display in any device and in any browser a web based game with good performance.
    Maybe the best method for do that is in HTML5, but i prefer to develop in Unity, and maybe export in HTML in some way...
     
  9. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    I mean - sometimes the answer to management is "this really isn't a good idea". And that's okay. :)
     
  10. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    But that's what WebGL is for, isn't it? If you have performance issues, you might need to investigate which part is causing the problem. (Hint: use the Profiler).
     
  11. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    While we would hope it will get there, webGL isn't the issue. Most mobile browsers (and even mobile devices) just don't handle webGL content very well. And in many cases, the browsers lack support for the newer tech that will actually allow for better performance from webGL content.

    In this case, it's not a webGL issue. It's the browsers needing to be updated for the tech.
     
  12. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    Mobile WebGL support always lags more behind every other option. It will be worse than native app performance, any desktop WebGL browser which supports it at all, and there's no guarantee you'll have more than WebGL1 available.

    You already have cross-platform support in Unity - adding the web platforms also adds even more limitations than you already have with mobile. Networking and local storage can get weird, for instance. WebGL is great for desktop demos and previews, but mobile devices are already limited enough before you add the even more sandboxed environment of web browsers.
     
    Kiwasi likes this.
  13. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Mobile browsers aren't optimized for or intended for games. Your game would have to be extremely simple to perform consistently well across an array of mobile devices and mobile browsers. With built in support for standard mobile platform apps, you can also be sure that the Unity developers and QA teams are not thoroughly testing WebGL on mobile platforms, at least anywhere near the extent as on desktop.
     
  14. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    How can i know that?
     
  15. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    I found an alternative to Unity to develop in HTML5, it's Play Canvas, very similar to Unity and dedicated only for HTML5!
     
  16. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Yeah, I was not going to be the one to tell you Unity probably was not the engine you wanted to work with. Play Canvas is pretty neat though. I tinkered with it a few years ago. If I remember it uses pure ecma6 javascript