Android. Idle - 60 fps. 1 of 200 objects moves - 5 fps. Why?

0 favourites
  • 14 posts
From the Asset Store
Set of 200 hand drawn skill icons. All icons are of a high quality.
  • In my game there's a 11*15 field of sprites with a bunch of UI elements which makes about 200 objects visible on the screen. When the only thwo things changing on the screen are a sprite font element showing current fps and the timer (sprite with width changing accoding to the timer value), the game shows perfect 58-60 fps. But when I launch the player sprite in any direction the game drops to 9 to 1 fps. The only logic executing during the player's movement is a condition like

    If (distance_traveled >= target_distance) { player.stop }[/code:2sfr85k3]
    I'm exporting the game for Android and thenbuild apk via Intel XDK. 
    Why there's such a huge drop in the fps?
  • when nothing moves on the screen, nothing is redrawn, if one thing moves, you get to see the true performances, so my guess is that the player mouvement is not what causes actively the slowdown.

    I could be wrong though.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Looks like I won't get anything good from C2. This project prntscr.com/cjjhju gives me around 35 fps.

  • What device are you testing on?

    What kind of numbers do you get from the following performance tests?

    http://www.scirra.com/demos/c2/sbperftest/

    http://www.scirra.com/demos/c2/particles/

    http://www.scirra.com/demos/c2/renderperfgl/

    Is your device/browser webgl enabled?

  • Make a capx. Screenshots are pointless.

  • I'm testing it on ZTE Nubia Z9 mini. I've uploaded the apk of this demo project to dropbox.

    Capx: bit.ly/2cRaiBd

    dropbox.com/s [ delete this ] esz14y16tcatk3b/performance%20test.capx?dl=0

    APK: bit.ly/2cwEiyF

    dropbox.com/s [ delete this ] 7uykwcgwb7qee8n/cordova_project-armv7.android.20160918191838.apk?dl=0

    I can't upload files yet.

  • The Zte doesn't look like its real fast, (1.5 ghz?) and multiple cores don't really do anything for games.

    What does it look like on html5 export?

    Anyway I'm going to say it's probably hardware, even though I didn't test the apk, it did run 60fps on desktop.

  • Got my hands on Samsung Note 10.1 2014. Both test project's and my game's apks are running at smooth 50-60 fps.

    WebGL is on. Thank you, oosyrag. I'll try running those tests on my phone.

    Still it looks like I have to find a way to autoadjust game's quality so one build could run smoothly on devices with big screens but different hardware.

  • https://9r1bqw-ch3302.files.1drv.com/y3 ... png?psid=1

    tested the apk on my own device (HTC Desire 620 it seems according to its default name when I plug it) and it is a 60 fps almost constant

    Perhaps my device is really stronger than I expected (after all it was a carrier device so I expected muck less than that)

  • thelander

    Its hard to help without a capx or something to go on , so we do it this way. I made a game that has at least 30-40 sprites and animations going off at the same time. Download it and try it on your device , it should run as fast with no slowdown or glitching

    Also did you look at my mobile optimizing tips in this post

    Let me know if you still have an issue.

  • thelander

    Its hard to help without a capx or something to go on , so we do it this way. I made a game that has at least 30-40 sprites and animations going off at the same time. Download it and try it on your device , it should run as fast with no slowdown or glitching

    blast-ad-shooter-arcade-action-space-shooter_t181773

    Also did you look at my mobile optimizing tips in this post

    viewtopic.php?f=146&t=181811

    Let me know if you still have an issue.

    The game runs smoothly. I've read your article. I'm going to implement some of your tips and try to review my "code" and then I'll post the result. But I don't think I can reduse object count to less than 180. If only there was a way to bake all the sprites into one.

    tested the apk on my own device (HTC Desire 620 it seems according to its default name when I plug it) and it is a 60 fps almost constant

    Thank you for the test. I hope people won't have phones with worse screen size to hardware ratio than mine.

  • > thelander

    > Its hard to help without a capx or something to go on , so we do it this way. I made a game that has at least 30-40 sprites and animations going off at the same time. Download it and try it on your device , it should run as fast with no slowdown or glitching

    >

    > blast-ad-shooter-arcade-action-space-shooter_t181773

    >

    > Also did you look at my mobile optimizing tips in this post

    > viewtopic.php?f=146&t=181811

    >

    > Let me know if you still have an issue.

    >

    The game runs smoothly. I've read your article. I'm going to implement some of your tips and try to review my "code" and then I'll post the result. But I don't think I can reduse object count to less than 180. If only there was a way to bake all the sprites into one.

    >

    > tested the apk on my own device (HTC Desire 620 it seems according to its default name when I plug it) and it is a 60 fps almost constant

    >

    >

    Thank you for the test. I hope people won't have phones with worse screen size to hardware ratio than mine.

    Ok in my article Iam talking about moving object(sprites) you don't have 180 moving objects at the same time right? How many moving objects you have going at 1 time?

  • My game generates a 11*15 maze of non moving tiles and this is the reason I can't put them all in a single sprite in Photoshop. No sounds, no animations are in the game. During the player movement three object are changing: timer sprite, player, sprite font fps counter.

    It looks like my phone lacks power to render all this. But looks like I've found a solution. Just found Canvas plugin and looks like I can put my maze layer sprites in it. Can't test it on my working place but if this is possible, I'be able to reduce object count to 10% !

    scirra. [delete this] com/forum/plugin-canvas_t64239

    (Can't post any URLs or send PM because of low rep)

  • Sooo... Looks like I've achieved my 50+ fps with 1 moving object. I think it's because I've used the canvas plugin:

    scirra. [delete this] com/forum/plugin-canvas_t64239

    1. I generate that 11*15 maze on a separate layer

    2. Then I paste that layer on the canvas

    3. And then I delete all the objects I've used to build the maze.

    Now I have 33 objects instead of 200+ and smooth 50+ fps instead of 5-9 fps.

    Agent_Smith_Evil_Laugh.gif

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)