Forums

OverviewV-Play 2 Support (Qt 5) › Consistent game pauses with MovementAnimation

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12867

    Kool

    Hi all,

    I’ve noticed something off with MovementAnimations. There seems to be a pause or ‘jitter’ as the position of the player changes. I’ve created a simple example that demonstrates this:

    import VPlay 2.0
    import QtQuick 2.0
    
    GameWindow {
        id: gameWindow
        activeScene: scene
    
        screenWidth: 960
        screenHeight: 640
    
        EntityManager {
            id: entityManager
            entityContainer: scene
        }
    
        Scene {
            id: scene
    
            width: 480
            height: 320
    
            Rectangle {
                id: background
                anchors.fill: parent
                color: "black"
            }
    
            StyledButton {
                id: startButtonn
                text: "Restart"
                anchors {top: parent.top; right: parent.right}
                onClicked: player.x = parent.width
            }
    
            Item {
                id: player
                height: 100
                width: 10
                x: parent.width
                y: parent.height / 2
    
                Rectangle {
                    id: shape
                    anchors.fill: parent
                    color: "white"
                    radius: 5
                }
    
                MovementAnimation {
                  id: movement
                  target: player
                  property: "x"
                  velocity:  -75
                  running: true
                }
            }
        }
    }
    

    Press the button to restart and view it again. I’ve looked at the QML profiler and nothing seems out of the ordinary. Any clues on what’s causing this? Is there an alternative to achieve the desired effect, or a way to mitigate against the visible pauses? The actual object I noticed this with only needs to move on the x axis at a constant velocity.

    Cheers!

    #12868

    Kool

    There does seem to be something going on from the QML stack trace.

    There are periods at constant intervals when the framerate drops to 15FPS.

    #12869

    Alex
    V-Play Team

    Hi Kool,

    this is definitely caused by the internals of the MovementAnimation, looks like there is a frame dropped in consistent intervals when rendering the moved item, thank you for raising our attention on this. However this only seems to happen on Windows Desktop, we’ll have a look at it.

    Regards,
    Alex

Viewing 3 posts - 1 through 3 (of 3 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