Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Excelerator · Jul 04, 2014 at 09:26 AM · androidfpsupdatemath

Android update math at higher hz?

So I am still bothered by a question I have not really found the answer to yet. The question is: Is there any possible way to go beyond 60 fps on an Android device - I don't care if I see 12 fps. All I care about in this situation is that the scripts and objects interact and loop thousands of fps in an empty project environment. I could calculate a thousand math problems in a single loop, but that use has limitations. I literally want the script to loop thousands of fps like it already does on pc's, but it seems all unity's docs care about is visual fps (the fps you can see in the pixels - not the fps of math loops/object interactions and variables).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by meat5000 · Jul 04, 2014 at 09:09 AM

Use FixedUpdate and change the FixedTimeStep.

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Excelerator · Jul 04, 2014 at 04:43 PM 0
Share

Hmm.. not sure that works, but I'll try a build to my android later today.

avatar image meat5000 ♦ · Jul 04, 2014 at 04:45 PM 0
Share

FixedUpdate runs independent of framerate. Adjusting FixedTimeStep defines how many times the script will be executed every second.

avatar image Excelerator · Jul 04, 2014 at 04:53 PM 0
Share

Last time I tried, it could not go faster than void update() which can not seem to get past 200 hz on my s4.

avatar image meat5000 ♦ · Jul 04, 2014 at 05:00 PM 0
Share

Then you need to change $$anonymous$$aximum Allowed Timestep. This throttles FixedUpdate execution when experiencing low framerate.

avatar image Bunny83 · Jul 04, 2014 at 10:40 PM 1
Share

Yes, it does work. However keep in $$anonymous$$d that if you too much calculations inside FixedUpdate and the CPU can't keep up that rate, the (visual) FPS will drop down to the maximum allowed timestep. FixedUpdate is actually called right before Update, but if the Update rate is too low, FixedUpdate is simply called multiple times per visual frame to keep up the constant rate. On the other hand if the fixed rate is lower than the visual rate, FixedUpdate is skipped in some interleaved frames.

For example with a fixed rate of 50fps and a visual rate of 100 fps, FixedUpdate is only called every second Update call.

If you set the fixed rate to 1000 but you only have a visual update rate of 25 fps, Unity will call FixedUpdate 40 times each frame.

Here's a webplayer i made to explain how it basically works.

Show more comments
avatar image
2

Answer by Bunny83 · Jul 05, 2014 at 11:55 PM

FixedUpdate is the easiest way to run certain code at a fix rate. However increasing the fixed rate also affect the physics system since it runs along with FixedUpdate. If you want to use physics but also have your code run at a higher fix rate, you can use my CustomFixedUpdate. It does almost the same thing Unity does to ensure a certain call-rate per second.

You can set any rate you like: once an hour or 10000 times a second.

Note: FixedUpdate (as well as my implementation) doesn't actually run at a "fix" rate but is "fixed" in the sense of "corrected". The scripting environment in Unity runs in the main thread and therefore it's affected by the overall frame time. The solution to have a (statistically) constant rate is to let the system catch up with the current time within one frame.

So at a (visual) framerate of 100fps a "fixed" update at the rate of 10000 is called 100 times each (visual) frame. If the frame rate drops to 20fps, the fixed update is now called 500 times per frame.

Keep in mind that as soon as your over all frame time exceeds Time.maximumDeltaTime (which is 0.3333 by default == 3fps) Unity will clamp Time.deltaTime to that value which will make your game actually run slower. If your hardware can't keep up that rate there's nothing you can do against it. The same way you can't copy 3TB onto a 1TB HDD. The only way is to buy a new HDD which has enough space ;)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Excelerator · Jul 06, 2014 at 04:10 AM 0
Share

If I could, I would thumbs up that! Very nice solution for keeping the built in physics available.

avatar image meat5000 ♦ · Jul 06, 2014 at 09:12 PM 0
Share

You've got 15 karma now! You can give him that +1 :P

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

iOS @ 30fps: what does Unity/Update do during/if spare time? 0 Answers

Android 6.0 Marshmallow creates black bar along bottom of screen. 4 Answers

Mobile Game Patcher? 1 Answer

Why is the Motorola Xoom (Dual Core) slower than the Samsung Galaxy S (Single Core)? 2 Answers

Is changing 60 FPS into 30 FPS affects time in coroutines? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges