I’m almost done with a huge project I’m working on. Finally we’re hitting the end of the project to finalise a nice visualisation of a 24 square km landscape which is being modified in the years ahead in real life.
However, the standalone of the project works like a charm, even on 4 year old computers and lower quality selection at the beginning, but the webplayer is a crashfest.
While there ain’t error in my opinion nor I can find one and looking at the crash reports it seams there is a memory limit. Removing a couple terrains ( 6 of the 24 ) I have the webplayer run fine. However if I try to not fly over the landscape but walk and switch controllers it instandly crashes.
Still standalone works like a charm if I run the whole project in an extreme graphics simulation. However with the far scaled down graphics it still just crashes the webplayer.
My question would be if there is a limit in RAM use where the webplayer stops loading and just instandly crashes? I did a search in the documentation, reference and google but I can’t find if there is a limit. There is no place where limitations on machine resources usage of the webplayer is documented.
Could someone tell more about this, I did hit a wall here which I can’t break down.
We encountered a similar problem when switching our project to a WebPlayer based distribution…
It ended up being a different case with different browsers. Because the Unity player is a pluging, it is very dependant on its implementation within it.
We had crashes with IE7, but not Firefox or IE8. So we lowered our memory comsumption and it was fixed.
I tried Chrome and IE, both are crashing. But the problem is I can’t lower the memory consumption a lot because I’m using terrains. The terrain mesh + textures on it alone are causing this since there are 24 terrains I have to have in my project. I already removed, scaled down or turned off details on a few terrains that are just there for filling up the view in far away.
The view itself it maximum set at 900 in flight and 300 in walk. I just can’t remove more memory else then just removing all other textures from my project, whish leaves me only with a terrain and no buildings here and there.
However there aren’t much buildings, just about 9 / 10 and couple of 10 another objects here and there.
The scene just hogs up all memory even if parts aren’t in view.
But I doubt big AAA games aren’t loading all textures from the whole scene in memory at once is it? But seams if you use terrains, it does somehow. I even have a hard camera clipping set, so afther the clipping nothing should be calculated. I have about 3/4 terrains of each 30mb of resources in my view at once. I think the detail on it is causing a problem somehow.
I think I have to make huge sacrifices to have it run in web plugin at all.
Around 1,6gb RAM it crashes instandly. The same scene on 32bit computer as standalone just runs fine, but in the browsers it doesn’t like the memory use.
De webplayer does have a Memory consumption limit, which is around 1.65 GB. If it tries to accumulate more than that, it will give the error “The content stopped because a fatal content error has been detected” This is not actually a content error, just a crash that it exceeded it’s memory consumption.
Im my case, this was a huge amount of terrains with a height map resolution of 2049.
So I created a tool to duplicate my detail en splatmap textures to a new terrain. Export the heightmap and resized it to 1024 and reimported it.
Resulting in about 200mb less memory consumption.
Also I would recommend when switching to a new scene, to have a blank scene between it, using a script with Resources.UnloadAllUnusedAssets
This will reduced the memory consumption a lot and free memory between scenes. Because when not using this, it will add the memory needed for loading new assets and instantly crash the webplayer.
I hope someone would find this useful in the future. I struggled with it for some time to get my scene work properly and find the actual problem causing the crash, which was memory consumption.
To Unity Devs
Maybe add a notice to the webplayer reference or documentation, what it’s memory consumption limit is. I had to find it out myself and not knowing what the problem was. Else I would have noticed a lot earlier.