best option for game PERFORMANCE. constrain or move?

app-etiteapp-etite Member Posts: 139
edited November -1 in Working with GS (Mac)
Hi.

My game has several actors scrolling in from the right, about 20. They all have an invisible actor on it for it collision. At the moment my object actor and invisible collision actor move at the same speed across the screen.

What would be better on performance.

Having my object actors and invisible collision constrained to one another which will allow me to uncheck movable on either one?

or

keep it as it is without any constrains and leaving movable on all my object actors?

Thanks

Comments

  • app-etiteapp-etite Member Posts: 139
    hello?
  • InLikeFlynnInLikeFlynn Member Posts: 171
    Constrain is expensive and I've found move to be a bit unpredictable without constraints. You might want to try interpolate. Just use 2 interpolates if you're changing both x and y coordinates.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    having them unmovebale and interpolate at the same speed would be alot better then constainging
  • app-etiteapp-etite Member Posts: 139
    thanks but the thing with interpolate is that it works by going to a certain position within a certain time frame which is hard to calculate if i have a side scrolling game and need all the actors moving at the same speed at the same time.

    Can I have interpolate moving at a certain speed, not duration? because my actors are laid out on a 2000pixel wide screen and with duration set on then they will move at different speeds because they are in different positions right. : \ ?

    thanks
  • InLikeFlynnInLikeFlynn Member Posts: 171
    If they aren't starting and stopping you might be ok with move, which is less expensive than constrain. My experience with move has been that things can act a bit funny if they are starting and stopping without the use of constraints.

    Interpolate pretty much needs a beginning and ending value, so i don't think a continuous interpolate would work. You could try "every 1 second> interpolate" for both x and y, but that could also get messy. If you do that make sure interpolate lasts not as long as the timer.
  • app-etiteapp-etite Member Posts: 139
    thanks meatface

    I wish I could use Interpolate as everybody seems to love it as a good behaviour for better performance.

    DAMMIT!!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you can make a self attribute called intermove or something. then change intermove to self positionx-400 or something

    then in your interpolate behavior for the postiont interpolate to the attribute intermove

    since there all moving 400 pixels from where they are with the same duration you can keep the same speed.

    as hard as it seems you can use interpolate for just about everything. of course its not alwasy a easy fix, but its worth the time and effort. play around with it somemore.
  • app-etiteapp-etite Member Posts: 139
    Hey john.

    Thanks for advice.

    The way i have my game laid out is a very wide scene with various actors placed in the exact place i want them to be when they move on camera. With the move behaviour it perfect for this.

    Would having...when actors is less than 500 lets say.. Just before it moves onscreen.. Then switch it to interpolate across screen. Would that be worth anything on performance??
Sign In or Register to comment.