Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 35591
In Process

askthedev.com Latest Questions

Asked: December 20, 20242024-12-20T00:56:49+05:30 2024-12-20T00:56:49+05:30

Why does my game run inconsistently at 45-60 fps on Samsung Galaxy A40 while maintaining 60 fps in the editor?

anonymous user

I’ve been working on this game and am really puzzled about some performance issues I’m facing on my Samsung Galaxy A40. I initially thought everything was running smoothly when I was testing in the Unity editor because it was consistently hitting 60 fps, rarely dipping below 58. That was really encouraging! But once I built the game and tried it on my phone, I noticed this strange fluctuation in frame rates. Instead of the solid 60 fps I expected, I keep seeing the fps swing between 45 and 60, mostly hovering around the low 50s.

It’s not the end of the world since it doesn’t seem to affect gameplay too much, but I’m just left wondering what’s causing this inconsistency. I’m using the Universal Render Pipeline (URP) with no post-processing effects, so I didn’t think it would be too taxing on the GPU. Plus, I’m using `1/Time.deltaTime` to track the frame rate, which means I’m able to floor the values and display whole numbers. That adds a bit of complexity, but I still expected more stability.

I’ve looked at some performance profiling tools, but I’m not seeing anything out of the ordinary—I mean, I’ve done my fair share of optimizations! I’ve reduced the number of draw calls, simplified models where possible, and even adjusted settings to get the best performance on mobile devices. Still, the frame rate behaves like it’s on a rollercoaster ride, going up and down without any clear reason.

Is it just a limitation of the A40? Maybe it’s not as powerful as I thought? Or is it possible that something in my code or settings is causing these inconsistencies that I can’t see from the editor? Have any of you run into similar issues when transitioning from the editor to a mobile build? I’d really appreciate your thoughts or any suggestions to pinpoint what might be going on. Thanks in advance for any help!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-12-20T00:56:50+05:30Added an answer on December 20, 2024 at 12:56 am

      It sounds like you’re dealing with some pretty frustrating frame rate issues on your Samsung Galaxy A40! From what you mentioned, it seems like everything runs great in the Unity editor but runs like a rollercoaster on your device. That’s really puzzling, right?

      First off, the A40 might not be as powerful as you’d hope for running a game, especially if it has a lot of objects or complex scripts running at once. Sometimes, the editor gives you a false sense of security because it’s running on your computer, which is usually more powerful than your phone.

      Even though you’re using URP and no post-processing effects, there could still be other things at play here. Have you checked how your game handles different resolutions? Sometimes scaling down textures for mobile can help. Also, keep an eye on how many assets are loaded at once—if your game’s loading a ton of stuff in the scene, it might strain the device.

      Also, about `1/Time.deltaTime`, that’s cool for tracking FPS, but just make sure no heavy calculations are happening when you’re updating your display. If there’s a sudden spike in logic or rendering somewhere, it might mess with your frame times, causing those dips in FPS.

      It’s sweet that you’ve already looked into profiling and optimizations, but maybe try testing your game in a simpler scene first to see if it still fluctuates. That way, you can tell if it’s a specific asset or script causing the trouble.

      Lastly, are you getting any error messages or warnings in the console when you run on mobile? Sometimes, little things can have a big impact! Anyway, I hope something here helps you figure it out.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-12-20T00:56:51+05:30Added an answer on December 20, 2024 at 12:56 am

      Frame rate fluctuations observed on your Samsung Galaxy A40, especially after building your game in Unity, can be attributed to several factors that are not always evident in the Unity editor. The first possible reason could be the hardware limitations of the A40 itself, as it may not handle certain graphical features or complex scenes as efficiently as your development environment, which is often better optimized than mobile devices. While the Universal Render Pipeline (URP) is indeed designed for better performance on various hardware, the device’s GPU and CPU capabilities can still lead to bottlenecks, especially during more intensive gameplay scenarios. Therefore, performance on lightweight phones like the A40 can be inconsistent due to higher loads that exceed what the hardware can comfortably process.

      Aside from hardware limitations, it’s also worthwhile to review your code and project settings for any potential pitfalls. For example, performance spikes might occur due to inefficient scripting practices, such as overuse of certain Unity features or complex algorithms that were not initially apparent during testing. Check for unnecessary updates or frequent re-calculations each frame that could contribute to instability in frame rates. Additionally, using the Unity Profiler specifically on your mobile device can help identify specific spikes in CPU or GPU usage that may not have been obvious in the editor. Consider adjusting quality settings to streamline performance further, as well as optimizing assets and reducing the overall scene complexity where possible. These steps should help to narrow down the cause of the fluctuation and improve the overall experience on your device.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Sidebar

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.