Forums

OverviewV-Play 1 Support › Object moving is laggy on Android

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6465

    V-Play User

    Hello, i have a proplem with the FPS on Andoid while a Object is moved by gravity. The Object moves very laggy (FPS 20-30 while “jump”)

    I tested on HTC Desire, Nexus 5

    But on iPhone 5s the FPS is 60 and the Object moves very smoothly and all works fine!

     

    What could be the problem about Android?

    Renderer:

    vplayApplication.setCocosRendererEnabled(true); // optimized
    vplayApplication.setQmlRendererEnabled(false); // for debugging    

    PhysicsWorld:

        PhysicsWorld {
            // this id gets used in Level, to test if a new platform or window can be built on the new position or if there is an entity already
            id: physicsWorld
            // this puts it on top of all other items with lower z for the physics debug renderer
            z: 10
            // for physics-based games, this should be set to 60!
            updatesPerSecondForPhysics: 10
            // make objects fall faster by increasing gravity
            gravity.y: -60
            // this should be increased so it looks good, by default it is set to 1 to save performance
            velocityIterations: 1
            positionIterations: 1
        }

    i tried with

    updatesPerSecondForPhysics = 10, 30, 60

    velocityIterations & positionIterations = 1, 2, 3, 4, 5

    #6466

    Christian
    V-Play Team

    Hi,

    you can use the QML profiling tool of Qt Creator to find out which are the slow parts of your game, and then try to improve it from there. You can also post the parts you think are causing the performance issues here. Generally, avoid too heavy JavaScript code especially per frame per entity.

    On Android, disabling the fps with the displayFpsEnabled property also helps to improve performance.

    Cheers, Chris

    #6469

    V-Play User

    Hi Chris,

    Do i loss performance with many console.debug()  ?

    I analysed the “jump” with QML Profiler and found nothing heavy time-consuming element..:

    GrumpyDudeScene.qml:107	Signal	17.58 %	10.915 ms	27	404.248 μs	407.220 μs	710.615 μs	157.255 μs
    Player.qml:232	Signal	9.09 %	5.643 ms	6	940.563 μs	905.639 μs	1.198 ms	768.747 μs
    GrumpyDudeScene.qml:198	Binding	8.37 %	5.198 ms	7	742.544 μs	715.539 μs	960.506 μs	626.993 μs
    Player.qml:111	Signal	5.69 %	3.530 ms	2	1.765 ms	3.213 ms	3.213 ms	317.515 μs
    GrumpyDudeScene.qml:158	Signal	5.33 %	3.307 ms	10	330.690 μs	301.208 μs	663.763 μs	115.361 μs
    GrumpyDudeScene.qml:122	Signal	4.07 %	2.527 ms	1	2.527 ms	2.527 ms	2.527 ms	2.527 ms
    LevelLogic.qml:117	Binding	3.01 %	1.868 ms	55	33.959 μs	31.801 μs	55.121 μs	16.523 μs
    GrumpyDudeScene.qml:210	Binding	1.75 %	1.084 ms	1	1.084 ms	1.084 ms	1.084 ms	1.084 ms
    GrumpyDudeScene.qml:91	Signal	1.65 %	1.022 ms	1	1.022 ms	1.022 ms	1.022 ms	1.022 ms
    LevelLogic.qml:118	Binding	0.97 %	599.366 μs	54	11.099 μs	9.414 μs	18.009 μs	8.128 μs
    Player.qml:241	Binding	0.75 %	465.922 μs	10	46.592 μs	38.093 μs	154.474 μs	3.260 μs
    Player.qml:157	Signal	0.74 %	459.146 μs	2	229.573 μs	412.418 μs	412.418 μs	46.728 μs
    EntityBase.qml:422	Signal	0.55 %	338.346 μs	1	338.346 μs	338.346 μs	338.346 μs	338.346 μs
    Player.qml:18	Binding	0.30 %	188.168 μs	8	23.521 μs	25.416 μs	34.722 μs	15.117 μs
    EntityBase.qml:499	Signal	0.16 %	99.005 μs	1	99.005 μs	99.005 μs	99.005 μs	99.005 μs
    Player.qml:264	Erstellung	0.05 %	31.095 μs	1	31.095 μs	31.095 μs	31.095 μs	31.095 μs
    

    During the Jump there is running:

    1 Timer with interval:120
    1 Timer with interval: 60 (maximal repeating 14 times)
    and the “gravity”

    But this lag occours only on ANDROID!? On iOS and Mac Desktop it works fine!

    Any other idea?

    #6470

    V-Play User

    woohoo, i found the mistake… i bind in 2 other scenes (gameOver, LevelFinished) the text to player.score, and the score get increased while the object is jumping.

     

    [closed]

    #6471

    Christian
    V-Play Team

    Great you found it, congrats!

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support