Time Rewind

  • Tatsuya7

    You'd need to treat every rewindable object in your world the same way as the player in my example. I'd probably associate an array with each object (perhaps via containers) to record it's data. It comes down to two things:

    • When the game is "playing", saving the relevant data about each object (e.g. width, height, angle, frame, acceleration, angle of motion, etc)
    • When the game is "rewinding", set each object's parameters based on its saved data

    Implementing a system like this must be carefully thought out and tested, especially if there's a lot of interaction between rewindable objects.

  • zatyka

    Hi zatyka, thank you for help

    I tried but my object stop moving when i push space

    I added Rotate acceleration, rotate speed, animation name, animation frame, cycle position, sine magnitude, sine period.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tatsuya7

    It's impossible to troubleshoot with only the info you provided. Theoretically, you could post your capx and I, or someone else, may be able to fix the issue. However, that will only get you as far as your next issue.

    Implementing features with any level of complexity in your game requires you to become comfortable with both the engine's plugins, and the various methods of debugging. For example, walk through the recording/rewinding process step-by-step. Is that data being recorded to the array as expected? Is it recalled as expected? Find the specific events that are not behaving correctly, and investigate why.

  • waw thanks for the capx file , that its a verry usefull capx

  • Hi,

    Firstly, thanks for this great example.

    Even though I manged to implement it in my game project successfully, I fail to understand how values flow.

    I understand the core concept of a table which records value every frame(dt) and when we press the trigger we are just setting the sprite in those recorded position data in reverse order. But I don't completely understand the maths and the code. Even after sitting with a pencil and paper and putting values in it manually I couldn't grasp the whole thing which I need to understand so I can troubleshoot parts of the mechanics and to build upon it.

    Here is what I did. I basically stripped it to record just the players XY position and a different objects's Y position.

    I decreased the height of the array to 4. I removed the speed function made it a fixed value.

    What I'm trying to do is

    A) To program it to ease into the rewind (starts slow till it reaches a maximum speed. I read the lerp can help with this but I don't know how to implement it(I tried to put it in the speed value but then I realized it's becomes a static value till it reaches the while loop))

    B) Create and specify a cooldown value before the player can use the power.

    C) Limit the array to record only a set amount of seconds.

    D) The array retains its values if my player dies and the layout restarts. (playback the old games postions) Even after clearing the array on layout start and then adding the starting position values to it afterwords it gets stuck a the corner of the layout. (one solution would be to stop rewinding after it reaches array width one and triggering the cooldown. maybe.)

    E) This is only the base event sheet which the players movement and powers so I want only the player to get his actions recorded in it. If I make different levels/layouts, I think that creating a different array for them and redoing the recording codes for the objects I want to move. Is this the right way to do it? Can I trigger an object to start recording on a certain event?

    Its way too much to ask. Instead I would like to learn how it all works.

    Can someone please help me understand the different part of the code and how the array is creating new rows and how 'set value at(Record.Width-1,0) to lerp(Record.At(Record.Width-2,0), Player_spawner.X,((1/60)/dt)*i)' works (especially how is using lerp helpful).

    Thank you.

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