Time Rewind

Get help using Construct 2

Post » Tue May 14, 2013 4:54 pm

Hey~!

I'm making a game where player has the abillity to travel back 10sec in time.Player should be able to activate his time rewinding watch anywhere on a layout.I tried saving position in a variable every tick and restoring player position..but it didn't work.

I also need the world to rewind 10sec back in time too!

Can anyone please help me here?Time rewind mechanics?

Thank You~ratulrafsan2013-05-14 16:57:54
B
2
Posts: 7
Reputation: 166

Post » Tue May 14, 2013 5:13 pm

You dont need ONE variable, you will need an array, because you must store many positions. I would also recommend to store position data every second and not every tick.
B
7
S
1
G
1
Posts: 32
Reputation: 1,016

Post » Tue May 14, 2013 7:18 pm

Thanks for your reply :)
I don't have good experience with array..But I'll give it a try.
B
2
Posts: 7
Reputation: 166

Post » Tue May 14, 2013 11:22 pm

Here's an example I made last week showing how to rewind time at different speeds. It should be close to what you're looking for. It's not limited to 10 seconds, but you could limit the width of the recording array to 10 seconds worth of information (600 cells assuming 60 fps).

Demo
Capx

EDIT: I've since uploaded an improved capx that attempts framerate independence. View it here.
Last edited by zatyka on Tue Feb 25, 2014 4:47 pm, edited 1 time in total.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Wed May 15, 2013 8:17 am

@zatyka good one!
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Wed May 15, 2013 12:23 pm

@zatyka

Awesome! Thanks for sharing
B
33
S
15
G
6
Posts: 242
Reputation: 4,343

Post » Wed May 15, 2013 12:35 pm

@zatyka

This is a spectacular sample! Do you are doing a tutorial?TELLES08082013-05-15 12:36:19
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,206
Reputation: 18,331

Post » Wed May 15, 2013 7:57 pm

@zatyka
AWESOME! just thing i was looking for! thank you soooo much :D
B
2
Posts: 7
Reputation: 166

Post » Wed May 15, 2013 11:05 pm

@zatyka

I can ask for an explanation about it? could not understand how you can store that amount of data in a single array.

Where is the magic?
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,206
Reputation: 18,331

Post » Mon May 20, 2013 9:24 pm

Sorry, been away on business for a while. I'm glad you guys found the example useful.

@TELLES0808
Regarding a tutorial, I'd consider it, but I'd feel more comfortable if the rewind effect was framerate independent. I haven't tried to figure out how to do it, so I don't know how difficult/possible it would be to implement.

As far as the amount of data stored in the array, I don't think it's an unreasonably large amount. At 60FPS, 25200 elements of data are stored every minute in my demo. I don't believe this would cause any drop in FPS, as we're really just adding, deleting, reading, or writing the last column of the array. Unless you're recording for about 4 months straight, you won't come near the limit of an array's size. The only concern I can think of is memory usage, but I don't think this would be an issue unless your recording spans a very large amount of time (hours). Perhaps someone more knowledgeable on the subject of array memory usage can comment.zatyka2013-05-20 21:53:08

EDIT: Added my attempt at frame rate independence to my earlier post.
Last edited by zatyka on Tue Feb 25, 2014 4:48 pm, edited 1 time in total.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Next

Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Kagubro, Mirlas and 26 guests