Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 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 Felgo 3.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
    Felgo 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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded