darthdeus

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

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.

Share this post


Link to post
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?

Share this post


Link to post
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:

 

Share this post


Link to post
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)

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
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))

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.