Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. 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

EZ Replay Manager

Discussion in 'Assets and Asset Store' started by softrare, Jun 12, 2011.

  1. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Yes, true, thank you!
     
  2. Pier_1985

    Pier_1985

    Joined:
    Apr 18, 2017
    Posts:
    3
    Dear Softrare,

    First I would like to thank you for the outstanding plugin you have developed!

    I have successfully recorded my players and visualised the replay.
    However, how do I properly clear the objects I have marked for recording?

    I am using these lines of code:
    EZReplayManager.get.gOs2propMappings.Clear();
    EZReplayManager.get.gameObjectsToRecord.Clear();

    After these lines, I am individually marking the new objects with:
    EZReplayManager.get.mark4Recording("Objet to record");

    however this gives a null reference in the Object2PropertiesMapping.cs just before the replay is played:

    "NullReferenceException: Object reference not set to an instance of an object
    Object2PropertiesMapping.synchronizeProperties (Int32 recorderPosition) (at Assets/09_Plugins/EZReplayManager/extension/scripts/classes/Object2PropertiesMapping.cs:382"

    Can you please enlighten me your wisdom??

    Regards,
    Pier
     
  3. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi Pier! Thanks for your message and your kind words!

    Good question. Usually I reset the scene to have it clean, but if you want to do that by yourself that should not be too difficult indeed.

    Try cleaning markedGameObjects (gameObjectsToRecord is only a temp wrapper basically) and gOs2propMappings. That should be it. Does that work?
     
  4. Pier_1985

    Pier_1985

    Joined:
    Apr 18, 2017
    Posts:
    3
    Dear Softrare,

    Thank you for your prompt reply.

    Unfortunately I still get the null reference.
    It looks like when I populate the clones list for the second time (after having cleared those dictionaries), some of the parents' children are not successfully added for recording and I guess this is the reason I get the null reference.

    I am working on a multiplayer game and I need to remove disconnected players from the replay. And unfortunately I cannot reset the scene!

    I am sure there is a solution, but no one knows the source code better than you do!

    Any ideas my friend??

    Cordially,
    Pier
     
  5. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Can you send me a video of what is happening without the scene reset, so I can picture what your situation is?
     
  6. pchui38

    pchui38

    Joined:
    Jan 27, 2013
    Posts:
    2
    Hi Softrare,
    I am Pier's colleague and working with him on the project. Since he will be away till tomorrow so I will try to capture the video to explain to you what happening.

    Many Thanks & Regards,
    Peter
     
  7. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi Peter, Very well. Hope to be able get a better understanding from your capture.
     
  8. pchui38

    pchui38

    Joined:
    Jan 27, 2013
    Posts:
    2
    Hi Softrare,
    Thank you for your prompt reply. I have just captured the video & uploaded to youtube with some descriptions.
    Pls let us know if you have any questions.


    Kind Regards,
    Peter
     
  9. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    So what you are trying to accomplish is to remove the goalkeeper from the replay although he was part of the recorded scene, is that correct?
     
  10. Pier_1985

    Pier_1985

    Joined:
    Apr 18, 2017
    Posts:
    3
    Hi Softrare,

    It's Pier again!
    We are disconnecting one of the players (the one in the blue team).
    Once he disconnected, the red player scored and it triggered successfully the replay.

    However, after the second goal the replay crashed, triggering a null reference.
    Using the Debug. Log() we are printing on the console all the components being cloned and it looks like the children of the parent objects are lost.

    I'm confident we will find together the solution, but at the moment Peter and I are stuck with this!
     
  11. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! I am sorry, I am having a hard time seeing the reason for the exception. Is it possible for you to share the code on Collab?
     
  12. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    Your plugin is great.
    There is a project that needs to be used for the functionality described by your plug-in, and I'd like to ask some questions.
    1.Can you record the zoom of the object in the official version?
    2.Record files can be exported, just like the WAR3 fight replay.
    Very much, I hope you can answer it. Very Very
     
  13. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! Thanks for your message.

    Do you mean scale? Yes, scale is being recorded by default in the paid version.

    You can save recorded files, but keep in mind, not a video file will be exported (as EZR is not a screen recorder) but a file of a format which is custom to EZR.

    Hope this helps!
     
  14. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    Thanks!
    I have a small problem that I hope won't bother you.
    Do I need to change the height and texture of the topography in the game? Can I record the replay?
    Thank you very much!
     
  15. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
     
  16. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Sorry, I do not understand what you mean with "change the height and texture of the topography".

    No, the replay cannot be recorded.
     
  17. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    Here //terrainData.SetHeights( (int)controlPos.x , (int)controlPos.y , newHeightData );
    And...
    In the game, I dynamically changed the height of the terrain,
    I do not know if this is also something you can record, or you have any good advice.
    thank you very much!
    :)
     
  18. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    With ERZ you can record everything, but natively only transform values are recorded. But it is not difficult to extend the system to record what you want, although I recommend having programming experience in order to do this. The documentation states how to extend what to record.
     
    Last edited: Jun 8, 2017
  19. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    I have already purchased a paid version, but there is a problem. After I clicked on the save, did not find the record file ending in EZR. What should I do?
    thank you very much!
     
  20. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    The files by default are saved into the app directory, which, if you are using it from inside the Editor is on the same level as the Assets/ folder itself, so not in between your assets but a level higher.
     
  21. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    I'm a fool. I just found the .EZR file by searching.
    Now I can consider how to save terrain information.
    Thank you for your patience.
    Hope to have the opportunity to communicate later.
     
  22. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    No trouble at all ;) I wish you success!
     
  23. zhao_KK

    zhao_KK

    Joined:
    Jun 7, 2017
    Posts:
    11
    Thank you from China~
     
  24. Chandramohan-Pal

    Chandramohan-Pal

    Joined:
    Sep 27, 2014
    Posts:
    2
    Hi, I am targeting windows store,But, while building I'm getting compile time errors due to ISerialization interface and SerializationInfo class. Need the solution ASAP.
     
  25. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! Thanks for your message and your purchase!

    The Asset Store description states

    "This extension was successfully tested using Unity & Unity Pro as standalone (Windows, MacOSX), in webplayer and on Android and iOS."

    These are the only targets I have been able to test thus far. That's why I explicitly listed them.

    Please refer to these two threads for further information:

    http://answers.unity3d.com/questions/930968/serializable-editor-serialization-on-windows-store.html
    http://answers.unity3d.com/questions/507022/systemruntimeserializationiserializable-doesnt-exi.html

    Hope this helps!
     
  26. djkpA

    djkpA

    Joined:
    Mar 28, 2016
    Posts:
    10
    Hello , I have been using EZ replay Manager and its awesome.

    Currently I am trying to extend the SavedState.cs and it worked when I play the replay directly with play(). But If I save the replay to a stream of bytes and play from file its now working, means the extended data from SavedState.cs is not reflecting in `byte[] m_savedData = saveToStream()` and `loadFromStream(m_savedData)`.

    I am missing something?
    My requirement is I want to store a variable (int) data every frame in the replay recording and save it into a byte[] stream and play replay from the stream?
    Could someone help me out. Thanks
     
  27. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    If it works by hitting play, then I would argue, there shouldn't be any problem with the byte data, because they use the same class for the data: SavedState. Did you write your changes in that class or did you inherit from it?
     
  28. valkyri1971

    valkyri1971

    Joined:
    Sep 15, 2017
    Posts:
    1
    Hello,
    I am trying to save some data as well and I have a few questions as I have not been able to get the data in the variables to replay out.
    I have a few game objects in my scene, one of these game objects writes it's data into this other game object which I called "ReplayVariableTracker". All this object does is contain a script (RecordedValues.cs) that monitors the values of some variables. This script also instantiates an object of a class called ValuesToRecord which is a derived class of SavedState.cs.

    I tried to follow the instructions in the Readme document to code the ValuesToRecord class by trying to hide certain functions in SavedState with my own. Is this how it's supposed to work, or am I supposed to modify the SavedState.cs class directly to track my variables?

    Also, after writing the code, do I have to setup my object (ReplayVariableTracker) to be recorded using EZReplayManager.get.mark4Recording(this.gameObject) or dragging the object into Game Objects To Record in the Editor?

    Will ReplayVariableTracker be cached if I set EZReplayManager to pre cache recorded objects?

    Thank you and regards.
     
  29. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! You have a lot of questions and it's not easy to to know what you mean in each instance. Best if we maybe arrange a TeamViewer session? Would love to help, and sure it's probably easy to fix.

    Contact me here: https://softrare.eu/contact.html
     
  30. jdcart

    jdcart

    Joined:
    Jun 24, 2015
    Posts:
    9
    Hi, we are looking for a solution for recording our multiplayer game state. I downloaded the free version of EZReplay, however, I'm aware that this version hasn't been updated to match the latest paid version-- I'm hoping that all the errors that I'm experiencing are due to this.

    I have a few questions regarding the functionality:

    - I can't record any of the animations on my characters. I know that you can do this with EZReplay-- is there anything special that I have to do apart from marking the prefabs for recording?

    - All my prefabs are instantiated on the awake/start method-- I noticed that the prefabs and all their children get disabled when they are marked for recording and are instantiated, this includes characters and their rigs/skin.

    - I get some errors in the scene when I try to replay-- It's trying to remove the components attached to this prefab e.g.(Animator, NetworkAnimator, NetworkIdentity) is this an expected behavior?

    Please keep in mind that this is a multiplayer scene and we are using UNET to do so.

    Thanks in advance!
     
  31. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! Thanks for your message.

    I will answer your questions below:

    1) To record the animations - or any object with child objects - simply mark only the upper-most parent for recording, all else is being handled automatically.

    2 and 3) EZR creates clones of your gameobjects on replay. This is because it has to delete most of the components on the gameobjects before the replay so that not things as physics scripts interfere with the replay states.

    It is quite possible that some of the behaviour you are seeing is because of the fact that the free version is older than the current, overall the "methodology" is the same, but in the implementation there can be quite some differences. In it's current state the paid package works very well. Buy it, and if you need help with anything, don't hesitate to ask.
     
  32. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    This doesn't work at all for me. I have some GameObjects that have a Canvas attached, and a few other Components as well. It appears to choke when you start deactivating/removing components from the cloned GameObject. You end up getting errors like these:

    Code (CSharp):
    1. Can't remove SpriteRenderer because MapObject (Script) depends on it
    2. UnityEngine.Object:DestroyImmediate(Object)
    3. Object2PropertiesMapping:prepareObjectForReplay()
    4. EZReplayManager:switchModeTo(ViewMode)
    5. EZReplayManager:play(Int32, Boolean, Boolean, Boolean)
    6. EZReplayManager:OnGUI()
    7.  
    Code (CSharp):
    1. Can't remove Canvas because CanvasScaler (Script), GraphicRaycaster (Script) depends on it
    2. UnityEngine.Object:DestroyImmediate(Object)
    3. Object2PropertiesMapping:prepareObjectForReplay()
    4. EZReplayManager:switchModeTo(ViewMode)
    5. EZReplayManager:play(Int32, Boolean, Boolean, Boolean)
    6. EZReplayManager:OnGUI()
    This asset seems really cool, but I'm wary of buying the full version if I'm going to be chasing down Component requirement issues all day :( I'd love to trust the whole "the demo is out of date, just buy the real one and it'll work" rhetoric, but given Unity's view on refunds if an asset doesn't work, this doesn't seem like a particularly safe play unless you can guarantee that this particular issue is fixed.
     
  33. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi!

    Don't worry, these error messages, if they occur are normal and not harmfull. But if indeed you need some of these components to stay in tact during replay mode just add their class-names to the exceptions-list (to be found on the EZReplayManager prefab). Then they will not be removed.
     
  34. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    And as said, even if it doesn't work, I help you, even through TeamViewer.
     
  35. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    Those error messages lead to the replay not functioning at all.
     
  36. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    Ended up pulling the trigger and buying the full version. It does end up working, so I guess whatever the issue was is now resolved.

    I still have a few other problems now that the core piece is working:
    • Is there any way to get it to not destroy my UI components? My 2D game uses the local Canvas in order to display health and other things on characters. Do I need to add all of these individually to the "Don't Remove Component" list? Many of them are child gameobjects, so it's a bit weird that they're getting nuked entirely.
    • I have a similar issue where animation state is lost. Is it the same issue?
     
  37. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! Thanks for your purchase, happy you have gotten results! :)

    Yes, at this point you need to include all components to that list individually. Although what you can also do is, instead writing them in the list in class Objects2PropertiesMapping.cs on ~line 190. These components there are also excluded.

    The issue with the animation state I have not yet encountered, can you give more info about it or send a screenshot/error message?
     
  38. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    I was able to fix it. The Animator itself was being removed. Might want that to stay as a default component for 2D games, since you'll always want to have your sprites animated in a replay.

    I've gotten things working pretty well, but have two more issues:
    • Is there any built-in way to limit the recording length? I essentially want to replay a 5-second or so "death cam" so they player can learn from their mistakes. I can probably jump around in the recording programatically, but that's a huge waste of data/memory. I also don't really want an infinite length replay if the user decides to AFK for a while. I could wrap replay management in a component that runs a coroutine to start/stop the replay recording process at fixed intervals, but this doesn't really give you the ensured 5 second rewind effect, since they could die between stop/starts. I'd rather just keep the last 5 seconds in memory.
    • I get a good deal of FPS loss when running this currently, and the game certainly isn't heavyweight. From what I can tell, there are two major sources of this. The first is when you write to the cache. This only happens the first time a GameObject that's marked for recording appears, but it's still quite heavy. Every time I update my build, I have to manually re-cache everything to make sure I don't get these hitches. The second is harder to track down, but it's the result of really heavy GC.Collect calls in EZReplayManager.updateRecording. I suspect this is due to replays running for too long, but with no way built-in to limit them to the last X seconds, this is bound to happen.
     
  39. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Thank you for your message! Yes, I need to update the components being kept by default.

    About your queries:

    1) This is a much requested features, and I have already experimented with possible solutions. It did not yet work without errors, but I will eventually be able to get there. It's just that at this point I am busy with client projects and also have other assets to take care of. Just as them I will make sure though EZR will advance, and this is probably the direction it is headed.

    2) Yes, pre-caching of new content is essentially without alternative. But I don't quite understand why you do this manually, when it happens automatically just once.

    Hope this helps!
     
  40. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    Hmm, unfortunately without replay time limits this asset isn't particularly useful for me. I don't want players sitting there watching 1-2 minutes of useless content after a death. I dug back through this thread, and it looks like you've been wanting to implement it "soon" for a few years now, so I'm concerned that it's not actually coming. It also makes the asset pretty dangerous to use in a production game, since any scene that plays for more than a few minutes will amass huge replays in memory.
     
  41. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    I have promised it before, that is true, but since then made headway on the issue. Dangerous? The asset never claims to do something it doesn't thus everyone should basically be aware that it works how it works, thus I would hope you would not use this word, as it is plainly untrue.

    If you don't use a too low recording interval (higher recording FPS) this can run in the background for long time without being very intrusive. And because of interpolation functionality you don't sacrifice a lot of visual quality at replay.

    I agree though that it's a feature which is missing which I will add.
     
    Last edited: Oct 20, 2017
  42. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    I'm not saying the missing feature is dangerous, I'm saying the unbound memory usage is. If I leave the game running in the background with an interval of .1 or so, it will start heavily garbage collecting after ~8 minutes. If you're in the editor, GC begins after ~2 minutes, which can make even debugging unpleasant.

    Do you have the source of the changes you tried to implement? I can likely work from those and get it working for me.
     
  43. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Yes, I do, sir. Please write me a mail http://softrare.eu/contact.html and I will send it tomorrow at the latest, because I am not in office anymore. And please remind me if I forget.
     
  44. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    Awesome, thanks!
     
  45. wang317277715

    wang317277715

    Joined:
    Apr 26, 2015
    Posts:
    2
    hi, i got a problem, why i dynamic loading the gameObject, but EZ can not record?
    i hope somone can helpe me
     
  46. Deleted User

    Deleted User

    Guest

    Can this plugin record a specific field from a script attached to a gameobject?
     
  47. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Hi! I am sorry, I have not seen your message up until now, because the forum has not notified me :( Please re-formulate your question, as I did not understand the issue you are having.

    Hi! Yes, this is possible. It is explained in the documentation how to do that.
     
  48. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,030
    Ive been trying this again recently because I really need replay functionality. I just recorded a replay but when I go to play it nothing happens, no errors, nothing. How do I play them and where are they stored?
     
  49. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    437
    Did you try using the free version? It is not up to date anymore, not by a longshot. It is behind in features and bugfixes. Thus I am afraid it does not represent the quality of the actual package at this time.
     
  50. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,030
    No im using paid for version.

    Reloaded unity it was acting funny, it works now, but still problems. First of all I get errors from the body animator in ufps :

    this line: Transform.position = FPController.SmoothPosition + (FPController.SkinWidth * Vector3.down);

    this error:
    NullReferenceException: Object reference not set to an instance of an object
    vp_FPBodyAnimator.UpdatePosition () (at Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_FPBodyAnimator.cs:324)
    vp_BodyAnimator.LateUpdate () (at Assets/UFPS/Base/Scripts/Gameplay/Player/vp_BodyAnimator.cs:333)
    vp_FPBodyAnimator.LateUpdate () (at Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_FPBodyAnimator.cs:171)
    ac_FPParkourBodyAnimator.LateUpdate () (at Assets/acParkour/Scripts/Gameplay/Player/Local/ac_FPParkourBodyAnimator.cs:45)


    lots of errors about 2 audiolisteners and then a clone of myself teleports to my exact location. So I see it successfully clones my main character, but it doesnt play back properly (prob due to animator error), shouldnt it turn off my main characer (the real one) during the replay ?
     
    Last edited: May 18, 2018
unityunity