Time Rewind

Get help using Construct 2

Post » Sun Feb 09, 2014 7:27 am

Wow,thanks! I've got a question,how can i clean an array,for example if i need a restart of the game? I tried but main character teleporting to x,y(0,0),Could you please help?
B
3
Posts: 7
Reputation: 281

Post » Tue Feb 25, 2014 4:46 pm

FYI - I updated my earlier post to reflect an improved capx that attempts frame rate independence.

@arthymon
You can delete X elements of the array to clear it, but be sure to leave at least 1 X element with valid coordinates (usually the starting position of the character). If you completely delete the array, the game will read a non-existent element as 0.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Sun Mar 09, 2014 8:27 pm

@zatyka

Awesome example. any tutorial for it?
B
4
Posts: 1
Reputation: 257

Post » Mon Mar 10, 2014 1:27 pm

@erec91

I haven't written any tutorial. I'm happy to answer questions regarding how it works, but writing a full tutorial is not something I'm interested in at this time.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Sun Feb 08, 2015 11:58 pm

@zatyka
Hello, I used for my game project Time Rewind, its working well for my player but how make the world rewind? for exemple leafs falling with sine behavior? and also enemy moving lef to right with sine behavior?
Thank you
B
4
Posts: 2
Reputation: 325

Post » Mon Feb 09, 2015 4:01 pm

@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.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Mon Feb 09, 2015 5:55 pm

@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.
Last edited by Tatsuya7 on Fri Feb 13, 2015 3:09 am, edited 2 times in total.
B
4
Posts: 2
Reputation: 325

Post » Mon Feb 09, 2015 9:45 pm

@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.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Mon Feb 09, 2015 10:40 pm

waw thanks for the capx file , that its a verry usefull capx
ImageImageImageImage
B
48
S
12
G
43
Posts: 1,101
Reputation: 28,091

Post » Sun May 17, 2015 5:29 pm

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.

Image

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.
B
21
S
1
Posts: 40
Reputation: 908

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: flemmig, semaso, Skebab, Virpoja and 12 guests