Jump to content

Unity to HTML5?


microgamer
 Share

Recommended Posts

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 by microgamer
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

image.thumb.png.914a569ea23f9184f19d1f40c5a79f1b.png

image.thumb.png.b6151cb8a16b2fa7f0204141f1f6dc89.png

image.thumb.png.2c3f997163a5c9c61c81984c8cf5f66e.png

 

Edited by ChrisSkyRo
Added another picture
Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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 by MrPancakes
Link to comment
Share on other sites

  • 3 weeks later...

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 by MrPancakes
Link to comment
Share on other sites

  • 1 month later...
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 ?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...