Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Time Travelling - A New Approach?

Discussion in 'General Discussion' started by LukasKallenbach, Aug 7, 2013.

  1. LukasKallenbach

    LukasKallenbach

    Joined:
    Oct 10, 2012
    Posts:
    12
    Hi,

    I am currently experimenting with an approach to time travelling in games. The idea is that, if fast forwarding a game is possible, time travelling can be implemented based on that:

    - To travel backwards in time, reset the game to the state it was at "start", then forward from there until desired point.
    - To travel forward in time, fast forward.

    Player actions would need to be recorded and then included in the fast-forwarding.

    Does anyone know if this has been done before? Games about time travelling that I have seen so far only do it by basically recording the gameplay and then rewinding.

    One major challenge seems to be making fast forwarding "consistent with real time" - often, when fast forwarding a game using timeScale, the result appears to be different than what it would have been if the game had run in real time. Has anyone encountered these problems and found a solution?
    (I'm currently working on finding out which Unity features stay "consistent" when fast forwarding and which don't)
     
  2. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    If you're recording all the player's actions anyway, I don't see why anyone would prefer restart-then-fast-forward to just rewinding. It would be like watching a dvd and deciding that the best way to go back five seconds would be to restart the movie and fast forward through 20 minutes that you just watched. Rewinding is faster and makes more sense.
     
  3. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Random-access to a timeline of events is best for performance, so you can just jump to any moment in time without having to `seek` it forwards or backwards. Most likely you just record state over time with some timestamps.

    Deeper thought: time=space.
     
  4. LukasKallenbach

    LukasKallenbach

    Joined:
    Oct 10, 2012
    Posts:
    12
    About rewinding: It's an interesting option, but only works out if all player actions are mathematically reversible. Which might be easy for movements (same distance, negative value), may be a bit more tricky for destroying GameObjects, but maybe not. I might look into that (Now just staying with the fast forwarding from scene start seems like the lazy way).

    Hmm, timestamps... That'd mean creating basically a save game e.g. every few seconds, letting user go back to that? Definitely nicer for performance compared to going steps backwards by simulation, but may start taking a lot of memory space depending on how many timestamps are needed.

    Edit: I'm actually looking into building a "time travelling engine", a framework that enables time travelling which games can be built on.
     
  5. SpaceMammoth

    SpaceMammoth

    Joined:
    Jan 2, 2013
    Posts:
    220
    If your interested in games with time travel - its definitely worth checking out Achron: http://www.achrongame.com/site/
    Its a RTS with very interesting mechanics for being able to go back time and change the future - annoyingly the game really doesn't perform well on my machine so I got bored and never really gave it a chance - but I love the concept.
     
  6. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    There're a few games which use time manipulation, such as Braid and The Misadventures of P.B. Winterbottom. The earliest I can recall (can't remember it's name...from maybe 10 years back) physically recorded your gameplay... anyone remember what it was? (I think it was an Xbox 360 title).

    And of course a lot of physics based games use pre-cached outcomes (esp when dependable deterministic physics are hard to create), so you could say there's more of it going on than meets the eye.

    Anyway, physics tricks aside, there's not enough time manipulation in games...there are so many opportunities for interesting game mechanics. It's very sad none of the Doctor Who games made use of any...all of the obvious places for it.
     
  7. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    Well I dont want to spoil it but "no one has to die" features a somewhat unique take on time travel. Used white text to not spoil it.