- Home /
Record events for replay (time-travel)
Hi guys !
I have an idea for a portal-like puzzle game about time travel but I don't know how to make it work with what I know in javascript.
I need to be able to "record" some actions, like the player movements, some triggers and replay them when the player goes back in time (so he can interact with his past self).
Any easy way for this to be done ?
Thanks in advance !
Manny
Answer by Jeffom · Jan 13, 2014 at 12:00 PM
There's no easy way of doing it.
First you must implement a some sort of logger to register player's input or character's movement.
Second you need a system to read those logs and then backtrack the actions to the desired point.
Pretty much yes, you also need to invert everything so Instantiate becomes Destroy and vice-versa, animations and sounds are played with negative speed. I would think you do not need to register the Transform for each frame, you may try out the frequency that suits best. Then you can lerp between positions, it is not as accurate but it saves memory. You may constrain the amount of time using some kind of modified queue. When you reach a certain amount of items then you remove the first and add one.
Your answer
Follow this Question
Related Questions
C# Scrubbing back through an Animation in script 1 Answer
Fog density over time. 1 Answer
Calculate in Seconds not Frames? 2 Answers
Pause Time when certain level loaded? 3 Answers
Digital Clock: Time.time > 60 2 Answers