00:00
00:00
Newgrounds Background Image Theme

Burning78Omen34 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Unity3d WebGL Support

57,184 Views | 123 Replies
New Topic Respond to this Topic

Response to Unity3d WebGL Support 2019-06-03 04:55:34 (edited 2019-06-03 05:00:39)


Hi all.

If I am not wrong, every time I update the zip file of a HTML5 game, it seems that NG creates a new folder for it. This changes the reference of the data saved on the IndexDB, so the GAME PROGRESS IS LOST for all players (I think this applies to PlayerPrefs too).


How do you deal with this problem, guys?

Response to Unity3d WebGL Support 2019-06-13 14:32:25


Hi, @Junjo, good question. I personally haven't tried it, but I recall reading somewhere you can write a JavaScript wrapper around PlayerPrefs to use local storage, save it as a jslib library in the Plugins folder and call it from your scripts.

Probably something like this, with additional information.

If your try it, please post if it solves the problem, I'd also be interested in the result. So far I also relied just on PlayerPrefs and it'd be bad if they got wiped out with every little update.

Response to Unity3d WebGL Support 2019-06-18 03:58:07 (edited 2019-06-18 03:58:31)


I didn't found a way to make it work as is.

So finally I implemented an online-save system with an external server, using the newgrounds user-id to authenticate. The game saves a backup of the game-data in the server regularly, and if it founds that there is no local data at start-up, it downloads it from the server.

Response to Unity3d WebGL Support 2019-07-07 11:36:44 (edited 2019-07-07 11:43:09)


At 5/12/15 12:04 PM, PsychoGoldfish wrote:
Having problems with your Unity3D WebGL game? Please start here. If you've read through the wiki, searched Google, etc. and still haven't resolved your issue, feel free to ask a question here.


Although im a fan of unity and i ever prefer it over unreal engine (though i love both) I honestly think browser games are better made in javascript to reduce bloat (browser games are limited by browsers, they cant take as much resources as hdd games can)

Response to Unity3d WebGL Support 2020-01-10 12:15:32


Through testing this game on this site and itch.io, I've noticed a problem with my games resolution. In every resolution settings area I can think of (HTML5 build resolution, host site embed resolution, index file canvas, even my computer's registry tied to "DefaultCompany") I've set my game to 720 x 480. In the Unity editor and as a standalone Windows build, it displays at this correct resolution. However, when I upload the HTML5 build to this site or itch.io, it seems to be upscaled to 900 x 600, resulting in the game looking more blurry since it's still being rendered at the smaller, intended resolution. I have no clue how to fix it. Anyone have an idea of what might be going on?


Banner by @MigMoog

BBS Signature

Response to Unity3d WebGL Support 2020-01-10 12:33:39


At 1/10/20 12:15 PM, mayorDump wrote: Through testing this game on this site and itch.io, I've noticed a problem with my games resolution. In every resolution settings area I can think of (HTML5 build resolution, host site embed resolution, index file canvas, even my computer's registry tied to "DefaultCompany") I've set my game to 720 x 480. In the Unity editor and as a standalone Windows build, it displays at this correct resolution. However, when I upload the HTML5 build to this site or itch.io, it seems to be upscaled to 900 x 600, resulting in the game looking more blurry since it's still being rendered at the smaller, intended resolution. I have no clue how to fix it. Anyone have an idea of what might be going on?


I tried making a new Unity project and changing the resolution first and foremost, but the same problem happened. Based on that, I beliebe the problem doesn't have to do with the build file holding on to an older or default resolution setting.


Banner by @MigMoog

BBS Signature

Response to Unity3d WebGL Support 2020-01-10 13:16:56


At 1/10/20 12:15 PM, mayorDump wrote: Through testing this game on this site and itch.io, I've noticed a problem with my games resolution. In every resolution settings area I can think of (HTML5 build resolution, host site embed resolution, index file canvas, even my computer's registry tied to "DefaultCompany") I've set my game to 720 x 480. In the Unity editor and as a standalone Windows build, it displays at this correct resolution. However, when I upload the HTML5 build to this site or itch.io, it seems to be upscaled to 900 x 600, resulting in the game looking more blurry since it's still being rendered at the smaller, intended resolution. I have no clue how to fix it. Anyone have an idea of what might be going on?


