Jump to content

How good is Unity's WebGL export and is it worth using it solely for HTML5 gamedev?


darthdeus
 Share

Recommended Posts

I have some experience with desktop gamedev with Unity and MonoGame, and only now getting onto the HTML5 train. In the past 2-3 years it seemed that Unity's WebGL support wasn't that great.

Which brings me to my question, is Unity any good for HTML5 game development? Or is it still sort of experimental feature?

I was kinda surprised not to see a Unity section in this forum, which kinda prompted me to ask.

Link to comment
Share on other sites

1 hour ago, Pryme8 said:

Jk, welcome to the forum.  Unity has it pros and cons, but if your looking for a powerful lightweight webGL lib check out the above.

Actually quite the opposite hehe. I don't have any interest in WebGL, or 3D for that matter. I do have experience with 3d graphics programming and general graphics algorithms and opengl, but as a solo gamedev it always feels like exponential increase in complexity for not that much gain, at least not for me since I'm not planning on making big fancy games. 2d games is my thingy.

The reason I stuck with Unity is mainly because of the editor. I love how you can play the game and then pause, switch to the editor and inspects the objects live without any downside. That's probably the biggest reason why I'm using it.

I tried GameMaker and really disliked GML, also tried Construct 2 and it felt even worse. Then tried Phaser, but it felt like Unity without the editor and a worse language :P Then tried Pixi, which felt like Node.js style development of "bring your own library for everything". I'm not really a big fan of putting together 20 half-baked libraries.

Sorry for the whiny reply :D Any thoughts?

Link to comment
Share on other sites

5 hours ago, darthdeus said:

I love how you can play the game and then pause, switch to the editor and inspects the objects live without any downside.

You can more or less do that with a javascript library in the browser developer tools.  Set breakpoints... inspect code and you don't even need to switch to the editor!! I have been programming professionally in Visual Studio since c# was in beta, so do see what you are comparing to.  I like the Unity Editor and the ecosystem.  I think you will find these forums biased one way and Unity forums another.  Good luck choosing!
If you want to export Unity to HTML5 check out this post from last month:

 

Link to comment
Share on other sites

Maybe have a look at Cocos Creator. That seems to be the closest thing to Unity, has javascript/typescript/lua bindings, and is optimized for 2D graphics.
(even though I would just keep using Unity, as the wasm export will probably become the best option anyway)

Link to comment
Share on other sites

I make multi platform single defence game.

So for me Unity is a good solution. 

Now I'm just porting my game to WebGL, next would be mobile and than steam.

Unity WebGL will not be good to work immediately. It take me over 3 full time work weeks to make stable 30-60fps.

 

So if you want publish your game on different platforms choose unity.

If you only interesting in WebGL build Unity is bad variant.

Link to comment
Share on other sites

Hey! 

I believe I can help you form an opinion here. I made an IO game solely for Web Purpose using Unity (took Webgl Export)

Goods -->

Pretty fast development. 

I do have an option to port it to native mobile app now.

The game is working fine in its present form.

Cons-->

Can not add more graphics as Unity is very heavy in loading assets in webgl. I essentially have to add most graphics in preload which increases the loading time very heavily. I see other frameworks like pixi and phaser handling the assets much better and keeping game lighter.

So with Unity I am pretty stuck now because I can not add many more features because it becomes very heavy to run on browser while it is just 2d.

Although I can very easily bring up a mobile version which can have more features and graphics and leave my web version at this point.

So you need to choose your priorities.

Link to comment
Share on other sites

1 hour ago, sgarg said:

Can not add more graphics as Unity is very heavy in loading assets in webgl. I essentially have to add most graphics in preload which increases the loading time very heavily. I see other frameworks like pixi and phaser handling the assets much better and keeping game lighter.

What problem with loading asset do you have?

Are you trying to load one asset from assetbundle per frame? 

For me it works good if I load 1-3mb asset bundle in runtime in such method.

Link to comment
Share on other sites

1 hour ago, hromoyDron said:

What problem with loading asset do you have?

Are you trying to load one asset from assetbundle per frame? 

For me it works good if I load 1-3mb asset bundle in runtime in such method.

Do you know how can we unload the asset from memory . Or every asset we load always stays in memory/

Can I maybe see your game. Never saw a webgl game with unity with good number of assets!

Link to comment
Share on other sites

30 minutes ago, sgarg said:

Do you know how can we unload the asset from memory . Or every asset we load always stays in memory/

Can I maybe see your game. Never saw a webgl game with unity with good number of assets!

 

I use

yourBundle.Unload(true);

But I still set 512 memory in publish setting, because working exactly on bundle loading. Unloading and memory optimisation would be a next step.

I can show optimising build of my game later. Now it's still in phase of optimisation and testing. But if you want you can look Not stable build with errors))

Link to comment
Share on other sites

I'd vote for Cocos Creator. It's a 2D game editor, its web mobile build is really small in terms of file size (the engine code itself is roughly 1.6 mb, the rest is your game assets and game code), and you can easily port it to other such as native desktop or mobile. This may be what you need.

Link to comment
Share on other sites

  • 6 months later...

Sooooo, I run a site which is all about hosting WebGL games (specifically, we just do Unity right now)... SIMMER.io

Pros for Unity + WebGL:

  • Amazing game engine and development pipeline - used commercially for thousands of commercial products such as Super Mario Run, Cuphead, Deus X, etc etc etc.
  • Pretty much a one click export to WebGL.
  • They are pretty good with updating the engine to support new features as they come out (WebGL2, shaders, etc)

Cons for Unity + WebGL:

  • Does not run well on mobile devices (yet)
  • If you have a WebGL only bug it could be pretty damn difficult to track down (no source maps, etc).
  • The output is not exactly lightweight. I think the smallest possible project clocks in at 1MB (but I would have to test this)
  • Unity is not open source.

Also important to note:

  • Unity used to support "Javascript" (really a fake typed bastardization of Javascript). Code for unity is now written in C#. This could be a pro or a con depending on your experience :-).

Anyway thanks for reading and come check out some Unity WebGL games on SIMMER like boo-om (WebGL2), Rapid road or some weird Swedish version of bowling.

Link to comment
Share on other sites

  • 2 months later...

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...