Move vs Velocity vs Interpolate

NNterprisesNNterprises Member, PRO Posts: 387

So from my understanding and other threads, Interpolate would be the best to use performance-wise.

However, all of my actors needed to be moved have collisions associated with them, therefore I must keep moveable CHECKED.

I am currently using a "change velocity" Y, command to get each obstacle to move, would it be much better performance if I changed all of them to interpolate, EVEN IF I NEED TO KEEP MOVEABLE CHECKED. Or is Moveable, the culprit itself, and I wont see any difference if I use velocity, move, or interpolate.

It is just semi glitchy when the obstacles spawn. Each obstacle is a 1024x1024 PNG (it's a long story why), but the next step would be to change each to a smaller size to see if performance is better. The code of each obstacle has been lightened to the best possible.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2016

    @NNterprises said:
    However, all of my actors needed to be moved have collisions associated with them, therefore I must keep moveable CHECKED.

    You can move things, and detect collisions without activating the physics (making the actor 'moveable'), for example constrain Y to Y+speed or Loop change Y to Y+speed . . . etc.

    @NNterprises said:
    I am currently using a "change velocity" Y, command to get each obstacle to move, would it be much better performance if I changed all of them to interpolate, EVEN IF I NEED TO KEEP MOVEABLE CHECKED. Or is Moveable, the culprit itself, and I wont see any difference if I use velocity, move, or interpolate.

    It would be more efficient (=better performance) if you made a larger scene, keep all your obstacles static, and then move the camera (and the player actor) up through the scene.

  • NNterprisesNNterprises Member, PRO Posts: 387

    @Socks Thanks!
    To do the camera moving option, that would be great and I understand, but what do you suggest for doing an infinite runner.

    Like when the camera and actor get to Y position #, change back to the original position or something?

  • NNterprisesNNterprises Member, PRO Posts: 387

    @Socks said:

    You can move things, and detect collisions without activating the physics (making the actor 'moveable'), for example constrain Y to Y+speed or Loop change Y to Y+speed . . . etc.

    Hey @Socks
    The constrain Y worked pretty well movement-wise but when you turn physics off (uncheck moveable) it does NOT register the collisions. AKA I go through every obstacle no matter what shape I am and I dont die or get any points.

    Am I doing something wrong here still?

  • NNterprisesNNterprises Member, PRO Posts: 387

    I'm using a lot of custom collisions fyi

  • SocksSocks London, UK.Member Posts: 12,822

    @NNterprises said:
    The constrain Y worked pretty well movement-wise but when you turn physics off (uncheck moveable) it does NOT register the collisions.

    What is 'it' ?

  • NNterprisesNNterprises Member, PRO Posts: 387
    edited June 2016

    @Socks

    "It" is Gamesalad or the Game as an entirety...

    Pretty much when the block goes through a bar (as seen in the video above), it is supposed to collide and give you a point. When you uncheck moveable on the obstacle, the obstacle still moves with constrain, but it doesn't collide or give you any points

  • SocksSocks London, UK.Member Posts: 12,822

    @NNterprises said
    When you uncheck moveable on the obstacle, the obstacle still moves with constrain, but it doesn't collide or give you any points.

    Ok, 'it' = the obstacle rather than the player.

    I've attached a quick example.

  • NNterprisesNNterprises Member, PRO Posts: 387

    @Socks I see I see, thanks for the personalized service as always lol

    Your example works and explains it BUT...

    How you have it:
    -Block A1 is the one that moves using the constraint Y-5, and also has Moveable CHECKED
    -This block A1 has NO collision rules
    -Your B has moveable UNCHECKED, but has the collision rules
    ***Everything works as intended

    When I change it:
    -Block A1 is the one that moves using the constraint Y-5, and also has Moveable ****UNCHECKED****
    -This block A1 has NO collision rules
    -Your B has moveable UNCHECKED, but has the collision rules
    ***The block moves as necessary BUT the collision does not work, aka B doesn't appear pink with the word in it

    What I got from that:
    -When A nonmoveable actor has a collision rule within it, it MUST collide with a moveable actor?

    My issue:
    -Both my A1 and B in my game have collision rules within them, but only A moves. If I move ALL my collision rules to the B in my game, I am able to uncheck B as moveable, but need to keep A moveable?

    Other things I notice:
    When I uncheck moveable on A but put B as moveable, the collision also doesn't work but A still moves.

  • NNterprisesNNterprises Member, PRO Posts: 387
    edited June 2016

    I've changed all the things to constrain and all the movements worked (not collisions as it was for testing purposes). It may had made things a bit slower even though the physics was unchecked.

    I believe it had too many constrain loops running at the same time.

    So the moveable isn't my performance problem I believe, it's probably the large size of images being spawned all the time, so I'll try that next.

Sign In or Register to comment.