I tried making a new Unity project and changing the resolution first and foremost, but the same problem happened. Based on that, I beliebe the problem doesn't have to do with the build file holding on to an older or default resolution setting.


And the solution isn't as simple as giving up and just setting the resolution to 900 x 600. Tried that, and it upscaled it even more. So it seems that Unity's publishing to HTML will always upscale the resolution. Has anybody else noticed this?? I can't find any solutions anywhere.


Banner by @MigMoog

BBS Signature

Response to Unity3d WebGL Support 2020-01-16 23:47:22 (edited 2020-01-16 23:48:22)


At 1/10/20 01:16 PM, mayorDump wrote:
At 1/10/20 12:15 PM, mayorDump wrote: Through testing this game on this site and itch.io, I've noticed a problem with my games resolution. In every resolution settings area I can think of (HTML5 build resolution, host site embed resolution, index file canvas, even my computer's registry tied to "DefaultCompany") I've set my game to 720 x 480. In the Unity editor and as a standalone Windows build, it displays at this correct resolution. However, when I upload the HTML5 build to this site or itch.io, it seems to be upscaled to 900 x 600, resulting in the game looking more blurry since it's still being rendered at the smaller, intended resolution. I have no clue how to fix it. Anyone have an idea of what might be going on?
I tried making a new Unity project and changing the resolution first and foremost, but the same problem happened. Based on that, I beliebe the problem doesn't have to do with the build file holding on to an older or default resolution setting.

And the solution isn't as simple as giving up and just setting the resolution to 900 x 600. Tried that, and it upscaled it even more. So it seems that Unity's publishing to HTML will always upscale the resolution. Has anybody else noticed this?? I can't find any solutions anywhere.


IDK, it sounds like you've already tried the only thing I know of that would affect WebGL builds but not standalone builds -- under Project Settings, pick Player on the left, within that window make sure the WebGL tab is selected, and open the Resolution and Presentation box where it has sizes. But if that's not working, the other thing you could maybe try is after you build the game then open the index.html file in a text editor and look for the gameContainer div near the end and set the width and height there? I guess it depends on exactly what's happening -- if the game's viewport is 900x600 while the game is still being rendered tiny at 720x480, or if it's showing up at 900x600 and scaled properly, or being rendered at 900x600 and cropped 'cuz the container is too small. Maybe you could do some sort of hack depending on that by screwing with the settings within Unity and in the html it generates, although figuring out the actual underlying problem would be a lot better.


My newsfeed has random GameDev tips & tricks

Response to Unity3d WebGL Support 2020-01-17 12:33:30


At 1/16/20 11:47 PM, 3p0ch wrote:
At 1/10/20 01:16 PM, mayorDump wrote:
At 1/10/20 12:15 PM, mayorDump wrote: Through testing this game on this site and itch.io, I've noticed a problem with my games resolution. In every resolution settings area I can think of (HTML5 build resolution, host site embed resolution, index file canvas, even my computer's registry tied to "DefaultCompany") I've set my game to 720 x 480. In the Unity editor and as a standalone Windows build, it displays at this correct resolution. However, when I upload the HTML5 build to this site or itch.io, it seems to be upscaled to 900 x 600, resulting in the game looking more blurry since it's still being rendered at the smaller, intended resolution. I have no clue how to fix it. Anyone have an idea of what might be going on?
I tried making a new Unity project and changing the resolution first and foremost, but the same problem happened. Based on that, I beliebe the problem doesn't have to do with the build file holding on to an older or default resolution setting.

