Making Interpolated Actors Go Faster?

EMPW09EMPW09 Member Posts: 15

In the process of making an endless runner, and I'm using the interpolation behavior to move the platforms toward the runner. I would like to make the platforms go faster gradually over time, but I don't know how to do it SMOOTHLY. I've already tried creating a game attribute that would adjust the speed on a timer, but GS only allows for interpolation to be adjusted by whole seconds. Help me!!!

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Have you tried the Move Behavior? Using Interpolate for moving platforms probably isn't the way you're going to want to go about achieving that effect. You can plug a game attribute into the Move Behavior.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    @EMPW09 said:
    . . . . GS only allows for interpolation to be adjusted by whole seconds . . .

    Unless the PC version is (radically) different from the Mac version you should be able to adjust the Interpolation behaviour's duration value by fractional values ?

    I am on a Mac, and can place two objects on the left of my screen, one is asked to interpolate to the righthand edge (x = 1024 pixels) in 40.2 seconds and the other actor is asked to do the same in 40 seconds . . . the actor that is interpolating over 40 seconds (rather than 40.2) gets to its destination earlier.

  • EMPW09EMPW09 Member Posts: 15

    @Braydon_SFX I tried using move, and that works well with picking up the speed, but whenever the runner runs into the side of the platform (my platforms have a lot of height), the runner starts pushing the platform back. Needless to say, I don't want that effect.

  • EMPW09EMPW09 Member Posts: 15

    @Socks I'll try it one more time, but it didn't seem like it was changing anything, so the PC version really might be different.

  • EMPW09EMPW09 Member Posts: 15

    @Socks no dice!!

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

    @EMPW09 said:
    Socks no dice!!

    Could you describe the test you did and what the results were . . . . ?

  • EMPW09EMPW09 Member Posts: 15

    @Socks I set a change in interpolation on a timer: every 5 seconds, [change attribute] set "platform.speed"(which is 4 seconds long) to "(platform.speed-0.5)" ---- it did absolutely nothing.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    @EMPW09 said:
    Socks I set a change in interpolation on a timer: every 5 seconds, [change attribute] set "platform.speed"(which is 4 seconds long) to "(platform.speed-0.5)" ---- it did absolutely nothing.

    Sorry, not sure what's going on, best of luck.

  • EMPW09EMPW09 Member Posts: 15

    @Socks thanks. I guess since I'm here, I can also ask if you know how to make sure the platforms don't get moved when colliding with the runner at the side? That was all I was trying to avoid.

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659
    edited July 2014

    Do the platforms move offscreen and then destroy and new ones spawn?

    Is the timer in the platform actors or a second actor?

    If the platforms are respawning you would need the timer in a separate actor and the platform time variable needs to be a global variable. This way it can keep changing over time. Otherwise when the platforms respawn the time goes back to normal.
    Not sure how you have it set up but that could be the case.

  • EMPW09EMPW09 Member Posts: 15

    @erockross‌ I do have a separate actor and a global variable. It's not working!

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    Does everything else work correct, the platforms keep moving properly? Just they don't pick up speed?

  • EMPW09EMPW09 Member Posts: 15

    @erockross‌ they do pick up speed, but a one-second difference is so drastic that the platforms "jump" to the next speed--instead of looking like a progression, it looks like a frame skip

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    ah, did you make sure that the attribute is a real number and not a integer?

  • EMPW09EMPW09 Member Posts: 15

    @erockross‌ Ha! I did have it as an integer. Changing it to real didn't fully solve the ultimate issue, but I'm a step closer. Thank you!

  • FrozoneFrozone Member Posts: 2
    edited November 2014

    @EMPW09 Hello! I'm not sure if this was answered elsewhere, but I'm new to GameSalad for Mac (love it!) and this is my first (real) post! :)

    I used interpolation to smooth out platform speed changes, with something like this:

    (All attributes are real)

    When [your trigger condition]:

    Change attribute game.CurrentLevelStatic to game.CurrentLevel

    Interpolate attribute game.CurrentLevel to game.CurrentLevelStatic+1

    Duration: 0.5 (or whatever you like) Function: Ease in (or whatever you like)

    Of course you can also have the duration change over time so that the levels ramp up faster as time goes on. Depending on the speed of the platforms, this may not even be that noticeable.

    Hope this helps, and thanks all for this great forum!

Sign In or Register to comment.