Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. 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

[Released] Ultimate Replay 2.0 - Next generation state-based replay system

Discussion in 'Assets and Asset Store' started by scottyboy805, Sep 8, 2020.

  1. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Ultimate Replay 2.0 - Next generation state-based replay system


    Available now on the Asset Store!

    Support | Discord | Documentation | Asset Store | Trial Version | WIP
    Ultimate Replay 2.0 is the next generation in complete stated based replay systems and is designed to make adding replays to your game as quick and simple as possible. Setting up a replay is as simple as adding the appropriate replay components to objects that you wish to replay.

    Cover.png

    The asset works by recording 'snapshots' of the scene at regular intervals. These snapshots can then be used to reconstruct the scene during playback to produce smooth and accurate replays. Due to the state based nature of the asset, it is possible to view replays from any angle or even fly around the scene as playback occurs.

    Ultimate Replay 2.0 is desgined to be versatile and easy to use and can be used to create kill-cams/death-cams, action replays, ghost vehicles and much more. Included demo scenes will show how some of these replay techniques can be implemented.

    Features
    • Quick and easy setup / integration into existing projects.
    • Simple API for replay and playback control means that very little scripting knowledge is required.
    • Record and replay as many different objects as you want simultaneously.
    • Uses a state-based replay system meaning that you can view playback from different camera
    angles or even fly around as playback occurs.
    • Full support for instantiation or destruction of objects during recording.
    • Fully interpolated playback means that you can record at ultra-low frame rates (5fps and less) and retain smooth and accurate replays.
    • Supports playback at any speed from ultra-slow motion to 2 or 4x.
    • Supports reverse playback which can be used to produce a rewind effect.
    • Playback can be paused and resumed at a later date.
    • Full playback seek support allows you to jump to any point in a recording.
    • Full control over recording frame rate to make sure you capture the best quality recording at
    the smallest memory cost.
    • Recording an object is as simple as attaching a replay component.
    • Built-in support for recording transform, audio, particles, animation, and more.
    • Easily create your own component recorders to expand the capabilities.
    • Memory recording can be setup as continuous or as a rolling buffer configuration.
    • File support means that you can create persistent replays for later game sessions.
    • Highly optimized file format allows for lengthy replays with minimal file size and high performance streaming.
    • ReplayVars allow script variables to be recorded simply by adding an attribute.
    • Get useful hints about the storage space requirements for all replay objects.
    • Includes example GUI controls for playback manipulation.
    • Comprehensive .chm documentation of the API for quick and easy reference.
    • Fully commented C# source code included.


    Videos





    Examples

    Here are just a few examples of what Ultimate Replay 2.0 can do. All screenshots shown below were captured from actual demo scenes which will be included in the asset.






    Take a look at the WIP thread for more information.​
     
    Last edited: Mar 21, 2021
    FMWFiremage, petey and firstuser like this.
  2. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    176
    Awesome
     
    scottyboy805 likes this.
  3. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,167
    Can you save your replays and load them for later viewing? If not - this would be a must have feature. Also, whilist in live mode if I had a replay of 10 seconds and I wanted to go back to 5 seconds, could I continue gameplay from that point, erasing the other 5 seconds from time?
     
    Last edited: Sep 12, 2020
  4. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    Yes, Ultimate Replay 2.0 has support for recording to file and to a Stream object so persistent replays are possible.
    If you wanted the gameplay to return to a point in the replay then that is also possible. You would have to start playback and seek to the desired point in the replay. You can then call stop playback which accepts a bool value that determines whether the scene is reset to the state prior to recording. Pass a value of false and the replay system will enter live mode with objects in their current replay positions so you can continue with gameplay.

    Let me know if you have any more questions.
     
    julianr likes this.
  5. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,167
    Sounds what I'm ideally looking for. Can you also only restore specific gameobjects to a point in time and freeze them, where everything else moves forwards or backwards?
     
  6. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Yes, this is also possible in version 2.0. You can use the new ReplayScene feature to specify which objects should be part of the replay. The easiest way to do what you want would be to record the same objects twice so that you have 2 replays that are identical. You can then create a replay scene containig objects that should be frozen, start the playback, seek to the desired time and then pause playback so that objects are frozen in place. At the same time you can also be replaying the other objects using the second replay. This could be forward, backward or in slow motion as it will be a completely separate replay operation.
    The reason for the 2 replays is due to a limitation where replay storage devices can only be in use by single replay operation at any given time. If you did not want to have 2 replays then there are other methods to achieve what you need but may be a little more involved.
     
    julianr likes this.
  7. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,167
    Nice! So you add tracking scripts to each of the objects you want to record? So in effect I could add or attach a camera to any of them and view them at a specific angle.

    Do you have an estimated time for launch, or is it already waiting to be approved in the asset store?
     
    Last edited: Sep 12, 2020
  8. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Exactly. You will need to add a replay component to your objects depending upon what you want to record. For example: You would add a ReplayTransform component if you wanted to record position, rotation and scale. The replay system will then add a ReplayObject component at the same time automatically and this is the main component used for tracking. You will add the ReplayObject component to a replay scene for instance in order to include it in a replay.

    You can have a camera as a child object of a recorded object and the camera will follow its motion during playback. You can also record the camera object directly if required. Any camera can be used to view the replay as it is rendered in realtime. Just set the active camera as you would do normally in Unity.

    We don't have a definitive launch time but are hoping to be submitting to the asset store by the end of next week if all goes well.
     
    julianr likes this.
  9. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,167
    One last question. How many objects can be recorded and replayed back? In my game, see the tallest skyscraper (click on thumbnail attached), so if I blew that up and then restored it back to its original state, would there be a limitation. So I can then work on the debris sizes and does it also cover a large number of particle effects?
     

    Attached Files:

  10. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    There is no hard limitation imposed by Ultimate Replay 2.0 so you will only be limited by your target hardware. Each replay component you attach will add a small amount of overhead although nothing too significant. We have tested up to 500 replay objects with no obvious impact on perfomance but it would be wise to test on your intended target hardware to see how far you could actually push it.
    Recording particle systems will have almost identical performance to recording transforms or any other replay component. The overhead stems from the tracking and management of the components.
     
    julianr likes this.
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,167
    Awesome! Looking forward to trying it out. Thanks for your answers.
     
    scottyboy805 likes this.
  12. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    We are pleased to announce that Ultimate Replay 2.0 has now been submitted to the asset store and is currently pending review. Hopefully the review process will be kind to us and not take too long but we will update as soon as the asset is live. If you have any questions in the meantime then please don't hesitate to ask :).

     
  13. unity_WXV3ANwF6luQCw

    unity_WXV3ANwF6luQCw

    Joined:
    May 27, 2019
    Posts:
    1
    Hi! Do Ultimate Replay 2.0 support mobile platforms (iOS & Android)? If yes, how are things going with performance on mobile platforms?
     
  14. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    Yes, Ultimate Replay 2.0 supports mobile platforms although we have not tested performance on them. We have however tested performance on a low end windows tablet and did not notice any perfomance impact at all. We tested this with 500 replay objects but more may be possible.
     
  15. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    We are pleased to announce that Ultimate Replay 2.0 is now live on the asset store. You can purchase the full version here or try it out for free using the trial version here.
     
  16. strox96

    strox96

    Joined:
    Sep 24, 2018
    Posts:
    1
    I am trying to continue gameplay with the object in the current replay position(When i press D). Am i doing it wrong? When i press D the gameobject move the position of the last frame of replay.

    Code (CSharp):
    1. public class replayer : ReplayBehaviour
    2. {
    3.     ReplayScene rep;
    4.     ReplayHandle r;
    5.  
    6.  
    7.     // Update is called once per frame
    8.     void Update()
    9.     {
    10.         if (Input.GetKeyDown(KeyCode.A))
    11.         {
    12.            r= UltimateReplay.ReplayManager.BeginRecording(null, rep, true, false);
    13.         }
    14.         if (Input.GetKeyDown(KeyCode.B))
    15.         {
    16.             UltimateReplay.ReplayManager.StopRecording(ref r);
    17.         }
    18.         if (Input.GetKeyDown(KeyCode.C))
    19.         {
    20.            
    21.            r= UltimateReplay.ReplayManager.BeginPlayback(null,rep,false,null);
    22.  
    23.         }
    24.         if (Input.GetKeyDown(KeyCode.E))
    25.         {
    26.             UltimateReplay.ReplayManager.PausePlayback(r);
    27.         }
    28.         if (Input.GetKeyDown(KeyCode.D))
    29.         {
    30.             UltimateReplay.ReplayManager.StopPlayback(ref r,false);
    31.         }
    32.         if (Input.GetKeyDown(KeyCode.Space))
    33.         {
    34.             this.transform.position += new Vector3(1, 0, 0);
    35.         }
    36.     }
    37. }
    38.  
     
  17. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    That code looks fine to me.
    It looks like there is a missing line of code in the release version of the asset which is related to frame restoring when switching to live mode. It can be easily fixed though via a small source code change:

    1. Open the source file at 'Assets/Ultimate Replay 2.0/Scripts/ReplayManager.cs' and scroll down to line '867' where you should find the following code:

    Code (CSharp):
    1. // Switch to game mode
    2. playbackService.Scene.SetReplaySceneMode(ReplayScene.ReplaySceneMode.Live, playbackService.Target.InitialStateBuffer, handle);
    2. Modify that section to include the new line of code as shown below:

    Code (CSharp):
    1. // Switch to game mode
    2. playbackService.Scene.restorePreviousSceneState = restorePreviousSceneState;
    3. playbackService.Scene.SetReplaySceneMode(ReplayScene.ReplaySceneMode.Live, playbackService.Target.InitialStateBuffer, handle);
    3. Save the changes and allow Unity to recompile scripts and the feature should now work as expected.


    We will be submitting an update shortly to address this issue. Let me know if you have any more issues.
     
    strox96 likes this.
  18. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Ultimate Replay 1.0.1 has been submitted to the asset store. This version includes code changes that were not included in the initial release due to a submission error.
     
    julianr likes this.
  19. plcuist

    plcuist

    Joined:
    Aug 29, 2013
    Posts:
    15
    Hi,
    The standalone build is failing with these two errors:

    Assets\3rd parties\Ultimate Replay 2.0\Scripts\Storage\ReplaySnapshot.cs(8,19): error CS0234: The type or namespace name 'PackageManager' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)

    Assets\3rd parties\Ultimate Replay 2.0\Scripts\ReplayManager.cs(155,13): error CS0234: The type or namespace name 'AssetDatabase' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
     
  20. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    HI,
    Thanks for reporting this issue.
    We were able to reproduce both errors which appear to be caused by old debugging code that should have been removed or modified. An update has been submitted to fix the issue which should hopefully be approved within a day or two.

    If you don't want to wait then the issues can be resolved quite easily with some minor source code changes:

    1. Open the source file at 'Assets/Ultimate Replay 2.0/Scripts/Storage/ReplaySnapshot.cs' and navigate to line '8' where you should see the following code:

    Code (CSharp):
    1. using UnityEditor.PackageManager;
    That line can be safely deleted.

    2. Open the source file at 'Assets/Ultimate Replay 2.0/Scripts/ReplayManager.cs' and navigate to line '154' where you should see the following code:

    Code (CSharp):
    1. // Required to keep the editor reference
    2. UnityEditor.AssetDatabase.Refresh();
    Modify the source code as shown below:

    Code (CSharp):
    1. #if ULTIMATEREPLAY_TRIAL
    2.             // Required to keep the editor reference
    3.             UnityEditor.AssetDatabase.Refresh();
    4. #endif
    3. Save all scripts and allow Unity to recompile and you should now be able to build.

    Alternativley you can send us your invoice number to 'info(at)trivialinteractive.co.uk' and we can send you the update direct.

    Sorry for the inconvenience.
     
  21. draverik

    draverik

    Joined:
    Feb 17, 2019
    Posts:
    19
    Hello,

    Is there any way to record particle system if we create them during the gameplay ?
     
  22. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    I assume you mean that you want to record a particle system that was created using 'AddComponent'? If that is the case then it certainly is possible with a little bit of code:

    Code (CSharp):
    1. using UnityEngine;
    2. using UltimateReplay;
    3. using UltimateReplay.Storage;
    4.  
    5. class Example : MonoBehaviour
    6. {
    7.     public void Start()
    8.     {
    9.         // Add and setup your particle system as required
    10.         ParticleSystem particles = gameObject.AddComponent<ParticleSystem>();
    11.  
    12.         // Add the necessary replay components
    13.         ReplayObject replayObj = gameObject.AddComponent<ReplayObject>();
    14.         ReplayParticleSystem replayParticles = gameObject.AddComponent<ReplayParticleSystem>();
    15.  
    16.         // Assign the particle system to be recorded
    17.         replayParticles.observedParticleSystem = particles;
    18.  
    19.         // The particles can now be recorded and replayed as normal
    20.         ReplayScene scene = new ReplayScene(replayObj);
    21.  
    22.         ReplayHandle recordHandle = ReplayManager.BeginRecording(new ReplayMemoryTarget(), scene);
    23.     }
    24. }
    The same code can be applied to any other replay components such as ReplayAudio etc.

    Let me know if you have any more questions.
     
  23. draverik

    draverik

    Joined:
    Feb 17, 2019
    Posts:
    19
    This is not that we need :(

    Can we record that object (HitGroundPrefab) if we create it that way:

    Code (CSharp):
    1. Destroy(Instantiate(f.HitGroundPrefab, PlayerSystemController.Instance.transform.position + targetPos, f.HitGroundPrefab.transform.rotation), 8);
     
    Last edited: Oct 9, 2020
  24. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Yes of course. You could use the same code as above but replace the 'gameObject' reference with the 'Instantiate' result and that will work just fine.

    Since the object is a prefab though there is a much easier way with no coding required. You can simply select the 'HitGroundPrefab' asset in the project window and then go to 'Tools -> Ultimate Replay 2.0 -> Make Selection Replayable -> Replay particle System' and that will setup the object automatically. This setup menu works for both scene objects and prefabs.
     
  25. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Ultimate Replay 1.0.2 has been submitted to the asset store. This version fixes bugs in the ReplayHumanoidConfigurator window where an IndexOutOfRange exception could be thrown in Unity versions 2019.3 and newer due to a slight Unity API change.
     
  26. draverik

    draverik

    Joined:
    Feb 17, 2019
    Posts:
    19
    Ok it works. The problem appears only when object is on "Destroy on load" its not recording this object. Any solution for it?
     
  27. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    When you call 'ReplayManager.BeginRecording' to start recording, do you pass a ReplayScene object? If you don't then the replay object may not be registered if it is marked as DontDestroyOnLoad as I think Unity places these objects into a different scene? If you don't pass a ReplayScene to 'BeginRecoording', then the default behaviour is to use 'ReplayScene.FromCurrentScene' which may be missing your object.

    It may be worth trying the following code to see if that makes a difference:

    Code (CSharp):
    1. class Example : MonoBehaviour
    2. {
    3.     void Start()
    4.     {
    5.         GameObject hitGroundInstance = Instantiate(hitGroundPrefab);
    6.         DontDestroyOnLoad(hitGroundInstance);
    7.        
    8.        
    9.         ReplayScene scene = ReplayScene.FromCurrentScene();
    10.         scene.AddReplayObject(hitGroundInstance.GetComponent<ReplayObject>());
    11.        
    12.         ReplayManager.BeginRecording(new ReplayMemoryTarget(), scene);
    13.     }
    14. }
     
  28. draverik

    draverik

    Joined:
    Feb 17, 2019
    Posts:
    19
    upload_2020-10-9_14-39-14.png


    upload_2020-10-9_14-39-29.png

    It still dosn't work :(
     
  29. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Ok thanks for trying.
    I assume you are using the same princile for 'BeginPlayback' too? Passing a replay scene is also required to let the replay system know which objects you wish to replay.
    We will do some testing to find out what the issue might be shortly and get back to you.
     
  30. draverik

    draverik

    Joined:
    Feb 17, 2019
    Posts:
    19
    we will try, thanks!
     
  31. AliasPol

    AliasPol

    Joined:
    Jan 26, 2017
    Posts:
    6
    Hi i have a problem with loading saved replay from file.

    Start recording to file and Stop recording:

    StartRecordingAndStop.png


    Save file is created. But when i whant load it and play i have problem.
    Loading Saved Record and Play loaded Record functions: LoadReaplayAndStartPlayback.png




    When function BeginPlayback is called i get this error:
    upload_2020-10-10_10-21-4.png upload_2020-10-10_10-21-26.png

    What is a problem? I tried your example script for loading file and use my path for record and still the same error.
     
  32. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    Thanks for reporting this issue.
    We have found a small bug in the ReplayStreamTarget which is used indirectly by the ReplayFIleTarget and appears to be causing the issue you mention. We have fixed the problem now and will submit an update shortly but feel free to contact us at info(at)trivialinteractive.co.uk if you need the update asap.
     
    julianr likes this.
  33. AliasPol

    AliasPol

    Joined:
    Jan 26, 2017
    Posts:
    6
    Hi I sended one more email. Still have problems, and I need finish this today.


    thanks for any help
     
  34. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    7
    Hello @scottyboy805 , I'm user of original "Ultimate Replay". Huge thanks for the discount for us.

    Wanted to know, in previous version was a problem when sometimes events not triggered on replay. Was it fixed in this version?
     
  35. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    You’re welcome for the discount. We value our existing customers .

    You will be pleased to know that the missed events issue is indeed fixed. Ultimate Replay 2.0 will now simulate any replay frames which are missed so that events, method calls etc. cannot be skipped.
     
    julianr and ArteastUFO like this.
  36. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    7
    Thats great news! Thank you!
     
  37. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    7
    @scottyboy805 Hello again,
    In previous version I have asked about how to make "OnReplayStart" event trigger every time when replay loops. You suggested to make a little change here:
    Code (CSharp):
    1. if (playbackTime >= target.Duration || playbackTime < 0)
    2. {
    3.     playbackTime = (direction == PlaybackDirection.Forward) ? 0 : target.Duration;
    4.                        
    5.     // Broadcast the replay start event
    6.     ReplayBehaviour.Events.CallReplayStartEvents();
    7. }
    It worked fine in previous version. But in new version it dont working anymore, and I couldn't figure out how to do it if this feature added. Can you please help me realise this feature again?
     
  38. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi again,
    It is a little more involved in version 2.0 to add this feature because many things were changed but it is still possible. We will add this feature to the asset in update 1.0.3 which is on the way but here is how you can do it in the meantime:

    1. Open the source file at 'Assets/Ultimate Replay 2.0/Scripts/Core/Services/ReplaySequencer.cs' and add the following event declaration to the 'ReplaySequencer' class:

    Code (CSharp):
    1. public event Action OnPlaybackLooped;
    Note that you will also need to add the following namespace at the top of the file:

    Code (CSharp):
    1. using System;
    2. Scroll down to the code shown below at approximatley line 175-180:

    Code (CSharp):
    1. case PlaybackEndBehaviour.LoopPlayback:
    2.                     {
    3.                         if (playbackTimeStamp >= target.Duration || playbackTimeStamp < 0)
    4.                         {
    5.                             playbackTimeStamp = (direction == ReplayManager.PlaybackDirection.Forward) ? 0 : target.Duration;
    6.                         }
    7.                         break;
    8.                     }
    Modify that code to add a new line as shown below:

    Code (CSharp):
    1. case PlaybackEndBehaviour.LoopPlayback:
    2.                     {
    3.                         if (playbackTimeStamp >= target.Duration || playbackTimeStamp < 0)
    4.                         {
    5.                             playbackTimeStamp = (direction == ReplayManager.PlaybackDirection.Forward) ? 0 : target.Duration;
    6.  
    7.                             // Trigger event
    8.                             OnPlaybackLooped?.Invoke();
    9.                         }
    10.                         break;
    11.                     }
    3. Open the source file at 'Assets/Ultimate Spawner 2.0/Scripts/Core/Services/ReplayPlaybackServiceInstance.cs' and find the private constructor at line 46:

    Code (CSharp):
    1. private ReplayPlaybackServiceInstance() { }
    Modify the constructor to have the following body:

    Code (CSharp):
    1. private ReplayPlaybackServiceInstance()
    2.         {
    3.             sequencer.OnPlaybackLooped += () =>
    4.             {
    5.                 ReplayBehaviour.InvokeReplayStartEvent(scene.ActiveReplayBehaviours);
    6.             };
    7.         }
    4. The 'OnReplayStart' event should now be called everytime playback loops around.
     
  39. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Ultimate Replay 1.0.3 has been submitted to the asset store and should be available for download within a day or two. This update contains a number of important bug fixes:
    • Fixed a bug in the replay identity system where object id's assigned to scene objects could change in some cases. This could cause saved replay files to not work as expected since objects will now have a different, non-relevant replay identity.
    • Fixed a bug in the replay file target where chunks would need to be loaded on demand causing stutters and buffering while loading occurs.
    • Fixed a bug in the replay file target where chunk buffering prediciton would not pre-load enough data for smooth playback.
    • Fixed a bug in the ReplayAudio component where one or more sounds recorded in quick succession would not be replayed correctly. Multiple overlapping sounds would be treated as 1 sound in playback.
    • The 'OnReplayStart' event will now be called when playback automatically loops back to the begining.
    • Fixed a bug in the ReplayEnableState component where enabling a disabled object would not work as expected.
    • Fixed a race condition in the multithreaded streaming logic that could generate random and breaking exceptions preventing the file target from working properly.
     
  40. MyCatEatNoFish

    MyCatEatNoFish

    Joined:
    Oct 20, 2020
    Posts:
    19
    In beta,When I read the file for playback, the object is only set to the target position, but my rotation animation is not playing,My test results were due to different component ids,The Animator component would close on replaying, causing my animation to be unable to be replayed,I hope to fix these problems as soon as possible, because I need to use them recently. Thank you!!
     
  41. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    The replay ID bug was fixed in version 1.0.3 which is now live. If you upgrade you should no longer have issues with duplicate id's. Note that if you have a scene that already has replay components attached then you may need to remove and re-add them in order for this fix to take effect.

    I am not sure what you mean about the Animator component closing. Could you elaborate a little on that?
     
  42. MyCatEatNoFish

    MyCatEatNoFish

    Joined:
    Oct 20, 2020
    Posts:
    19
    The animation controller will disable the replay, which will cause my animation will not be replayed, and will report an error when the replay is over.I tested it, and the next frame after BeginPlayback is executed, starts the animation controller, and the animation is replayed.
     
  43. MyCatEatNoFish

    MyCatEatNoFish

    Joined:
    Oct 20, 2020
    Posts:
    19
    When I tested the playback, I deleted all the objects in the scene and carried out the configuration file. But when I played back, the created objects were always at 00. Why?
     
  44. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi again,
    I am still not sure I understand the problem fully. Do you mean that the Animator component is disabled during playback because in some cases that is the correct behaviour. Could you let me know what the error message says and which steps can be used to reproduce the issue.

    By configuration file I assume you mean a replay file? Are you using the latest update (1.0.3) which was released yesterday as this update will fix an issue where replay identities could change between sessions. This means that if you use a replay file the next time you load the game, all object ids would have changed and the replay system can no longer find and update the target objects.
     
  45. MyCatEatNoFish

    MyCatEatNoFish

    Joined:
    Oct 20, 2020
    Posts:
    19
    You can do this ,Record the Animator and save the file locally,Then play back the Animator after reading the local file.
    When I did the Animator playback, it didn't go as planned.In addition, the Object I created during playback is always at the 0 coordinate and will not move as planned
     
  46. flomaaa

    flomaaa

    Joined:
    Apr 12, 2019
    Posts:
    24
    Hi scottyboy805, thanks a lot for Ultimate Replay 2.0! I was just wondering if you can give some starting points for saving the recordings to a local file and then loading it from the disk at a later point as I can not find how to do this in the manual. Can you maybe outline a small working example of that? That would be amazing.

    Best regards,
    flomaaa
     
  47. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi again,
    Thanks for reporting the problem.
    We have found a bug where the ReplayAnimator component would get disabled during state preparation meaning that it cannot update the skinned mesh driven by Ultimate Replay while in playback mode. There will be a fix for this issue coming in update 1.0.4.

    The 0,0,0 position issue you mention we could not replicate. I assume you have a ReplayTransform component attached to the object as well as a ReplayAnimator component if you intend for its transform movements to be captured? If you do have a ReplayTransform component attached then we will have to gather some more details such as settings.
     
  48. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    Hi,
    Yes no problem. Saving and loading a replay file is actually quite a simple process but requires a little bit of code. In order to create a replay file at a specified path, you can use the following method:

    Code (CSharp):
    1. ReplayStorageTarget target = ReplayFileTarget.CreateReplayFile("ReplayFiles/example.replay");
    2.  
    If you want to load an already existing replay file then you will use the read method:

    Code (CSharp):
    1. ReplayStorageTarget target =
    2. ReplayFileTarget.ReadReplayFile("ReplayFiles/example.replay");
    You can then pass the resulting storage target to either 'ReplayManger.BeginRecording' or 'ReplayManager'BeginPlayback' to use as the target or source storage device.

    Here is a complete example:

    Code (CSharp):
    1. using System.Collections;
    2. using UltimateReplay;
    3. using UltimateReplay.Storage;
    4. using UnityEngine;
    5.  
    6. class Example : MonoBehaviour
    7. {
    8.     IEnumerator Start()
    9.     {
    10.         // Create a replay file at the specified path (File will not be created until 'BeginRecording' is called
    11.         ReplayStorageTarget target = ReplayFileTarget.CreateReplayFile("Example.replay");
    12.      
    13.         // Start recording the scene
    14.         ReplayHandle recordHandle = ReplayManager.BeginRecording(target);
    15.      
    16.         // Allow 5 seconds of recording to be captured
    17.         yield return new WaitForSeconds(5);
    18.      
    19.         // Stop recording
    20.         ReplayManager.StopRecording(ref recordHandle);      
    21.      
    22.         // Load the existing replay file - Note that we could also pass 'target' direct to 'BeginPlayback' in this case and the file target would switch to read mode automatically
    23.         target = ReplayFileTarget.ReadReplayFile("Example.replay");
    24.      
    25.         // Start playback
    26.         ReplayHandle playbackHandle = ReplayManager.BeginPlayback(target);
    27.     }
    28. }
    There is a small section about the ReplayFileTarget storage device in the user guide roughly around the 36 page mark.

    I hope this helps you. Let me know if there is anything else.
     
  49. flomaaa

    flomaaa

    Joined:
    Apr 12, 2019
    Posts:
    24
    That's lovely, thanks a lot for sharing! I assume this requires the paid version?
     
  50. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    934
    No problem.
    All features are included in the trial version (including file streaming) with a few limitations:
    • File recording is limited to a maximum of 5 minutes.
    • Source code is not available in the trial version.
    • The trial version cannot be used to build a standalone player.
    • The ReplayTrail render is not available in the trial version since it uses pre-processor directives to support older Unity versions.
    Apart from that, every feature is the same.
     
    flomaaa likes this.
unityunity