And the solution isn't as simple as giving up and just setting the resolution to 900 x 600. Tried that, and it upscaled it even more. So it seems that Unity's publishing to HTML will always upscale the resolution. Has anybody else noticed this?? I can't find any solutions anywhere.
IDK, it sounds like you've already tried the only thing I know of that would affect WebGL builds but not standalone builds -- under Project Settings, pick Player on the left, within that window make sure the WebGL tab is selected, and open the Resolution and Presentation box where it has sizes. But if that's not working, the other thing you could maybe try is after you build the game then open the index.html file in a text editor and look for the gameContainer div near the end and set the width and height there? I guess it depends on exactly what's happening -- if the game's viewport is 900x600 while the game is still being rendered tiny at 720x480, or if it's showing up at 900x600 and scaled properly, or being rendered at 900x600 and cropped 'cuz the container is too small. Maybe you could do some sort of hack depending on that by screwing with the settings within Unity and in the html it generates, although figuring out the actual underlying problem would be a lot better.


Both "project build settings >webGL > resolution & presentation > resolution" and the gameContainer div in the .html file are set to the correct resolution. I tried downloading the most recent Unity alpha release, but found the same problem. Thanks though.


Banner by @MigMoog

BBS Signature

Response to Unity3d WebGL Support 2020-01-17 12:50:33


At 1/10/20 12:15 PM, mayorDump wrote: Through testing this game on this site and itch.io, I've noticed a problem with my games resolution. In every resolution settings area I can think of (HTML5 build resolution, host site embed resolution, index file canvas, even my computer's registry tied to "DefaultCompany") I've set my game to 720 x 480. In the Unity editor and as a standalone Windows build, it displays at this correct resolution. However, when I upload the HTML5 build to this site or itch.io, it seems to be upscaled to 900 x 600, resulting in the game looking more blurry since it's still being rendered at the smaller, intended resolution. I have no clue how to fix it. Anyone have an idea of what might be going on?


Turns out it was because Windows display settings had scaling set to 125%... The standalone build wasn't effected but the HTML5 one was. Figured it was a stupidly obvious solution.


Banner by @MigMoog

BBS Signature

Response to Unity3d WebGL Support 2020-02-22 11:57:23


At 6/3/19 04:55 AM, Junjo wrote: Hi all.
If I am not wrong, every time I update the zip file of a HTML5 game, it seems that NG creates a new folder for it. This changes the reference of the data saved on the IndexDB, so the GAME PROGRESS IS LOST for all players (I think this applies to PlayerPrefs too).

How do you deal with this problem, guys?


If you're using PlayerPrefs, it unfortunately loses everyone's save data when you post an update to your game.


I came up with a solution to the problem, and if you implement it then the save data will be wiped out when this update is incorporated but will be kept when you make any more updates in the future. It would be perfect if you haven't published yet and would like to make changes in response to user comments when you do publish, but might still be useful for an already published game if you're planning to make periodic updates in the future. To make this easier for Unity devs to find from the forums, I'll post this link to my news feed post describing the solution which is too big to just post here in the forums.


My newsfeed has random GameDev tips & tricks

Response to Unity3d WebGL Support 2020-04-09 05:00:08 (edited 2020-04-09 05:00:20)


At 2/22/20 11:57 AM, 3p0ch wrote:
At 6/3/19 04:55 AM, Junjo wrote: If I am not wrong, every time I update the zip file of a HTML5 game, it seems that NG creates a new folder for it. This changes the reference of the data saved on the IndexDB, so the GAME PROGRESS IS LOST for all players (I think this applies to PlayerPrefs too).

How do you deal with this problem, guys?
If you're using PlayerPrefs, it unfortunately loses everyone's save data when you post an update to your game.

I came up with a solution to the problem, [...]


So, the sort answer is that it is the PlayerPrefs implementation witch depends on the url, but not the whole idb thing... so I should stop using playerprefs and write directly to a fixed path of the idb instead.

Thank you! I will give it a try.

Response to Unity3d WebGL Support 2020-05-13 10:43:01


Hi all,

I am using Unity 5.6.7 since I am working on an old project.


I just released an alpha of my game on Newgrounds and it worked fine on microsoft edge, but when I try to play in Chrome I get the error:

Uncaught RangeError: Maximum call stack size exceeded

