- Home /
Why an empty project jumping 20 - 120 fps on android?
I have checked and confirmed that other apps are running 120 fps consistently. How is unity not able to even keep a solid 30 on my gallaxy s4? I really need a consistent >240 fps before I can begin coding my project. Is there really anything I can do besides finding another game engine?
Answer by Excelerator · Dec 06, 2013 at 08:31 PM
Ok.. I got something working. I helps to know that Update() is only based on rendering frames. Since Update() is completely bogged down on mobiles anyway, I decided to limit it to 24 fps max. I then called a separate function from Update() ten times. This now executes my function 10 times every 1/24s which gives us 240fps. However, this makes a very dirty fps where you execute 10 times really fast, wait for Update again and then update another 10 times. Since I am fixing the fps to 240, I will have to have each frame wait for the clock.
So, I guess the thing to remember about mobile development in Unity is that the rendering pipeline is always going to be mind-blowingly slow. Find your way around it if you need more fps.
Answer by tanoshimi · Dec 04, 2013 at 09:02 AM
Firstly, some comments:
a.) What value is there in knowing the FPS of an empty project? 240FPS strikes me as a ridiculously high and probably unachievable target anyway.
b.) How are you measuring FPS of other apps?
c.) What other comparable 3D game engines are you considering that would offer better mobile performance? I for one would certainly love to know!
In terms of what you can do in Unity, try setting Application.targetFrameRate and edit->project settings->quality->vsync count. Also monitor the profiler for WaitForTargetFPS and other counters to understand what's happening.
I have one very simple script measuring the delta time in update. If the fps drops below my target, I have a quad that shows and hides accordingly.I asked the developer of this other app what fps his game runs at. He said he has a fixed delta of 120hz (not rendering just updating). I'm really not sure what Id switch to. I would really hate migrating from unity as there are so many good things about it. I wanted to connect the profiler, but ill have to mess around with my network. Really, I don't see why my smartphone cant get 2000 fps.. its a faster processor than my laptop and it can run that no problem. (I think)
Having a fixed delta time of 120hz simply implies that physics calculations etc. performed in FixedUpdate() are recalculated 120 times per second - that is very different from (and generally unrelated to) having a screen refresh 120 frames per second...
Why can't your smartphone get 2000FPS? Well, I have no idea what phone you have, but here's a recent benchmark of several games played on two of the latest Android phone handsets: http://www.sammobile.com/2013/11/21/samsung-galaxy-s4-beats-htc-one-in-uncheatable-ga$$anonymous$$g-benchmark/ - notice that the absolute fastest speed achieved is 56FPS.... and why would it need to be better than that? Remember most TV is broadcast at around 24FPS.
I know, but im talking about void update () it goes up to 4000 fps on pc but not on my gallaxy s4. So pretty much what your saying is I will have to make my own update function? How do I do that without basing that on update ()?
What im trying to get at is how do I process math at 240hz?