|
metadata
# Known Issues (WebGL)
Since many people are reporting a lot of similiar errors regarding WebGL I am going to list the most common ones here as well as a few ways on how to fix them.
Additional information: I am using Firefox (45.0.1) on a 64bit Windows-PC (not a laptop) and the game appears to load perfectly fine even in Chrome (latest build).
**OUT-OF-MEMORY (when loading the game)**
The WebGL export of Unity requires a fixed amount of non-fragmented memory when the application starts loading (which is currently set to 256MB). If the browser is not able to allocate enough memory during the initialization the game will crash.
Currently there is no universal way to fix this because lowering the memory amount will not provide enough room for later special effects and/or runtime variables.
From what I found out so far it appears that most Firefox and Safari users who are playing on laptops are affected.
Possible temporary solutions for now:
- Close and open the tab again
- Restart your browser
- Try loading it using other browsers like Chrome, Edge or Opera
If nothing helps please visit [http://www.doesmybrowsersupportwebgl.com/](http://www.doesmybrowsersupportwebgl.com/) and send me a screenshot of all the values or simply copy & paste them to me as a private message and I will see what I can do.
**OUT-OF-MEMORY (during the game)**
~~This message is thrown by Unity if the game is running out of memory during a game tick. It is usally caused by to too many effects+enemies+missiles existing at the same time. This will be fixed as soon as I replace the built-in physics with a custom light-weight version and add an option to toggle of all particle effects.~~
EDIT: Fixed in v0.10 (was related to materials)
EDIT2: Still seems to occur in the latest version. Happens after playing for a long time. Currently this issue is very hard to track down because in a language with a managed memory heap there is no way for memory leaks to occur. (Only if there are growing collections or sets which is obviously not the case.) All unreferenced objects are automatically cleared up after each game tick. The origin of this problem in pre-v0.10 was the fact that materials, which are used for rendering, are automatically added to the active assets collection and remain there even if they are not used anymore. This has caused the available memory to overflow.
EDIT3: In the latest build (v0.3.0.1) the out-of-memory error seems to have disappeard so far. Before the update the game was using Application.ExternalCall to call the JS submit statistics method of the Kongregate API in order to submit scores. But since this method seems to allocate a lot of temporary strings in order to convert the input into proper JS code I replaced all Application.ExternalCall methods with Application.ExternalEval in the Kongregate API.
Thank you in advance for taking the time to read all this.
|
|
|
metadata
Awesome, thanks for the explanation. I’ve been wondering for a long time how far I’d get if the out of memory error didn’t pop up after wave 1000 or so :D
|
|
|
metadata
OUT-OF-MEMORY (during the game)
I’m pretty sure, the number of fx, a.s. at the same time are not the major problem of this issue.
This error happens in each Mode (Easy, normal, hard) after like 1000 waves (+/- 100)
Actually i can play easy-mode without upgrading anything until it crashes and i could play several hundreds of levels more without getting any performance issues. In Hard-mode it needs dozens of missiles at this stage to kill enemies. There the error happens earlier, but just a few rounds.
Well, i think performance is actually not the reason. Maybe memory-management like a fulfilled space of variables in cause of not emptying, another “Not a Number” – Problem, whatever.
However, I hope its not a needle ;o)
Otherwise; here’s a walkthrough for finding it: [https://www.youtube.com/watch?v=2tSSYb50Hqk](https://www.youtube.com/watch?v=2tSSYb50Hqk)
regards =)
|
|
|
metadata
> Well, i think performance is actually not the reason. Maybe memory-management like a fulfilled space of variables in cause of not emptying, another “Not a Number” – Problem, whatever."
I am sorry if there was a misunderstanding, when I was talking about performance I was referring to the way how certain things are handled (finding closest enemy, calculating knockback vector, etc.). They are currently not optimized as they are using built-in functions of Unity which are allocating way more memory than required (most physics methods create fixed size arrays, partical collision is very costly, etc.).
If there are a lot of missiles on the screen at the same time or many objects need to be created it is very likely that the game will run-out-memory during that game tick. (Last paragraph at [http://docs.unity3d.com/Manual/webgl-memory.html](http://docs.unity3d.com/Manual/webgl-memory.html) describes the problem pretty good). Since someone already mentioned it I am also going to start using object pools.
P.S.: Nice video ;)
(I am very confident that this issue is not a ‘needle in the haystack’ ^^)
EDIT: I think its worth mentioning that the amount of enemies per wave increases logarithmically. (Switches from 21 to 22 at wave 912 which seems to be a critical amount of enemies since it’s very likely to crash around this wave.)
|
|
|
metadata
“You need a browser which supports WebGL to run this content. Try installing Firefox”
But I am using latest firefox
|
|
|
metadata
> “You need a browser which supports WebGL to run this content. Try installing Firefox”
> But I am using latest firefox
It seems like your graphics card has been blacklisted for WebGL by Mozilla so Unity failed to initialize the WebGL context. (If you are using Firefox 44.0 or 45.0) Go to “Settings =\> Advanced =\> General =\> disable Hardware acceleration”. Then open “about:config” (simply paste it into the addressbar and press ok) and search for “webgl.force-enable” and set it to true. Restart the browser and check if the message still appears.
|
|
|
metadata
Already tried that before posting.
|
|
|
metadata
Something odd happened to me. There’s a chance that WebGL will fail, but there’s a chance that it won’t fail too. I thought it works like that because when i reload it might load well.
|
|
|
metadata
Hi XmmmX99, the matter happened to me this morning, and only on the kongregate version of the game.
I’ll provide you with whatever you need to solve the problem.
|
|
|
metadata
> *Originally posted by **[XmmmX99](/forums/32139/topics/613201?page=1#posts-10279073):***
>
> # Known Issues (WebGL)
>
> **OUT-OF-MEMORY (during the game)**
> ~~This message is thrown by Unity if the game is running out of memory during a game tick. It is usally caused by to too many effects+enemies+missiles existing at the same time. This will be fixed as soon as I replace the built-in physics with a custom light-weight version and add an option to toggle of all particle effects.~~
>
>
>
> EDIT: Fixed in v0.10
>
>
>
> Thank you in advance for taking the time to read all this.
i get that error every day after 5-10 hours of idling (with x4 and turned off gfx) :/
|
|
|
metadata
> *Originally posted by **[Bloodhoven](/forums/32139/topics/613201?page=1#posts-10506838):***
> > *Originally posted by **[XmmmX99](/forums/32139/topics/613201?page=1#posts-10279073):***
> >
> > # Known Issues (WebGL)
> >
> > **OUT-OF-MEMORY (during the game)**
> > ~~This message is thrown by Unity if the game is running out of memory during a game tick. It is usally caused by to too many effects+enemies+missiles existing at the same time. This will be fixed as soon as I replace the built-in physics with a custom light-weight version and add an option to toggle of all particle effects.~~
> >
> > EDIT: Fixed in v0.10
> >
> >
> >
> > Thank you in advance for taking the time to read all this.
>
> i get that error every day after 5-10 hours of idling (with x4 and turned off gfx) :/
Same here! You leak memory somewhere… alot.
|
|
|
metadata
Somedays WebGL crashes some days and others it is fine…can anyone explain that?
|
|
|
metadata
> *Originally posted by **[KeySer87](/forums/32139/topics/613201?page=1#posts-10515166):***
>
> Same here! You leak memory somewhere… alot.
with 32GB of RAM and 2GB of GPU-RAM (which will be upgraded soon to 8GB) I’m pretty sure, there is no way that my hardware limits me :/
|
|
|
metadata
same here on load
Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.
32GB ram, 4GB Vram current use 580Mb on firefox. Impossible to load now.
|
|
|
metadata
i am having the memory leak as well with the settings being skip waves at 50 speed x4 and gfx being set off its a pain in the ass to come back to the game after a few months only to find we have memory leaks again :/
|
|
|
metadata
Now i can’t even open the game. I got the message once again and when i reloaded the game isn’t starting. Just showing this message! :(
|
|
|
metadata
Just had this for the first time while playing at level 3000+. Reload worked fine, current game was aborted but gains were there.
|
|
|
metadata
> *Originally posted by **[KeySer87](/forums/32139/topics/613201?page=1#posts-10515166):***
> > *Originally posted by **[Bloodhoven](/forums/32139/topics/613201?page=1#posts-10506838):***
> > > *Originally posted by **[XmmmX99](/forums/32139/topics/613201?page=1#posts-10279073):***
> > >
> > > # Known Issues (WebGL)
> > >
> > > **OUT-OF-MEMORY (during the game)**
> > > ~~This message is thrown by Unity if the game is running out of memory during a game tick. It is usally caused by to too many effects+enemies+missiles existing at the same time. This will be fixed as soon as I replace the built-in physics with a custom light-weight version and add an option to toggle of all particle effects.~~
> > >
> > > EDIT: Fixed in v0.10
> > >
> > > Thank you in advance for taking the time to read all this.
> >
> > i get that error every day after 5-10 hours of idling (with x4 and turned off gfx) :/
>
> Same here! You leak memory somewhere… alot.
I confirm that this happens to me as well. Both on chromium and firefox
|
|
|
metadata
Everything was lost with latest update. I was at position #23 in the standings with over 3,000,000 waves on Insane. So I am pretty mad
It kept saying this when I selected my Default Blueprint
The Selected blueprint contains more blueprint points than your current total. Do you want to reset it in order to use it?
Reset
Return
Hitting Return would not allow me anyway of getting back in to the Default Blueprint. I was at Blueprint Tier 62
Everything is now gone. Pretty angry as I had been playing since the game launched
I post this hear so the Dev knows there is a bug with latest update
I quit
[](http://tinypic.com?ref=288nya0)
|
|
|
metadata
This might help some of you who can't run WebGL at all.
If it doesn't - because it's a very technical solution - I recommend that you post to that topic to try to encourage some action on this issue. Incidentally the scope of this problem is *way* beyond Kongregate so please don't get annoyed, or expect a quick simple fix to materialise.
http://www.kongregate.com/forums/7-technical-support/topics/659986-how-to-run-webgl-without-a-graphics-card
|
|
|
metadata
There is definitely a problem with the import/export. I've tried to play this twice and it never saves my data locally, though it checkmarks that cookies are enabled. When I import, I lose about 50% of my assigned blueprint points. It may be that if I reset before saving that this doesn't happen - but I really don't feel like testing this. I liked the general idea of the game - but losing half my progress every time just makes this annoying.
|
|
|
metadata
@Ruffyl Thanks for sharing the link to your post. It's very hard to track down the out-of-memory issue as it is not reproduceable in the PC version and the profiler records no specific increase in memory usage over time as well. I tested it with a tier 100 blueprint with all upgrades maximized in insane mode (starting at wave 1), damage text on, quality settings on high (so all particle effects are visible) and left the game running in the background for around 18 hours with only the profiler connected to record the memory usage.
I am going to perform a second test-run inside the browser using some of the google and mozilla development tools to profile the memory usage.
Regarding the saving issues: We are working on a simple cloud storage solution which should solve all the indexed database related problems. For the time being please make sure you are using the latest version of your browser and check if you can see two green checkmarks in the bottom left corner of the main menu. If you accidentally cleared your browser cache (or if the savegame is gone for some other reason) simply send me a list with all the resources you had and I'll try to create a new save-game for you which should be as close as possible to your previous one.
@AldarianTwilight Please can you send me a detailed step-by-step guide on how to reproduce this issue (also which browser+version were you using when this happened)? This seems to be a very strange bug because it shouldn't be possible that the save-file gets torn apart for some reason (especially the user-info is a single block of data).
EDIT: Can anyone confirm that the out-of-memory error is happening in the development build as well? ( [Link](http://www.fs-studios.com/games/perfecttower/index.html) ) (Same version, but without any external APIs and the game is loaded directly and not within an iframe.) I just started testing about 20 minutes ago and noticed a slight increase in the memory usage over time when playing on Kongregate (~150 MB after 30 minutes) but no overall increase in the development build (caps at around 125 MB).
|
|
|
metadata
> *Originally posted by **[XmmmX99](/forums/32139/topics/613201?page=1#10716539)**:*
> EDIT: Can anyone confirm that the out-of-memory error is happening in the development build as well? ( [Link](http://www.fs-studios.com/games/perfecttower/index.html) ) (Same version, but without any external APIs and the game is loaded directly and not within an iframe.) I just started testing about 20 minutes ago and noticed a slight increase in the memory usage over time when playing on Kongregate (~150 MB after 30 minutes) but no overall increase in the development build (caps at around 125 MB).
While I never actually received an out-of-memory error, I was experiencing incredibly high RAM usage whenever playing in the Chrome browser(as of writing this, 53.0.2785.116 m (64-bit)). Just sitting at the initial screen when the game loads, I can watch RAM usage climb to 1GB+, just for that specific tab. Playing the game on hard at 4x, I would easily see this go to 4GB+, and near 100% CPU usage. However, I do not experience any of this in other browsers.
Using your dev build link, I do not see RAM usage climb nearly as high or as fast, but it is still climbing, just sitting at the title screen. After about 10 minutes or so, it is current at nearly 900MB.
However, another interesting piece of information, closing the game tab just now(the Kongregate version) did not reclaim RAM. I had another tab open for the forum posts listing for this game, and only after closing that, did RAM get reclaimed.
|
|
|
metadata
Firefox 48.0.2 (x64, win7 x64)
If the game is run in the background in a different tab (ie. 1 window, 2 tabs), it runs about 70% slower than if the tab had full focus (ie. 1 window, 1 tab). If it runs in its own window (ie. 2 windows, 1 tab each), it runs about the same as if it had full focus (ie. 1 window, 1 tab). It could be a firefox tab issue.
Process: run game in 1 tab, open new tab and navigate to google.com but don't do anything else (no user action). Go back to game tab and start a new normal round, wait 60s then record the wave reached. Repeat without focus (ie. viewing google tab). I used a T5 near max bp (t0) at 4x speed and auto-skip at 50. Of course there is going to be error due to random factors like gravity, but not much due to the 1-hit (ie. 1e200 damage vs. 1hp enemies in normal).
Results (60s time, normal, 4x speed, auto-skip 50):
2 tabs (game, google) in 1 window: wave 54 when tab is not focused (ie. viewing google in second tab), wave 174 when tab is focused (ie. viewing game), a 69% reduction
2 windows with 1 tab each (game, google): 175 wave when window is not focused (ie. viewing google in second window), notice how this wave is roughly the same as the focused tab result above
It could be a firefox issue with how it handles process priority for tabs (ie. active tab always gets higher priority / resources) which can be bypassed by running a 1-tab window with the game in it.
I don't use any other browser, so you might want to try testing this yourself to see if you can duplicate my findings and if it is limited to Firefox or if other browsers are affected as well.
|
|
|
metadata
@jth08527 Thank you very much for sharing. According to the Unity docs (https://docs.unity3d.com/Manual/webgl-memory.html) while the game is decompressing everything at the very beginning it requires a few gigabytes of RAM to parse the engine code. All assets (including scripts, textures, fonts, etc.) require only around 6 MB of memory and I already enabled code stripping for unused Unity libraries as well as pretty much everything else listed under "distribution size" at https://docs.unity3d.com/Manual/webgl-building.html. It is very strange that the used memory is not released afterwards even if it is not needed anymore. The memory increase after the game has been fully loaded is also very odd.
@Cedwyn Yes, this problem is listed under "known issues" on my todo-list. The time related issue is caused by the update frequency of inactive tabs. Most browsers update inactive tabs only about once per second. The maximum delta time for an update tick is limited to 0.5 seconds in Unity (otherwise entities could jump through walls or cause other unexpected behaviour. The actual limit is 0.33 sec. but I increased it slightly to compensate this issue a little bit). Now for example if the game only receives a single update tick per second then 0.5 seconds are basically lost per frame. That's the reason why the game updates slower in an inactive tab.
Does anyone know any other WebGL games made with Unity (not WebPlayer games) with a more or less complex gameplay (basically anything that is more than just a simple incremental game with increasing numbers)?
|