Then in the console I get:

Uncaught TypeError: Module.asm is not a function
    at Object.af4dbdc15471931d8f432589f5f6ec11 (642b0882-a52a-4751-8b70-fd55b80e6170:4)
    at UnityLoader.loadCode.Module (UnityLoader.js:1)
    at HTMLScriptElement.o.onload (UnityLoader.js:1)

Does anyone have any experience with this problem or have any idea on how to fix it?

Response to Unity3d WebGL Support 2020-05-14 19:49:19


At 5/13/20 10:43 AM, DaviantG wrote: Hi all,
I am using Unity 5.6.7 since I am working on an old project.

I just released an alpha of my game on Newgrounds and it worked fine on microsoft edge, but when I try to play in Chrome I get the error:
Then in the console I get:
Does anyone have any experience with this problem or have any idea on how to fix it?


UPDATE: I have managed to fix the issue by randomly changing the setting for WebGL. By changing enable exceptions from "Full" to "Explicitly Thrown Exceptions Only" the game works.


With "None" exceptions enabled I managed to get through 2 menu scenes before an exception error appeared.


If anyone ever finds out why this happens I would appreciate an update. Thanks in advance, I hope that this helps someone.

Response to Unity3d WebGL Support 2020-06-22 15:38:28 (edited 2020-06-22 15:39:28)


At 3/28/18 05:25 AM, JmPrsh153 wrote:
At 5/12/15 12:04 PM, PsychoGoldfish wrote: Having problems with your Unity3D WebGL game? Please start here. If you've read through the wiki, searched Google, etc. and still haven't resolved your issue, feel free to ask a question here.
i have made a post here about my recent game build :/ please help! https://www.newgrounds.com/bbs/topic/1430847


Doesn't work can't even log in, did everything mentioned to the last letter and double/triple checked over six hours of testing. Can only test on NG with the preview build if that makes a difference.


PSD

Response to Unity3d WebGL Support 2020-06-22 15:56:36


At 6/22/20 03:38 PM, BlueStarGeneral wrote:
At 3/28/18 05:25 AM, JmPrsh153 wrote:
At 5/12/15 12:04 PM, PsychoGoldfish wrote: Having problems with your Unity3D WebGL game? Please start here. If you've read through the wiki, searched Google, etc. and still haven't resolved your issue, feel free to ask a question here.
i have made a post here about my recent game build :/ please help! https://www.newgrounds.com/bbs/topic/1430847
Doesn't work can't even log in, did everything mentioned to the last letter and double/triple checked over six hours of testing. Can only test on NG with the preview build if that makes a difference.

PSD


I put it into lateupdate also to make sure the packet doesn't go missing, that runs on my game at 200FPS, still no connection. I'm not blaming anyone as getting this to work with unity stuff isn't easy but ...just dis-appointing....I really wanted scoreboards and to add to the NG website.


void LateUpdate()

{


if(!executed && ngio_core)

{


// Do this after the core has been initialized

ngio_core.onReady(() => { 


// Call the server to check login status

ngio_core.checkLogin((bool logged_in) => {


if (logged_in) 

{

OnLoggedIn();

executed = true;

}

else 

{

/*

* This is where you would ask them if the want to sign in.

* If they want to sign in, call requestLogin()

*/

}

});

});


}


}

Response to Unity3d WebGL Support 2020-06-22 19:03:11 (edited 2020-06-22 19:07:12)


At 6/22/20 03:56 PM, BlueStarGeneral wrote: void LateUpdate()
{

if(!executed && ngio_core)
{

// Do this after the core has been initialized
ngio_core.onReady(() => { 

// Call the server to check login status
ngio_core.checkLogin((bool logged_in) => {

if (logged_in) 
{
OnLoggedIn();
executed = true;
}
else 
{
/*
* This is where you would ask them if the want to sign in.
* If they want to sign in, call requestLogin()
*/
}
});
});

}

}


I didn't try your code, but by the look of it, it'd make sense why it doesn't work if the player is logged out, or in Unity.

