Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[Released] Ultimate Replay - Complete state based replay system

Discussion in 'Assets and Asset Store' started by scottyboy805, Jun 28, 2017.

  1. FMWFiremage

    FMWFiremage

    Joined:
    Mar 19, 2015
    Posts:
    6
    Hi, thanks for the response.
    I can't see any warnings related to missing chunks, but I have just recorded a snapshot in Unity Editor of everything that is happening if this is of any help, you should notice the slight stutter at regular intervals in the play back.
    https://www.dropbox.com/s/hn0sc8nro...andalone_ _DX11_ 2019-04-25 14-16-57.mp4?dl=0
     
  2. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Thanks for taking the time to create the video. From the console messages it looks like it is using the cached chunks correctly so there may be another issue. Are the 7 warning messages related in any way? It may be that the chunk pre-fetch algorithm is not keeping up with the playback speed but I will have to do some testing on this.
     
    FMWFiremage likes this.
  3. FMWFiremage

    FMWFiremage

    Joined:
    Mar 19, 2015
    Posts:
    6
    No problem, thanks for looking into this for me.
    I forgot to set the warning to visible on the video, sorry about that. I have uploaded the warnings in the image.
     

    Attached Files:

  4. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Thanks for providing the warnings. They all look perfectly normal to me so it looks like the chunks are being loaded and cached correctly. At the moment all I can think is that the streaming thread is not scheduling far enough ahead and that playback is catching up with the file operations.
     
    FMWFiremage likes this.
  5. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Ultimate Replay version 1.1.5 has been submitted to the asset store for review and will be available for download within a couple of days. This version contains minor bug fixes mostly related to duplicate replay id's being assigned.
     
  6. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi again,
    I have had chance to look into this but cannot seem to reproduce it with the demo scene. Could you try testing the demo scene at 'Assets/UltimateReplay/Demo/ReplayFileTargetDemo.unity' and see if the stutters still occur. If the stuttering still occurs then it may be worth trying version 1.1.5 as above when released as this is the version we used for testing simply because we had a project setup with it.
     
  7. FMWFiremage

    FMWFiremage

    Joined:
    Mar 19, 2015
    Posts:
    6
    Hi, yes no problem, I will give it another test over the weekend and see how it goes. Thanks again for checking this out.
     
  8. FMWFiremage

    FMWFiremage

    Joined:
    Mar 19, 2015
    Posts:
    6
    Hi there,
    I checked the Demo you mentioned and I don't get a stutter at all on this with the version I am using, but what I did notice was the Record FPS was set to 48, so I tried upping the Record FPS to 48 on my testing and it got rid of the stutter which is great. The next thing I tried was putting my FPS back down to 8 and increasing it gradually, as the Record FPS increases the stutter gets less and less until you don't notice it. So I think I should be able to find a Record FPS that works without having a massive file size hopefully.
    Just one thing I was wondering on all this, could it be something as simple as the replay not interpolating properly between chunks?
    Thanks again for the help.
     
  9. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi again,
    That is an interesting observation. Hopefully we will be able to recreate the stutter by reducing the record rate and then we may be able to properly debug the problem. I don't think it will be an interpolation issue just because of the way the snapshot interpolation works but we will keep that in mind.
     
    FMWFiremage likes this.
  10. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Ultimate Replay version 1.1.6 has been submitted to the asset store for review. This version includes a few bug fixes mostly related to the ReplayAnimator component.
     
  11. Mairee

    Mairee

    Joined:
    Jun 27, 2018
    Posts:
    15
    Like dream league soccer has an option to share its replay on social media, can we do so like that?
     
  12. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi,
    There is nothing built in to support sharing of replays but Ultimate Replay can save to a replay file which you can share over the network like any other file so it is certainly possible. How you handle that sharing and downloading will be up to you though.
     
  13. indieDoroid

    indieDoroid

    Joined:
    Jan 25, 2016
    Posts:
    273
    +1 for a function to share my replay onto Twitter, instagram etc. :)
     
  14. adam-goodchild-omobile

    adam-goodchild-omobile

    Joined:
    Jan 12, 2017
    Posts:
    13
    Has anyone tried this with an IK system? Would like to be able to replay something back which was recorded when IK was enabled.
     
  15. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi,
    Thanks for the feedback but I think this would be outside the scope of the asset as we would need to rely upon other API's to share the content which would bloat and complicate the package. The replay file is after all just a binary file so there are no internal limitations to prevent you implementing this sort of thing on your own. We may be able to create an add-on asset at some point to support these features but for the moment we want to focus on core features and bug fixes for the asset.
     
  16. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    HI,
    IK objects and ragdolls can be recorded by attaching a ReplayObject component to the root object and a ReplayTransform component to each joint in the hierarchy of the object. You should then see that any IK movements or physics based joint movements are replayed properly. I would suggest trying the trial version which can be downloaded for free to see if Ultimate Replay suits your needs. You can download it here.
     
  17. adam-goodchild-omobile

    adam-goodchild-omobile

    Joined:
    Jan 12, 2017
    Posts:
    13
    Thanks, appreciate the help!
     
  18. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    185
    I've got a very specific task and I wonder if it can be achieved with UltimateReplay:
    We're building a VR training app for workers. They should do the exercise untrained, then get some lesson on how to optimise it and repeat the exercise afterwards. I want to record the two attempts and, in the end, play them back to them as "ghosts" side by side.
    My approach could be to setup two scenes, with the same Replay File Target, and load the additively with a small offset while playback. Is it possible to not overwrite the already recorded Data in the File Target?
    Another approach could be to use a two ReplayManagers, but the Singleton seems to have problems with this.
    Maybe there's another solution for this? Thanks in advance!
     
  19. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi,
    As you may already know, playing multiple replays simultaneously is not supported at the moment. It is not something that could be easily added either due to the way Ultimate Replay works. Your two scene approach sounds like it could work with a bit of modification to Ultimate Replay. Ultimate Replay stores a ReplayScene object in the ReplayManager script which contains all replay objects and state information for the scene. i think the easiest method would be to modify the source code so that you can have 2 or more ReplayScene instances and switch between the active replay scene from the ReplayManager. It would mean that you would likely have to switch between the replay scenes every fame in order to keep them updated correctly. Also seeking the ReplayFileTarget every frame which will likely be needed in order to playback 2 offset replays might cause havoc with the buffering system and as a result could affect playback performance but then again it may perform just fine.

    Let me know if you need any help with the details or have any more questions.
     
  20. jafioti

    jafioti

    Joined:
    May 28, 2015
    Posts:
    8
    Hi, I love the plugin so far, but I have a few questions.
    First off, I am using this in a VR app, if that makes a difference.
    1) I have a picking up system where objects are parented to the players hand so that they can move them around. Currently I put the replayObject and replayTransform on both the player's hands and every part of the object. This results in the object disappearing in the replay when I pick it up and reappearing when I put it down in a new location. Not sure if I should also be putting the replay scripts on only the top-level object or all of it's children.

    2) Since I am in VR, I would like to record the scene, but be able to use another camera to view the replay so that it can be displayed on a normal computer screen. How would I go about doing that?

    Thanks for the help!
     
  21. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi,
    Glad to hear you are liking our asset :)
    1. When this occurs are you able to find the object in the hierarchy and if so is it located at 0,0,0? Also you say that you have a ReplayObject attached to the hands and every part of the object. I assume you mean that the object you want to pickup has a ReplayObject script attached otherwise parenting will not work as expected during playback.
    2. You can use any camera you like to view the replay. You just need to make sure that it is active in the scene. In the demo scenes Ultimate Replay uses a different camera to view the playback and the reason it does this is so that you can use a free cam to move around during playback. To achieve this all we do is create another camera with the necessary free cam scripts attached and then when we enter playback mode we snap this additional camera to the active cameras position and rotation and then make it active for rendering.
     
  22. jafioti

    jafioti

    Joined:
    May 28, 2015
    Posts:
    8
    No, it isn't going to 0, 0, 0. In the playback it goes to a very small number fro x, y, and z, something < 1. Also the object I am picking up is made up of many children, so I only attached the replay scripts onto the top parent object.

    Here is a video:
    https://psu.app.box.com/s/rm84fch0vtgru18oke01380a37r09c4y
     
  23. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Thanks for the video.
    If the values are not 0,0,0 then I assume that the pickup object is being added as a child of the hand during playback just as it was when recording? If this is the case then the only thing I can think of that could cause this behaviour (apart from a bug) would be another script / physics component altering the position of the pickup object during playback. If you have any scripts attached to the pickup object or that reference the pickup object then I would just check that you are not altering the transform values during playback. You can use 'ReplayManager.IsReplaying' to move objects only when playback is not active.
     
  24. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    194
    Hi,

    I am looking for a solution to record the animation generated from a controller (animator motions). For example, i have animal motions that are trigered by the WASD keys. The animal can walk , run, jump etc... using the keyboard shortcut. I would like to capture the realtime animation with ultimate replay to render it to a video afterward. Basically this would provide an almost realtime animation workflow for film. I tried with the "unity recorder" but the transform data isn't being recorded, only the "in place" motions are being record. I tried the demo version of ultimate recorder but the transform is recorded without the actual motions... Do you know if this is possible? I would buy your asset immediately if it does.

    Thank you!
     
  25. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    It is possible to record an animator component using a ReplayAnimator. It is included in the trial version so you can test it before purchasing. You just need to add a ReplayAnimator component to the object and add a reference the the Animator that you want to record. I should mention that the ReplayAnimator is still an experimental component so may be missing some features or contain bugs but from our testing it works for the most part. To record the objects movements you will also need a ReplayTransform component attached to the object.
     
  26. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    194
    Hi,

    Thank you for the quick reply. I tried the demo and I think the controller recording still need some work. Sometime it works but most of the time it doesn't (meaning the transform is recorded but the motions from the controller aren't) But I see great potential in this asset. I believe I am not the only one that would gain from using your asset to generate quick animation in realtime.

    One quick question: where is the animation stored once recorded? When hitting stop you lose the ability to play again so I am not sure how I can edit the animation afterward on the timeline.

    Thanks.
     
  27. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Would you be able to send us a repro project of this to info(at)trivialinteractive.co.uk so we can work out why it is not working? As for where the animation is stored: Any recorded data is serialized to a ReplayState object which is essentially a sequential byte buffer and then the actual storage method of that buffer it determined by the type of storage component you are using and the implementation details are not exposed to the user.
     
  28. jafioti

    jafioti

    Joined:
    May 28, 2015
    Posts:
    8
    Thanks for the reply,
    there is no scripts that alter the position, but here is what I believe is happening.

    So the replay transform tracks the transform position, and when I parent the pickup object to the player's hand, the local position is being set to a really small number because the object is super close to the hand. I think the replay script is seeing this as the position of the object and during playback it sets this as the position but in world space, so it ends up being really close to the origin instead of the player's hand. I believe the replay transform is not differentiating between world and local position properly.
     
  29. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    194
    Thanks again for the quick reply.

    I would love to send the project but can I get in trouble sending assets I bought to troubleshoot?

    As for the animation storage, you lost me here, I am not a programmer. ;)
    Is there a way to acces the animation I recorded with Ultimate play? I was planning to record small animation segments with Ultimate Replay and edit the animations on the timeline afterward to make a short movie.

    Thanks again.
     
  30. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    That would explain the problem if you are not recording the hand position also. In the current release version of Ultimate Replay the ReplayTransform component will only record the local position of an object but we have had some requests to support both local and world positions so we have modified the ReplayTransform component to support both local and world position and you can choose which mode in the inspector. This script is finished but we are waiting on other bug fixes before we release an update but if you want I can send you the source code for the new ReplayTransform component direct so you can try it without waiting for an update.
     
  31. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Yes I understand there may be IP issues. If you are able to recreate the issues in a stripped down project or with assets that you are allowed to distribute then we would like to look into the poblem so that we can fix it.

    As for the animation storage: It is basically stored as a custom format totally independent of Unity's animation system and as such there is no built in way to convert the recorded animation to a Unity animation asset or similar nor is there anyway API's to read the recorded data. It is just not something that Ultimate Replay was designed to do and even if it could be made to work it may not give the best results as the recorded data may be truncated or compressed when serialized to get the best storage and playback performance.
     
  32. jafioti

    jafioti

    Joined:
    May 28, 2015
    Posts:
    8
    Yes can you please send me the new script.
    Thanks
     
  33. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Yes, I have attached it in a pm.
     
  34. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    194
    @scottyboy805 Thanks for your support. I think "Ultimate Replay" is a great asset backed with great support. It may not be what I need for this project now but I will definitely buy it in a near future anyway. :)
     
  35. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    No problem. Yes it sounds like Ultimate Replay may not be ideal for your current project but maybe it will be useful to you in the future.
     
  36. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Ultimate Replay version 1.1.7 has been submitted for review and should be available for download within a day or two. This version includes:

    • The ReplayTransform component can now record either local or world position which you can set via the inspector.
    • Fixed a script serialization bug where Unity would fail to serialize certain enum values.
    • Fixed a bug where some prefabs could have a ReplayIdentity assigned at edit time causing any instances of that prefab to share the same id.
     
  37. Zhangjianing

    Zhangjianing

    Joined:
    Dec 11, 2017
    Posts:
    2
    hey guy:

    I've had a problem with UItimeate replay. When I switched scenarios,

    ThreadStateException: The stream thread was aborted unexpectedly. Waiting was canceled to avoid infinite waiting but this may cause the state of the file streamer to be corrupted
    UltimateReplay.Storage.ReplayFileTarget.WaitForSingleTask (UltimateReplay.Storage.ReplayFileTaskID taskID) (at Assets/Thirdpart/UltimateReplay/Scripts/Storage/ReplayFileTarget.cs:1142)
    UltimateReplay.Storage.ReplayFileTarget.RestoreSnapshot (System.Single offset) (at Assets/Thirdpart/UltimateReplay/Scripts/Storage/ReplayFileTarget.cs:559)
    UltimateReplay.Core.ReplaySequencer.UpdatePlayback (UltimateReplay.Storage.ReplaySnapshot& frame, UltimateReplay.PlaybackEndBehaviour endBehaviour, System.Boolean fixedTime) (at Assets/Thirdpart/UltimateReplay/Scripts/Core/ReplaySequencer.cs:225)
    UltimateReplay.ReplayManager.UpdateState (System.Boolean fixedTime) (at Assets/Thirdpart/UltimateReplay/Scripts/ReplayManager.cs:527)
    UltimateReplay.ReplayManager.Update () (at Assets/Thirdpart/UltimateReplay/Scripts/ReplayManager.cs:485)
    my email 915813085@qq.com
     
  38. Zhangjianing

    Zhangjianing

    Joined:
    Dec 11, 2017
    Posts:
    2
    question screenshot ,Thanks !
     

    Attached Files:

  39. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi,
    Is your Replay Manager game object marked as DontDestroyOnLoad? It looks like the ReplayFileTarget is being destroyed and the replay manager is trying to update the scene which requires accessing the destroyed target. If you change the exectuion order of the ReplayFileTarget component so that it runs after other scripts do you still get the error? Would you be able to provide steps on how to reproduce this in a clean project or alternativley if you are able to you can send us the project at info(at)trivialinteractive.co.uk and we can take a look.
     
  40. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    29
    Hi,

    Is it possible to start recording, after few seconds, pause the game, playback the recorded gameplay, unpause the game and continue recording from the last point where the game was paused?

    I’m tried to do this using the following commands:

    Code (CSharp):
    1. ReplayManager.BeginRecording(); // When the level start
    2. ReplayManager.PauseRecording(); // When the player pauses the game
    3. ReplayManager.BeginPlayback(); // When the player chose to replay the last seconds
    4. ReplayManager.StopPlayback(); // When the player closes the replay and return to the pause screen
    5. ReplayManager.ResumeRecording(); // When the player unpause the game
    But this is not working, I always see just the first segment that was recorded when goes to replay.

    Something else I can't make work is the reverse playback feature, I’m using a similar code like this:

    Code (CSharp):
    1. reverseToggle.onValueChanged.AddListener(isOn =>
    2. {
    3.     ReplayManager.PausePlayback();
    4.  
    5.     float absTimeScale = Mathf.Abs(ReplayTime.TimeScale);
    6.  
    7.     ReplayTime.TimeScale = isOn ? -1f * absTimeScale : absTimeScale;
    8. });
    But when I set reverse playback and resume the replay, it play in forward direction without interpolation. Is something wrong or I'm missing?
     
  41. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708

    Hi,
    The sequence you described should work fine. Are you using a replay memory target for your testing? If you are then make sure that the recorded data is not being overwritten due to the usage of rolling buffers as this could be causing you some problems. You can disable this feature by setting the value of 'Record Seconds' on the 'ReplayMemoryTarget' component to 0 which will disable rolling buffer recording.

    To get reverse playback working you need to set the value of 'ReplayTime.timeScale' to a negative value as you have done and then call 'BeginPlayback' to have the changes take effect. If you want to replay in reverse to from the current position you can pass 'false' to 'BeginPlayback' to continue from the curretn playback offset.
     
  42. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    29
    Hi,

    Thanks for answering.

    I am using ReplayMemoryTarget, as in the cube demo.

    I don't know if I was very clear on what I want to do, for example, I play 5 seconds of the game and pause it. This is the first segment. While the game is paused I can see the replay of this first segment. Then I unpause the game and play another 5 seconds and pause again. This is the second segment. When watching the replay I should see both segments in sequence, totaling 10 seconds of replay. But in practice I only see the first segment.

    This happens even if the "Records Seconds" is 0.

    About the reverse playback, I was using the FixedUpdate method, changed it to Update and now works normal.
     
  43. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi again,
    Thanks for the info.

    Yes I was able to understand what you meant but was just suggfesting a few things to try as the way you have it setup should work just fine. I will have to look into this further if you are still having issues to find out what the problem could be. I will not be able to look at this until monday though but in the meantime you can send us your project to info(at)trivialinteractive.co.uk if you are willing and able to so we can look into the issue otherwise we will attempt to recreate the issue in an empty project.

    Glad to hear you fixed the reverse playback issue.
     
  44. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi again,
    Sorry for the delay.
    We can confirm that this behaviour is not currently supported due to the state based nature of the ReplayManager (It can only be in playback or recoridng states currently) but we are currently working to fix this as we agree that this behaviour should work as expected.
     
  45. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Ultimate Replay version 1.1.8 has been submitted to the asset store. This version adds support for replaying the captured content while recording is paused. This means that you can resume recording once the replay has finished to record additional content which will be merged into the same replay..
     
  46. flomaaa

    flomaaa

    Joined:
    Apr 12, 2019
    Posts:
    3
    Hi @scottyboy805,

    great job first of all!

    1) I was wondering if the Record and Playback GUI is just available in the premium version? I tried out the Demo but actually couldn't figure out how to get the GUI and record/playback the scene. Did I miss something here?

    2) Is it possible to save those recordings and replay them at a later point in combination with "fly around"? It seems to be that it's saved in a .replay file but how do I use these file to replay it - independently on the current scene/runtime? :)
     
    Last edited: Oct 9, 2019
  47. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi,
    Thanks for the kind words.
    1. Do you mean the replay controls overlay? Yes this is available in the trial version. You should be able to add it to your scene by selection a game object and then adding the component called 'Scripts -> UltimateReplay -> Replay Controls'. It should also be added in all demo scenes to a game object called 'ReplayControls' which is a child game object of 'ReplayCommon'.
    2. Yes you can save replays in memory or to file whichever is better for your needs. File streaming works just like memory recording in that it is all automated behind the 'BeginPlayback' calls. When a ReplayFileComponent is attached to the same game object as the ReplayManager, a file will be created to hold the recording. Then when you switch to playback mode the file will automatically be streamed. All playback should be carried out in the same scene that it was recorded in and is rendered at realtime so you are free to fly the camera around and even change cameras if needed. The replay system is completley camera agnostic.
    Let me know if you have any more questions.
     
  48. flomaaa

    flomaaa

    Joined:
    Apr 12, 2019
    Posts:
    3
    Hi @scottyboy805,

    1) Yes, exactly. Looks like I found the problem. I had to rescale the Game and Scene view to actually see the GUI. Looks like a bug? Anyway, it works now.

    2) That works now, thanks a lot! What are the additional features of the paid version?

    Best regards,
     
    Last edited: Oct 10, 2019
  49. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    Hi again,
    1. You should not have to resize anything to get the GUI working as it is implemented with the legacy ImGUI and should resize automatically.
    2. In order to replay a file and fly the camera around there are a couple of thiings you will need to do as there is no fully automatic way. First you will need to load the correct scene that the file was recorded from. Next you will need to specify the file you want to load which can be done from the inspector window of the ReplayFileTarget component or via script. Then you can call 'ReplayManager.BeginPlayback' and the replay should be played back and rendered at realtime.
     
  50. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    708
    The trial version has all of the features of the paid version. The only difference is that the paid version includes full source code and the trial version cannot be built as part of a standalone game. Its only intended to try before you buy to see if Ultimate Replay suits your project requirements.
     
unityunity