Rewind time?

0 favourites
From the Asset Store
Time rewind like in "Braid". Choose objects that will be affected by time rewind
  • I think it's really cool that you can slow down and speed up time, but is there anyway to play it backwards? I know I can't put a negative number in, but is there a plugin or any other way to do this?

    My game uses physics, so the closest I can get to reversing time is reversing physical forces by stopping the velocities of all objects and then applying the opposite to them.

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

    This has also occurred to me... I was just hoping there might be a slightly less work intensive way of doing it. Thanks though, if a day goes by without any easier suggestions I'll definitely start working on this.

  • Well it's not easier, or less work, but we have interpolation to make it less data intensive.

    So rather than save data every tick you could save it at every x milliseconds and use lerp() on the positions.

  • Well it's not easier, or less work, but we have interpolation to make it less data intensive.

    So rather than save data every tick you could save it at every x milliseconds and use lerp() on the positions.

    That was going to be my next question, is how processing intensive would be to record all of these variables for all these objects per tick. Glad to know there's a way to cut down on that, thanks for the tip!

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

    I'd like to start working on this, but I don't know how to use arrays. I've read and watched a lot of tutorials about it in the past but could never wrap my head around it. Would you or anyone else be willing to show me how to put even a single one of these variables (such as angle or whatever) into an array that can be played backwards?

    If I can see how it works I could set it up for all the other variables, I should even be able to figure out how to use lerp() just fine on my own it looks pretty straight forward.

    https://drive.google.com/open?id=1Qzqph ... AsseETcFyM

  • Not sure I've seen a construct2/3 game with reverse time.

    So you may have to be the maverik on this one!

    The only real way to find out about performance is to make a test engine yourself.

    Sure there will be some trade off between how much and how often you record the data and performance

    but it may not be that bad especially if it is just position data.

    I think you may be complicating things by including physics as at the end of the rewind you would have to re implement whatever physics were present but still should be doable.

    Ideally you want to record every frame so I would start from there.

    If that is too much then maybe try 1/30 times per second with interpolation as newt as suggested

    As for learning arrays, they are not the scary monsters that they seem.

    Just visualize a spreadsheet which you can add and retrieve data from.

    there are only a handful of construct actions that you need to understand to do this.

    For starting off, (just to understand) I would suggest simple test platformer (without physics)

    Then just make a 2 x 120 array (this will give you two seconds of rewind)

    and every frame populate the array with the x y position of the player sprite.

    probably use the push pop method for this.

    push adds the latest value to the top moving everything down and pop removes the oldest value from the bottom so the array does not keep growing.

    that is the easy bit.

    the fiddly bit will be writing the events for rewind to read the array from the bottom to the top and apply them to the player sprite

    but still shouldn't be that complicated.

    But yea would love to see reverse time in action in a C2/3 game.

    I hope you give it a shot.

    PS. Im at work so cant make examples, but if I have the time during the week evenings I may try something cant promise though.

    (edit) now that Im thinking about it you may have to make the recording interval separate from frame rate and probably will need to have to smoothly move between the points if it reversing with slowdown. But anyway start with the simple example above to kick off the learning process.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For starting off, (just to understand) I would suggest simple test platformer (without physics)

    Then just make a 2 x 120 array (this will give you two seconds of rewind)

    and every frame populate the array with the x y position of the player sprite.

    probably use the push pop method for this.

    push adds the latest value to the top moving everything down and pop removes the oldest value from the bottom so the array does not keep growing.

    I'll definitely give it a try. Since you're hoping I do, I'll send you a .capx if I'm able to pull it off, but it will probably take me some time just to figure out how to populate the array with data.

  • cool dude.

    yea, if you are serious about making this sort of game,

    or in fact serious about becoming a game dev full stop

    then just drop everything and go learn arrays and all the things they can do for you.

    then you will be like "yea I wanna reverse time, that be easy....."

  • cool dude.

    yea, if you are serious about making this sort of game,

    or in fact serious about becoming a game dev full stop

    then just drop everything and go learn arrays and all the things they can do for you.

    then you will be like "yea I wanna reverse time, that be easy....."

    I never actually understood why arrays are even used at all, they just seem like a really confusing way to store data. Most of the information I've tried to digest about them is very beginner level, so the examples given on what you can do with them are always things that would be easier to keep track of with a labeled variable.

    I do understand that arrays are "powerful" I just don't know why. Definitely have a lot of learning to do... Maybe I should search this forum for arrays so I can see what other people are using them for and why.

  • Im not sure how well it would hold up to an excessive amount of points but you could try rex's spline plug.

    I used that method in Construct Classic using Rojo's plug, but it had a way to reverse the spline.

    You would still need to use an array to store a set of points here.

    I would suggest two arrays as a stack, one for each axis.

  • An array is just a large amount of values. For a rewind just save the position of everything every tick. It doesn't make things slow.

    For example look here. It's basically just one action to record, and one action to rewind. Performance will be the same if you just started recording or have been playing for an hour.

    https://www.dropbox.com/s/9sgk5a2meazat ... .capx?dl=1

    Probably an array per object you want to rewind will do.

    It's based on this older example I made that makes a recording of every attempt.

    https://www.dropbox.com/s/lipjb22xahgej ... .capx?dl=1

    Now, if you can use lerp if you want to rewind slower than a frame at a time or want to account for variances in frame time. It's a bit more involved and probably isn't necessary.

  • Arrays "is everywhere. It is all around us. Even now, in this very room. You can see it when you look out your window or when you turn on your television. You can feel it when you go to work... when you go to church... when you pay your taxes. It is the world that has been pulled over your eyes to blind you from the truth." ..(Morpheus)

  • An array is just a large amount of values. For a rewind just save the position of everything every tick. It doesn't make things slow.

    For example look here. It's basically just one action to record, and one action to rewind. Performance will be the same if you just started recording or have been playing for an hour.

    https://www.dropbox.com/s/9sgk5a2meazat ... .capx?dl=1

    Probably an array per object you want to rewind will do.

    It's based on this older example I made that makes a recording of every attempt.

    https://www.dropbox.com/s/lipjb22xahgej ... .capx?dl=1

    Now, if you can use lerp if you want to rewind slower than a frame at a time or want to account for variances in frame time. It's a bit more involved and probably isn't necessary.

    As usual I am in awe of the complex simplicity in the way you do things. Rewind in 2 actions. Damn.....

    Didnt realize you could save and set a sprite's whole state as a JSON that is a really neat feature . Construct still surprising me after over a year...

  • R0J0hound

    Absolutely amazing. Should be a snap to build my own version of this as soon as I learn arrays!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)