Game is unreasonably slow on WP 10 (lumia 520)
Unity 5.3.1, trivial scene with about 40 objects max (1 capsule, about 10 spheres, the rest is scaled cubes), and 3 materials. It uses physics for the player, and that's about it. In editor it runs at silkysmooth 120fps, on phone it's 14-22, with short freezes happening when first of the spheres comes into view, and each time when player enters a trigger around it, which starts coroutine that causes Time.timeScale to change to about 0.01 and fixedDeltaTime change accordingly as well, and after a second it returns timescales to normal. It uses WaitForSeconds, of course. Precisely at that moment when player enters the trigger, the game freezes and as if "skips" the whole slowdown period, then continues at its sh...crappy 14-20 framerate. Whole thing uses just the Standard Shader (which might be part of the problem, but I thought it's got mobile-optimised fallback version, i thought that's the whole point of it being a standard shader)...
I tried publishing it with IL2cpp scripting backend explicitly set, but so far Visual Studio hasn't managed to compile and deploy that, it was taking ages (like 20 minutes), so I killed it from task manager. I'm trying that again now, but... Even with .net scripting backend, i'm sure it shouldn't be this slow, but I have completely no idea where the problem might be.
IL2CPP won't ever finish compiling/deploying in Visual Studio, so no luck trying that. I've, however, replaced ALL the shaders in the scene from standard to mobile - diffuse. Framerate increased slightly (from avg. of 22 to avg. of 23), but all the lag issues persist.
Answer by aditya007 · Nov 09, 2016 at 09:40 AM
It could be that you're running the game in Debug mode (from visual studio). Change the build mode to "Release" and the FPS should increase.
Reason : I was in the same situation a month ago, where i was getting 30FPS for my game in debug mode. Switching to Release mode did the trick and i started getting stable 55-60 FPS on Lumia device (1GB Ram).
As I already mentioned, I've lost the ability to test out any anwer, and won't have the ability for the next at least 2 months, but your answer so far is the only one providing any real solution, and it also sounds very reasonable and logical, so (at least for now), I'm upvoting and accepting it as answer.
Thank you, have a nice day :)
Well, it was an answer i got from other question (don't have it's link, or i would've just linked it). And, in my case i was panicking because of this problem for straight 2 days before finding that answer... believe me, it was the last thing i expected to be of any use :p. But it did worked out
Answer by Basit-Sabasoft · Oct 14, 2016 at 06:41 AM
Hi Have you found the solution for this why it was running too slow?
hello. no, i have not. In the meantime, I've tried to replace all the shaders for the simplest mobile diffusion ones, which didn't seem to affect the issue in any way.
Then I got my Lumia 520 broken, and my replacement phone is a low-cost android, where the exact same app with the exact same code, and standard shaders, runs at rockstable 59 FPS.
Still no idea what the issue even $$anonymous$$IGHT be/might have been, but with the phone, I lost the ability to investigate it further :(
Answer by Morgenstern_1 · Oct 14, 2016 at 10:54 AM
There are plenty of tools you can use to profile on device, you'd need to use one of those to find out what is taking up the most processing power in each frame.
One thing I'll add- the Lumia 520 is a VERY low-end device. 40, fully 3D, non-static physics objects is probably too much for it to handle.
"the Lumia 520 is a VERY low-end device"
yes, I know. my issue wasn't really with the overall low performance, I understand that, my issue was specifically with the StartCoroutine freeze.
i can do a followup with some findings from profiler, however it won't be profiled from the device, because as I said, I don't have it available anymore.
Your answer
Follow this Question
Related Questions
Game too fast only on Windows Universal Plattform 0 Answers
iPad3 Performance < iPad2 Performance - Your mileage? 2 Answers
Does the Terrain's width and lenght properties affect performance? 0 Answers
Top Notch Specs, Poor Performance on the Editor 0 Answers
Control lerps with if-statemnts in Update or with Coroutines? 1 Answer