"ngio_core.checkLogin / bool logged_in" will be false when you open the Editor, and since the "else" branch is empty, the code does nothing.


You need to actually call the commented-out ngio_core.requestLogin function (with the callbacks if you want – e.g. set the 'executed' bool to true in the first one), which will open the browser and tell you to log in (or grant permission).


I'd take a look at the visual guide by GeckoMLA19097 if you get stuck. It's fairly detailed and shows all the code you need to set up a basic working medal / scoreboard system.


I think you don't need to deal with the login bit either, if you don't want to. It only gives logged-out players an option to sign in and makes sure you can test the medals and score directly from Unity.

If you don't need that, the rest should work for logged-in players on NG nevertheless. Assuming the ngio_core has been initialised (is "ready"), this should work fine:

public void PostScore(int score)
{
	var scoreboard = new io.newgrounds.components.ScoreBoard.postScore
	{
			id = SCOREBOARD_ID,
			value = score
	};
	scoreboard.callWith(NGIO_CORE, OnScorePost);
}

void OnScorePost(postScore post)
{
	Debug.Log($"Post '{post.score.formatted_value}' score to scoreboard '{post.scoreboard.name}'.");
}

Response to Unity3d WebGL Support 2020-06-22 19:07:39


At 6/22/20 07:03 PM, RaIix wrote:
At 6/22/20 03:38 PM, BlueStarGeneral wrote: Can only test on NG with the preview build if that makes a difference.
So, it works on NG, but not in the Unity Editor?
(Because it'd make sense – you're logged in on NG, but not in the Editor which needs to be granted the permission first.)

At 6/22/20 03:56 PM, BlueStarGeneral wrote: void LateUpdate()
{

if(!executed && ngio_core)
{

// Do this after the core has been initialized
ngio_core.onReady(() => { 

// Call the server to check login status
ngio_core.checkLogin((bool logged_in) => {

if (logged_in) 
{
OnLoggedIn();
executed = true;
}
else 
{
/*
* This is where you would ask them if the want to sign in.
* If they want to sign in, call requestLogin()
*/
}
});
});

}

}
I didn't try your code, but by the look of it, it'd make sense why it doesn't work in the editor.
"ngio_core.checkLogin / bool logged_in" will be false when you open the Editor, and since the "else" branch is empty, the code does nothing.

You need to actually call the commented-out ngio_core.requestLogin function (with the callbacks if you want – e.g. set the 'executed' bool to true in the first one), which will open the browser and tell you to log in (or grant permission).

I'd take a look at the visual guide by GeckoMLA19097 if you get stuck. It's fairly detailed and shows all the code you need to set up a simple medal / scoreboard system.

I think you don't need to deal with the login bit either, if you don't want to. It only gives logged-out players an option to sign in and makes sure you can test the medals and score directly from Unity.
If you don't need that, the rest should work for logged-in players on NG nevertheless. Assuming the ngio_core has been initialised (is "ready"), this will work fine:


I've just uploaded 'Dust star Speedway' which uses the code. It does upload scoreboards, in a strange format, I tried using milliseconds relative to 1000f and 60f but displays odd results if you check the game it says 'Logged out' as thats the check for the above code. Either way it is functional, but testing it in the preview build is an issue. Like I said Getting this to work with Unity's stuff won't be all that easy but, I'm still a big believer in browser based games and NG!


PSD

Response to Unity3d WebGL Support 2020-11-08 12:46:08 (edited 2020-11-08 12:47:01)


I've been having an issue with inputs reacting differently in webgl builds vs preview. Mouse sensitivity is way higher in webgl builds (which is apparently because webgl mouse sensitivity is 2x?), while my xbox one right analog stick sensitivity is much, MUCH slower than in preview. Also, in unity 2019 builds my triggers would work in editor but not in webgl build, but in 2020 the triggers function in webgl, but inverted. It's just a lot of really strange differences, does anyone know how I can set up my project in Unity to behave the same as when I export to webgl? Right now I have the sensitivity cranked up for the right analog stick, making it hard to move the camera in the editor. I hate having to keep changing the input settings when I want to make changes and when I export.


