Adding an Action Replay/Rewind to a Game (Unity Tutorial)

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 61

  • @sammyalbert2787
    @sammyalbert2787 3 роки тому +14

    Brilliantly executed. One of the best Unity videos ever.
    You have won my loyalty.

    • @KetraGames
      @KetraGames  3 роки тому

      Thanks so much for this comment 😊

  • @ZacharyAghaizu
    @ZacharyAghaizu 3 роки тому

    Amazing!! I can't believe I missed this video. Basically I got an asset which didn't have the time scaling and ended up getting another asset and combining them together. The whole thing was clunky even though it worked. This could have saved a 4 weeks+. Just replaced the b= a++; with b = (a = a + 1); then 1 is the variable that can Change. So happy to have found this tutorial now as it was continuously bringing new issues. Now I can remove the other asset

    • @KetraGames
      @KetraGames  3 роки тому +1

      Great, really glad it will be useful 😊

  • @lucianoemanuelbascuraguero4086
    @lucianoemanuelbascuraguero4086 2 роки тому +1

    Pretty cool tutorial. Great job.
    I need some help tho. I need to make a "Replay" that is more like seeing another player doing the exact same movements that the player did before. But, it is not only the position but also the replay has to dash and shoot like the player.

  • @TerranIV
    @TerranIV 2 роки тому +2

    Wow, what a great tutorial! Thanks so much for walking us through this!!!

    • @KetraGames
      @KetraGames  2 роки тому

      Thanks so much for this comment 😊

  • @duckhive-games
    @duckhive-games 3 роки тому +1

    Basically a perfect tutorial. Thank you for this.

    • @KetraGames
      @KetraGames  3 роки тому

      Thanks for this comment 😊

  • @frostymug3123
    @frostymug3123 3 роки тому +1

    This was awesome! I also really appreciate the written instructions!!! New subscriber

    • @KetraGames
      @KetraGames  2 роки тому

      Glad you found it useful. Thanks for the great feedback 😊

  • @VolodymyrKarpenko
    @VolodymyrKarpenko 11 місяців тому +1

    Great tutorial! Thanks! I followed the guide and got it working with simple objects like the ball in the scene. I'd like to apply it also to the character, for example, downloaded from Mixamo and that have Animator component. Attaching the ActionReplay script to the parent doesn't work as expected. In Replay mode it changes position and rotation but of the whole object, the animations are not played. Could you advise?

    • @igniteshadow2902
      @igniteshadow2902 8 місяців тому

      I believe you could just add more variables to the ActionReplayRecord Class. For instance, you could add your current animation frame or something like that.

  • @rb76768
    @rb76768 Рік тому

    Thank youu!! Other vids made it look so complicated but in the end its simple!

  • @N9TN9
    @N9TN9 24 дні тому

    also recording the velocity makes the replay look smoother

  • @c0der23
    @c0der23 2 роки тому

    this is exactly what i was looking for in my game about time travel, this is such a great tutorial, good job!!

    • @KetraGames
      @KetraGames  2 роки тому +1

      Great to hear, thanks 😊

  • @Patricebrouh
    @Patricebrouh 3 роки тому +3

    I discovered your channel today and subscribed to it. Your videos are so instructives.

    • @KetraGames
      @KetraGames  3 роки тому

      That's great. Thanks for your comment 👍

  • @hcpdrummer
    @hcpdrummer 2 роки тому

    Thank you, thank you, thank you, thank you been looking for this tutorial for a long time!

    • @KetraGames
      @KetraGames  2 роки тому +1

      Glad it was helpful 😊

  • @unitytutorial3701
    @unitytutorial3701 2 роки тому +1

    Great Video, Thank you!
    I was wondering if there was an easy way to save the replays so they won't be deleted when closing the game.

    • @KetraGames
      @KetraGames  2 роки тому +1

      Hi, you would need to serialize the data to disk. The following documentation may help - docs.microsoft.com/en-us/dotnet/standard/serialization/basic-serialization 😊

  • @GameOnBudget
    @GameOnBudget 3 роки тому +1

    Epic 🔥

  • @sinan9205
    @sinan9205 2 роки тому

    Great Tutorial Thank You So Much!!!!!

  • @Underkirby
    @Underkirby 2 роки тому +1

    very cool :)

  • @christalbott450
    @christalbott450 11 місяців тому +1

    Breathe air. God made all. His son, Jesus, pardoned all of all wrongs.

  • @xalon
    @xalon 2 роки тому

    Since your saving the data every frame and rely on replaying that at a slower speed for slow motion, unless you interpolate the data between frames, it I don't think you can smoothly do a slower timescale
    Maybe I'm missing something, but although this would be useful for most people, it's more of a bandaid fix to a easily solved issue

    • @KetraGames
      @KetraGames  2 роки тому

      Hi, you're correct, the slow motion replay demonstrated here doesn't do any interpolation and would essentially be the equivalent of lowering the frame rate. This is a basic replay system that hopefully gives people an idea of where to start, but it can definitely be expanded and improved.
      You mention that this is an easily solved issue. I'd be interested to know what solution you have in mind when you say this.
      Thanks

    • @xalon
      @xalon 2 роки тому

      @@KetraGames i think my reply got removed, but essentially what it said was deterministic replay systems are a lot more feasible due to not being as memory intensive and more accurate compared to a save state replay system with interpolation.

  • @XadegamerOfficial
    @XadegamerOfficial 3 роки тому +1

    Thanks for the video.Won't this affect the game performance

    • @KetraGames
      @KetraGames  3 роки тому +2

      Yes, it will have an impact on performance. You would need to put a cap on the number of frames you store so that you don't run out of memory. The longer the replay and the more objects you have, the bigger the cost.

  • @natzos6372
    @natzos6372 5 місяців тому

    how would you make it so that you can have multiple different recordings?

  • @shortsdeliveries
    @shortsdeliveries 3 роки тому

    i have done a replay system recently, i had a list that had two informations which were the time in the timeline and data... I did this so i can watch the replay in the same speed and so i can slow motion it too... Then I found that the Update messes a few things and the FixedUpdate it´s not just fixed but it alsos fixes LOL

  • @minodab492
    @minodab492 2 роки тому

    Is there an easy(ish) way to save these replays to files and maybe create a replay system similar to that of Rainbow Six Siege for example, with free cam, and a dedicated menu?

    • @KetraGames
      @KetraGames  2 роки тому

      Hi, doing a full replay system with dedicated menu and custom cameras is possible but I probably wouldn't put it in the easy(ish) category 😊
      This is definitely something we would like to come back to in the future and do more tutorials on, but in the meantime there is an asset on the asset store that looks promising - assetstore.unity.com/packages/tools/camera/ultimate-replay-2-0-178602. It isn't free but does offer a lot of the functionality you're after.

  • @kidlaw6158
    @kidlaw6158 3 роки тому +1

    nice

  • @nomoreheroes5003
    @nomoreheroes5003 2 роки тому

    Can a replay editor be made with this method if possible how. can you make a tutorial about that. Iam asking for a replay editor like rockstar editor that is replay + free cam with insert keyframe , colour filters and so on

    • @KetraGames
      @KetraGames  2 роки тому

      Hi, you could definitely expand on this to add more features. It is on our list for the future to revisit and do a more comprehensive action replay series, but probably not for a little while 😊

  • @fabianarevalo2198
    @fabianarevalo2198 3 роки тому

    Hello, this was a great tutorial. I just need help with a problem I am having on my game. In my game I am using breakable assets, basically I have the normal asset and when it collides I activate the a bunch of fragments and deactivate the normal asset. I added the replay script to all the fragments and to the projectile that is breaking the objects. The problem I have is that when I activate the replay it is not synchronized with the projectile because the fragments where created after the projectile. Is there a way I can make the synchronize? Like add a delay to the fragments or to run the script while the fragments are unactive?

    • @KetraGames
      @KetraGames  3 роки тому

      Hi, this is a really good question and I think you would need to refactor this a bit to get it to work with inactive objects. As a script won't run on an inactive object, you could try moving all the replay logic to a central script running on an active object. This could then call out to all the objects in your game, active or not, to get and set the current state for the replay. It's not that easy to explain in words, but hopefully this makes some sense 😊
      At some point we plan to do a more detailed follow up on this video and we'll be sure to cover this problem.

    • @fabianarevalo2198
      @fabianarevalo2198 3 роки тому

      @@KetraGames How I was able to do it was by making a very similar replay script but with some modifications and added the one to the fragments. On the start from the new script I would get how many frames had been recorded from the normal replay script on the projectile and then add that amount of frames with the starting position of the fragments. So now the replay is in sync.

    • @KetraGames
      @KetraGames  2 роки тому

      @@fabianarevalo2198 Great to hear 😊

  • @asuna1732
    @asuna1732 3 роки тому

    How to rewind time to last 30 sec or something? script back me to start point. Please help

    • @KetraGames
      @KetraGames  3 роки тому +1

      Hi, you would need to set a maximum size for the list of data stored. Once you get over the maximum you could then remove the first entry. This will then limit the replay to a set number of frames. Hope that helps 😊

  • @lionkillerhaha
    @lionkillerhaha 3 роки тому

    I tried doing this but my object freezes mid-air and goes through my plane even though it doesnt without the script :/ it has something to do with adding the records each fixed frame.

    • @KetraGames
      @KetraGames  3 роки тому +1

      Hi, could you try copying the final script from www.ketra-games.com/2021/01/adding--an-action-replay-to-a-game-unity-game-tutorial.html to see if that helps? If not, can you send over some more details and we can try to work out what's going on

  • @idlefang5014
    @idlefang5014 3 роки тому

    this is an absolutely amazing tutorial thank you but I have a huge problem I need the animations my player does to go along with the replay normally I try and solve stuff myself and very rarely ask but I have not the faintest clue on how to try and get that it would be infinitely helpful if you could reply and try and tell me how I could do that or if you could point me in the rt direction huge thanx in advance :)

    • @KetraGames
      @KetraGames  3 роки тому +1

      Hi, glad you found this useful. Adding animations to this is a really interesting challenge. One way to do it would be to use the recording functionality of the animator.
      docs.unity3d.com/ScriptReference/Animator.StartRecording.html
      When switching to replay mode you would stop recording and start playback
      docs.unity3d.com/ScriptReference/Animator.StartPlayback.html
      You would then need to work out the playbackTime to pass in as your replay progresses.
      The downside of this approach is that once you stop recording I don't think there is a way to resume recording from that point, so it would be ideal for one off replays such as kill shots etc. but not for a continuous replay system.
      Another option is to add the relevant animation state to the replay data. You can get the current state from
      docs.unity3d.com/ScriptReference/Animator.GetCurrentAnimatorStateInfo.html
      You could then set the correct animation and animation time on the animator during the replay.
      Hope this helps get you started. Let us know how you get on 😊

    • @idlefang5014
      @idlefang5014 3 роки тому

      @@KetraGames wow thanks so much il definitely look into all that when I have time!

    • @idlefang5014
      @idlefang5014 3 роки тому

      @@KetraGames iv been trying for the past while but im so confused with it all and I cant find any videos on it or anything and iv read the documentation over and over again I just cant figure it out do you know of any tutorials or other stuff that might help or like an example script using it or something thnx in advance :)

    • @KetraGames
      @KetraGames  3 роки тому

      @Idle Fang, sorry I've not been able to find any tutorials covering this either.
      Could you describe how you are planning to use the replay system in your game please? Maybe we could look at covering your scenario in a future video.

    • @idlefang5014
      @idlefang5014 3 роки тому

      @@KetraGames I'm making a skateboarding game and I just want to have it so you can record and watch your tricks it was all working well except for the animation part cuz when you flip your board or do any tricks the character switches to an animation of the legs spread in the air but if I view the replay the player doesn't do any animations I feel like this should be super simple and common but I guess I was wrong thnx for all the help tho it definitely means alot of you have any questions I'm happy to aswer :)

  • @motobike5Dev
    @motobike5Dev Рік тому

    It’s not working for me