microgamer Posted May 6, 2021 Share Posted May 6, 2021 (edited) I'm currently buying games and see some nice Unity titles that are exported to WebGL and this format isn't good for mobile so what's the process of converting Unity to HTML5 is it a major undertaking or something that's actually feasible? I did some more reading and the formats are a bit confusing as this guide from Unity states: "Unity’s WebGL build allows you to render 2D and 3D graphics in a web browser without the need for additional tools or plug-ins." - So why isn't this working in mobile?https://learn.unity.com/tutorial/how-to-publish-for-webgl# Edited May 6, 2021 by microgamer Quote Link to comment Share on other sites More sharing options...
b10b Posted May 6, 2021 Share Posted May 6, 2021 Clearly anything on Unity's website will say how easy and perfect it all is, no effort needed to target all the platforms under the sun, past present and future - it's Unity! Why not come at it the other way around? First identify what makes a good mobile web game. Then identify what aspects of the Unity featureset or WebGL export fails that list. Quote Link to comment Share on other sites More sharing options...
microgamer Posted May 7, 2021 Author Share Posted May 7, 2021 14 hours ago, b10b said: ..Then identify what aspects of the Unity featureset or WebGL export fails that list. I appreciate your comment, but I'm not sure how it related to porting Unity to HTML5? As far as my undertanding WebGL doesn't work on mobile devices and that would be the first thing to tackle (porting to HTML5 or some hack) Quote Link to comment Share on other sites More sharing options...
ChrisSkyRo Posted May 7, 2021 Share Posted May 7, 2021 (edited) Unity's official position is that WebGL isn't compatible with mobile devices. However, it does work on quite a few, depending on how advanced the features it's using are. There isn't any way to convert a Unity project to HTML5 (or at least I don't know any) because Unity is a 3D engine at it's core and in order to make it work in browser, WebGL is the best (and possibly the only) solution. If you're planning on specifically targeting mobile browsers, Unity isn't a good solution. The only way to "convert" a Unity game to html would be to actually remake it in a different engine or framework. Edited May 7, 2021 by ChrisSkyRo Added another picture Quote Link to comment Share on other sites More sharing options...
b10b Posted May 7, 2021 Share Posted May 7, 2021 8 hours ago, microgamer said: I appreciate your comment, but I'm not sure how it related to porting Unity to HTML5? As far as my undertanding WebGL doesn't work on mobile devices and that would be the first thing to tackle (porting to HTML5 or some hack) I was skipping ahead ... As @ChrisSkyRo explains very well, there's technically little preventing it working (eventually as the export improves, or mobile devices get better). But that doesn't mean to say that a game designed without the-web-first-in-mind and then exported to WebGL / Wasm is going to be an optimal web experience (user, technical, or commercial). This gap is further widened by mobile web characteristics / constraints. If the goal is to mimic the same content that's already available in an app store, but with the performance overhead of a browser, and the reduced monetization options offered by the walled gardens, then I'd question the advantage? Whereas the mobile web games that flourish typically offer something that is beyond what is currently considered a regular mobile game (i.e. apps). So overall I'm of the opinion it's a question of strategy rather than technicalities (at least for now). A related debate is whether anyone would use Unity to create a website / SPA. Certainly possible, but a questionable choice perhaps? Quote Link to comment Share on other sites More sharing options...
MrPancakes Posted May 10, 2021 Share Posted May 10, 2021 (edited) The Unity WebGL port eat's RAM for breakfast and it is hard to optimize a Unity game for WebGL these days. You can make it run well enough for a desktop browser but the mobile ones can struggle as it is not powerful enough. My take on Unitys current WebGL port is: Works good enough for desktop browser Reliability on a mobile browser is not stable enough for a good player experience You can not port a game from Unity to HTML5 without re-writing it yourself. Edited May 10, 2021 by MrPancakes Quote Link to comment Share on other sites More sharing options...
microgamer Posted May 13, 2021 Author Share Posted May 13, 2021 Thanks to you all for the detailed info, for now I have ditched the Unity project as it became too complex to port. MrPancakes 1 Quote Link to comment Share on other sites More sharing options...
MrPancakes Posted May 31, 2021 Share Posted May 31, 2021 (edited) Just want to highlight that Unity will bring some great changes for WebGL in there 2021.2 build. With greatly reduced WebGL builds some claim on the forum going from 2.4 Mb to 9 Mb And according to jukka_j: According to preliminary benchmarks, build sizes are shrunk by about ~-10%, build times are reduced by ~-40%, and memory usage is reduced by about ~-8%. They are also working on mobile support for WebGL builds. Edited May 31, 2021 by MrPancakes MeltdownInteractive 1 Quote Link to comment Share on other sites More sharing options...
Cyberfit Posted June 3, 2021 Share Posted June 3, 2021 We've built a Unity extension and SDK here at Trail specifically to make Unity WebGL export work flawlessly. Currently desktop only, but we've had successful mobile tests and will develop that in the not too distant future. Quote Link to comment Share on other sites More sharing options...
MeltdownInteractive Posted July 6, 2021 Share Posted July 6, 2021 On 6/1/2021 at 5:38 AM, MrPancakes said: Just want to highlight that Unity will bring some great changes for WebGL in there 2021.2 build. With greatly reduced WebGL builds some claim on the forum going from 2.4 Mb to 9 Mb And according to jukka_j: According to preliminary benchmarks, build sizes are shrunk by about ~-10%, build times are reduced by ~-40%, and memory usage is reduced by about ~-8%. They are also working on mobile support for WebGL builds. For the me the 40% reduction in build time would be the best thing since sliced bread, my game currently takes 12-15 minutes to build ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.