Also, the current unity wiki has javacode in it, but didn't they switch to c# only? I can't create .js files in unity.


BBS Signature

Response to Unity3d WebGL Support 2020-11-08 14:36:24


At 11/8/20 12:46 PM, larrynachos wrote: I've been having an issue with inputs reacting differently in webgl builds vs preview. Mouse sensitivity is way higher in webgl builds (which is apparently because webgl mouse sensitivity is 2x?), while my xbox one right analog stick sensitivity is much, MUCH slower than in preview. Also, in unity 2019 builds my triggers would work in editor but not in webgl build, but in 2020 the triggers function in webgl, but inverted. It's just a lot of really strange differences, does anyone know how I can set up my project in Unity to behave the same as when I export to webgl? Right now I have the sensitivity cranked up for the right analog stick, making it hard to move the camera in the editor. I hate having to keep changing the input settings when I want to make changes and when I export.

Also, the current unity wiki has javacode in it, but didn't they switch to c# only? I can't create .js files in unity.

While I don't know how to pull off a really elegant solution and address the underlying problem of why WebGL behaves differently than preview, there's a kludgey approach that might work -- use conditional compilation. After Ralix suggested it for my code to make PlayerPrefs not lose save data, I incorporated it into this code to make it only run with a WebGL build and not in preview mode, so you could probably adapt that approach to your purposes. You would set up a script like the one I showed and give it functions to multiply the mouse or stick input by a conversion factor depending on whether you're in preview or a WebGL build, and then in all of your other scripts that read input from the mouse or stick make it call that function. Something like

#if UNITY_EDITOR
public static class FixInput {
  public static StickControl ScaleStick(StickControl rightStick) {
    rightStick.x *= previewScaleFactor;
    rightStick.y *= previewScaleFactor;
    return rightStick;
  }
}
#elif UNITY_WEBGL
public static class FixInput {
  public static StickControl ScaleStick(StickControl rightStick) {
    rightStick.x *= webGLScaleFactor;
    rightStick.y *= webGLScaleFactor;
    return rightStick;
  }
}
#endif

