0
votes

I have made a very simple hypercasual game everything works fine but after some few minutes of gameplay, the fps goes from 60 to 50 even the phone gets heated up. Similar to this question. I tried profiling but just can't see anything off. Tried even removing some UI elements but still no luck. Tried various vsync settings. Also, I had used this to display the fps. Even without it, the lag can be seen. Even if I just open the game and do nothing then after 5 minutes the fps will become 50. If go back using the home button and re-enter the game then the fps becomes 60 again. Using unity 2018.2.6f1. Never experienced this behavior in my other Android games.

Basically it was a faulty custom vertex shader which was applied to a plane to change the background color which changed color over time. I had not used the mobile vertex color because I was not getting the desired output. But now I'll stick to the mobile one.

2
if it's a very simple game like you said, post each script. The issue is likely from one of your script. I don't think we can really do much without seeing the scripts....Programmer
Actually, there are multiple scripts and long. but I did try reviewing them, commenting on updates. disabling ..but even if I open the game and keep it idle without any code running i still drops fps after 5 minutes. i do have a coroutine but its after the game over. i also have google ad mob and a native share plugin.i do have some ui buttons and see about 2-3 frame drops when enabling panels etc.also why does it get back to 60fps after i re enter the game. would appreciate any hintjoel64
Can you do a Deep Profile on it? If so, what does that say is taking up so much time?Ruzihm
I tried it but it wouldn't show anything no spike no nothing since I was profiling the android device. the fps in the profiler doesn't match with the fps of phone .not sure if this is a bug with unity. currently, I'm trying to comment and disable /remove scripts. no luck yet.joel64
What kind of game is it? What techniques do you use? Do you have an ever increasing list declared somewhere that you perhaps loop over? You should really provide some scripts and some more info if you want some help.Immorality

2 Answers

1
votes

The two symptoms you observed are very much likely to be connected. The phone might heat up, as you are using its full power, which in turn makes the throttling kick in, reducing the perform

0
votes

I've had the EXACTLY same problem. I was trying to fix it for a very long time. You said something about faulty shaders you use. And this is the key to solve our problem.

I use a 2-color gradient as a BG, so I have to use a shader too. Due to the fact that I'm a total noob in the writing "shader-code", I have to find something in the Internet. And it was my biggest fail)

To fix the problem and remove this fps drop you should remove your gradient and shader attached to it from the scene. And try to find a more optimized shader for 2D-game (or you can always write your own one c:)