and then have the rest of your code use FixInput.ScaleStick(rightStick); with a similar scaling function for the mouse in another function called ScaleMouse within the FixInput classes. I admit I haven't used gamepads in Unity and haven't actually tested that out so it will probably need tweaking (which you should be able to do if you've written code implementing gamepad input), but I think it might work and that's how I would approach it unless anyone knows a better way of fixing the underlying issue with Unity handling input in preview vs WebGL.


My newsfeed has random GameDev tips & tricks

Response to Unity3d WebGL Support 2020-11-18 15:48:16 (edited 2020-11-18 15:49:44)


Hello!

we want to upload the game. but it has been rejected several times by moderators.

we have carefully read the rules and found that things could prevent.and made a new version.

but the new version was also not missed.

I wrote to the support service to understand exactly what our error is - but no one answers me.

please tell me, who i can ask for help in this case?

Response to Unity3d WebGL Support 2021-04-26 01:56:48


Using Unity 2021.1, I tried exporting to HTML5 with gzip compression, and uploading to NG. When loading it had an error due to a missing Content-Encoding: gzip header. Would be nice to have that since it seems to be the default setting in 2021.1 now.


Also there's a brotli compression that is default in Unity too. Would be nice to handle that as well. Itch handles the gzip but not the brotli right now.


BBS Signature

Response to Unity3d WebGL Support 2021-04-28 07:56:57 (edited 2021-04-28 08:07:12)


At 4/26/21 01:56 AM, Foolmoron wrote: Using Unity 2021.1, I tried exporting to HTML5 with gzip compression, and uploading to NG. When loading it had an error due to a missing Content-Encoding: gzip header. Would be nice to have that since it seems to be the default setting in 2021.1 now.


Yup. I checked with a default project in 2021.1.


iu_290363_4428769.png


But I think "gzip" compression was always the default (I checked with an older, 2019.4 LTS project), it just used to create a different set of files.

This is the same exact project with the same exact settings, in 2019.4 (here) and then in 2021.1 (here).


iu_290364_4428769.png


If anyone else stumbles upon this looking for a solution – a workaround is to disable compression altogether in Project Settings (build here), although that's not quite ideal.


iu_290365_4428769.png

Response to Unity3d WebGL Support 2021-06-11 20:22:37


@Foolmoron

@RaIix


Gzip compression should now work. Will you test it and let me know?

Response to Unity3d WebGL Support 2021-06-11 20:31:24


@Foolmoron

@RaIix


Also, Brotli compression should work if you want to try that too.

Response to Unity3d WebGL Support 2021-06-12 07:41:29 (edited 2021-06-12 07:46:41)


At 6/11/21 08:22 PM, BrentHeMan wrote: Gzip compression should now work. Will you test it and let me know?
Also, Brotli compression should work if you want to try that too.


Thanks, Bren, that's awesome! It works perfectly.

I tried building the Starter Assets third person character scene in Unity 2021.2.0a20 just so I can do it quickly multiple times (three times, averaged; specifically) if anyone is interested in some stats for comparison:


Build times (2nd and subsequent builds since the first one takes the longest time)

Uncompressed        ...        66 seconds
Gzip                ...       153 seconds
Brotli              ...       182 seconds

Build folder size

Uncompressed        ...        48.7 MB (22.6 MB zipped)
Gzip                ...        22.2 MB (22.2 MB zipped)
Brotli              ...        19.0 MB (19.0 MB zipped)

Load times on Newgrounds

Uncompressed        ...        43.0, 31.8, 38.7 seconds (~37.8 s average)
Gzip                ...        21.7, 17.4, 15.6 seconds (~18.2 s average)
Brotli              ...        14.2,  8.7, 15.3 seconds (~12.7 s average)


And reloading the Brotli preview (so that caching gets a chance) was almost instant, so I'm now quite optimistic it will be a boon to more complex projects as well.

Thank you!

Response to Unity3d WebGL Support 2021-06-12 16:45:57


At 6/12/21 07:41 AM, RaIix wrote: Thanks, Bren, that's awesome! It works perfectly.


Awesome good to hear. Thank you for running these tests!

Response to Unity3d WebGL Support 2021-06-13 01:21:05


Yup brotli works great for mine too. Went from 5.6mb to 4.4mb!


BBS Signature

Response to Unity3d WebGL Support 2021-09-22 06:18:00


Hey everyone, check it out I made this.


https://www.newgrounds.com/projects/games/1750467/preview/filetype/2


Open source too, so if I've done something all shit-like, as I do, feel free to make a pull request

Response to Unity3d WebGL Support 2021-11-14 11:19:35 (edited 2021-11-14 11:30:16)


Hello folks, I just uploaded a silly game. The upload score is working fine but the in game score display is broken, can someone review my code and see what could possible be wrong? Thanks in advance.

   void OnScoresLoaded(io.newgrounds.results.ScoreBoard.getScores result)
   {
       if (result.success)
       {
           Debug.Log("Score loaded succefully");
           for (int i = 0; i < 100; i++)
           {
               string text = "" + (i+1);
               if ( i < result.scores.Count)
               {
                   io.newgrounds.objects.score score = (io.newgrounds.objects.score)result.scores[i];
                   text += " " + score.user + " " + score.value;
                   Debug.Log(score.user + "" + score.value);
               }
               else
               {
                   text += " -";
               }
               content.transform.GetChild(i).GetComponent<TextMeshProUGUI>().text = text;

           }
       }
       else
       {
           Debug.Log("Can't Load Scoreboard");
       }
   }
   public void LoadScore(string period)
   {
       io.newgrounds.components.ScoreBoard.getScores getScores = new io.newgrounds.components.ScoreBoard.getScores();
       getScores.id = thenumber;
       getScores.period = period;
       getScores.callWith(ngioCore, OnScoresLoaded);


   }