Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  3. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    408
    Hi @All!

    We are very glad to be able to present the "EZ Replay Manager". It allows you te record your game from any given moment on and replay it.. why not replay your game scene backwards or with higher speed? There is an in-game GUI included which can be switched on and off. Integration with any game project has been held very easy, a very detailed explanation was given in the readme.txt, included in the package.

    It has been added to the Asset Store here: https://www.assetstore.unity3d.com/#/content/690 . It took 3 weeks of all-day extensive coding, testing, coding and testing again to eliminate all the glitches and potential bugs. We think we succeded! Indeed, very much work has been put to make it compatible with all your individual projects!

    Please look at the demo projects on our website and tell us what you think! Thx :)

    Try before you buy? We now have a free demo up the asset store: https://www.assetstore.unity3d.com/#/content/3584.

    In the free feature limited demo the source code is protected in a DLL. By purchasing the package from the Unity Asset Store you get the whole unprotected code of course. It is entirely written in C#.
     
    Last edited: Dec 22, 2012
  2. dgutierrezpalma

    dgutierrezpalma

    Joined:
    Dec 22, 2009
    Posts:
    402
    Hi, I started a thread a few days ago to ask some questions about this extension:

     
  3. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    This thread is now open for questions and support concerning the EZ Replay Manager.
     
  4. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    We discussed this and will probably release a feature limited demo version in the next 2 days. Utilizing it you will be able to test if the extension works with your application. It will be given in form of a DLL with limited functionality (no speed/timeline corrections/only 300 frames per recording). You will be able to adjust the update interval by changing it on the EZ Replay Manager-Prefab (on Unity GUI) that comes with the demo and the full package.
     
  5. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Try before you buy? We now have a free demo up the asset store: http://u3d.as/content/soft-rare/ez-r...-free-demo/30Z.

    In the free feature limited demo the source code is protected in a DLL. By purchasing the package from the Unity Asset Store you get the whole unprotected code of course. It is entirely written in C#.

    There are some limitations included in this demo package (pls see one post earlier for details) but it is sufficient to test if your application will work with the full package.The provided readme.txt is the actual documentation file which is also included in the full package. Have fun and pls tell us how it went :)
     
    Last edited: Jun 7, 2012
  6. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Thank you so much. I will try it ASAP :)
     
  7. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Ok, I tried it and it didn't work out of the box for me. It isn't compatible with SpriteManager2. I think cloning a script and destroy the replay object ended up destroy the mesh, so the original one mesh reference is missing. I haven't worked with the API directly yet but it seems that learning it would take some time so I won't be doing that anytime soon.

    I think the whole problem is the approach that this plug-in take, which is different from what I want. The plug-in use a create-a-clone-and-deactivate-the-original approach. This can be problematic with a game I'm working on, which use object pool design pattern and that involves lots of instance activation/deactivation.

    What I want is something that write to a file or some data structure, then when I replay the game, I can choose to read in data from the saved data structure instead. Maybe this is not possible with the current EZ Replay Manager right now?

    Anyway, thank you so much for releasing the demo! I'll try the programming + API approach when I have more time :)
     
  8. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Our purchases were increased since the demo was released and so I have to say thank you for giving us this idea of a downloadable demo! :)

    Very sorry to hear that with your individual project it's not working. Actually the real object is never touched, so it's totally safe. We took the approach of cloning the original object, deactivating it and deleting scripts on the clone so that it's physics doesn't intervene when in replay mode. We circumvented a lot of problems that way. We didn't test with the SpriteManager2 indeed, but I still didn't understand your issue 100%. Instance activation/deactivation was being tested and worked stabile.

    If you want you could send us a video or screencap of what goes wrong when using the EZ Replay Manager that could maybe help us to improve it for your kind of projects in the future. Well, thank you for your involvement anyway! :)
     
    Last edited: Jun 24, 2011
  9. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    BTW - The GUI can be completely switched off by a simple GUI switch, so that it is in the control of the programmer (you) to call the record and replay functions - all is described in the readme.txt (coming with the package) in detail to really make it EZ ;)
     
    Last edited: Jul 14, 2011
  10. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Version 2.5 of the Readme-textfile was just released. It's a PDF, formatted text so that you can read it more easily. Find it here. It demonstrate how easy it is to integrate EZ Replay Manager in your own projects.
     
    Last edited: Sep 7, 2011
  11. Gregg-Patton

    Gregg-Patton

    Joined:
    Aug 31, 2009
    Posts:
    26
    Is it possible to save and load recorded games?
     
  12. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Hi!

    No, until now the EZ Replay Manager works more like the Kill Cam from Call Of Duty :)
     
  13. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Hi! Just want to keep you guys updated on the new development: I found a possible way to save replays to hard disk and load them again. At this moment I cannot say when it will be finished and up in the asset store, but I will, as earlier mentioned, make the package more expensive when the update is ready. Come and get it now for 60$ and you'll be getting the update for free later.
     
  14. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Hello , i have a project wherein i m drawing a line following the mousePosition. to be more specific , the points are stored in a array and then it is given to the line renderer. But in replay mode i m not able to see the line. Kindly suggest me with the solution ASAP.,.,.,!!!!
     
  15. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Hi! Thank you for purchasing. Did you mark the object which is holding the array of points to be recorded? And more importantly, did you adjust SavedStates.cs so that it actually safes the object which is holding the array of points for every frame? If you answer at least one of these questions with "no" it will not work as you intended.

    Please let me know what your current configuration is. At the moment you have to mark objects to be recorded (mark4Recording(object)) and you have to specificy WHAT should be recorded. This is done for performance reasons. Defaultly only the position and rotation and if it emits particles is being saved, but as documented here, it is easily extensible. If you did all these things please report back. Thanks!
     
  16. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Thanks for the reply. i have a simple script which draws the line using line renderer and is attached to a gameobject and also the gameobject is attached with object to record.cs file. So when i replay only the gameobject is being recorded and not the line renderer. i tried manipulating with object to propertiesmapping and saved state but didn work out. Hierarchy does contain only gameobject and the main camera and the EZReplayManager Prefab. Kindly revert me back with a solution ASAP.
     
  17. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Can you make this line renderer script available to me? It seems to me, giving you advice blindly is not going to leed to a solution very soon :D You only have to manipulate (maybe even extend only) from SavedState.cs. The other classes need not to be touched.
     
  18. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Here is the script for the line trace , which wil be attached to the empty GameObject. that gameObject is also attached with Object2Record.cs file.
     

    Attached Files:

  19. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Hello , any solution ???? please revert me back on this ASAP,.,., Just waiting for your reply,.,
     
    Last edited: Feb 13, 2012
  20. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    I didn't forget you, but did not have time yet to look into your file, busy with many projects at the same time, as usual. I will report back to you within the next 24 to 48 hours. Hope this will be soon enough for you.
     
  21. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Ok...!!!!! will be waiting for your valuable reply..!!!
     
  22. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Well, it should actually be easy as pie. But I cannot read the positions from the LineRenderer array :( LineRenderer only publicly makes available a function named "SetPosition", where is "GetPosition" or direct access to the "positions"-array? Very strange. If I execute your script there is clearly a positions-array which can be read and manipulated (manually via the object hierarchy).

    Am I missing something important here? It seems unlogical to me, why the LineRenderer-positions would be able to get and set manually, but via code only to set. Well without the ability to read from the positions, logically it is impossible to save those :( Also I cannot inherit from LineRenderer (to make the positions available through a child class): `LineRendererPositionsExposer': cannot derive from sealed type `UnityEngine.LineRenderer'.

    Maybe you have more experience with this Component and know a trick? Otherwise I will compose a question on Unity Answers for this. Hopefully someone has an idea.
     
  23. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Thanks for the reply :) . But now what is the solution for my problem??? Should i post a question on forum and wait for the reply??? I have tried all the possible ways and i m out of solution. Does vectrocisty solve the problem?? please suggest me a solution because i have a deadline for the project and i m pinning my hopes completly on you people... :-(
     
  24. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    What is vectrocisty?

    I will compose a question on Unity Answers forum. That's all I can think of now. If the LineRenderer does not expose the positions of its points to the programmer then how can one ever save them? I will compose the question today and report back.
     
  25. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
  26. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    247
    BTW, one thing...

    In your docs you advise the user to adjust the size of an array in the inspector and then drag objects over. But there's a little-known feature of the unity inspector that makes this unnecessary: Just drag stuff to the array itself (right above the Size field) and it'll add the object to the list/array... no setting the size manually required.
     
  27. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
  28. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    247
    You can't access them. You can keep them in your own parallel array of Vector3s, however. Kind of ... dumb, but works.

    Or use a more advanced line renderer like Vectrocity. Wiring that up with EZ Replay Manager should be possible.
     
  29. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Indeed, just found that out a few days ago, too. This information will come with the docs in the next update (in the making). Thanks again for reminding, I would've probably forgot ;)

    Thank you, that would indeed be possible, did not think of that. Thanks! Now I can build in this functionality for Sudarsh21 ;)
     
  30. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    247
    I really didn't expect this to work in my game... usually 3rd party tools tend to have issues with anything but trivial examples. But, low and behold, it did. So I bought a copy.

    Two things....

    First, the primary use of something like this is the sorta Kill Cam you get for the last few seconds of gameplay like in CoD. Which, so happens, is the sort of thing I'm after. Perfect. Unfortunatley, it seems that the design is to record the entire sequence from when you say go. In my case I cannot predict when the game play will end and it's time to play back the "last moments" before disaster. So I would techncially have to record right from the start.

    This is impractical, of course. The amount of memory burned would be prohibitive. What I really want is for it to keep only the last X seconds of recording as it works.

    I figure that could be simply done with a quick mod of the code. But then as I looked at the code, I saw that you were storing each frame in a dictionary indexed by monotonically ascending frame counter. Wait what? A dictionary? That didn't seem right. Seems like the least efficient container to use for that and not sure what value you get out of using it vs. a list. And it'd be trivial to then switch to a Queue structure would make it trivial to implement the "record the last X number of frames", where X is easily derived from the recording frequency and the limit the coder would specify.

    Speaking of efficiency, I did notice quite a bit that seemed unoptimized. Which sorta worries me. I've not measured yet, so I don't want to pull the alarm bell... but I'd be really concerned by some very slow things going on there per-frame per-recorded-gameobject. I see some exception handling in there too which also worries me as its has potential for being surprisingly slow (though it depends on a lot of things). A lot of direct GetComponent<> and indirect GetComponent() calls. Whenever you say someObject.transform it's actually doing a GetComponent<Transfrom>() under the hood. Those are not cached values.

    Anyway, I'm going to do some measurements, but just eyeballing the code... a bit concerning.

    David
     
  31. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    The positions you will store in an seperate array i agree, but what about the line draw feature?? Waiting for the solution.,, :)
     
  32. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    So with the hint on how to save the positions I solved it ;) See the attached files.

    I actually had to convert your js script to cs. Hope that is ok. A few simple steps are to be taken:

    1. Add the files to your project hierarchy
    2. Just make another empty game object and add "game.cs" to it. (that way testing is easy because it records again, and is controlable with some simple buttons, you can remove this afterwards, of course).
    3. Add Object2Record to your empty game object which includes the LineErase-Script (as you did earlier)
    4. In Object2PropertiesMapping replace alle instances of "SavedState" with "LineRendererState".

    Your are done! :)

    Indeed I said Object2PropertiesMapping does not have to be changed but I also wanted to demonstrate how SavedState can be extended from, because this is not documented yet, will do for the next version. Maybe then I will make Object2PropertiesMapping generic so that it need not be hacked for assignments like this.

    I know my solution is maybe not the most efficient one, but I wanted to demonstrate the flexibility of the package and that your LineRenderer script can be easily integrated :) Please ask if you have any more questions.
     

    Attached Files:

  33. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Thank you very much for your purchase!

    Indeed this can easily be done, once one purchased the full source code. The frames are located in a dictionary as you said. Removing everything but the last 100 frames (at a saving rate of 0.05 = 20frames/second) would only leave the last 5 seconds. Surely more efficient ways can be thought of, too. I.e. You could write some kind of intelligent script which detects when the game is about to end and records from that point forward. If it does end, you have your replay. If it didn't you hit EZReplayManager.stop(), clear "gOs2propMappings" (thus clear the memory, implicating that the garbage collector clears all frames) and keep looking for your game to end. Of course it depends on your game style whether this can be done this way. In Call of Duty i.e. you could hit record, when someone gets near someone else, assuming one of them could be dead soon... ^^ Just as an example. As said the package is very flexible. To do what you want could be accomplished in various ways I guess.

    The dictionary also has its uses. This way I can begin saving the positions of various gameObjects dynamically, when the game itsself long started. So gameObject A can be saved beginning from frame 0, but gameObject B is saved at frame 114, disabled at frame 542 and reenabled at frame 800 again, as an example. The frame number is saved in the key of the dictionary... I am admittedly not an expert at C# collections so there might just be a more efficient solution. If so, I am eager to hear it and maybe integrate it for the next version.

    Thank you for pointing that out. I will have a look also and based on your feedback have deeper knowlegde of the engine. Hopefully we can make the package speed up even more than it is now. On the other hand I have yet to see a (practical) application where performance of the package is really breaking the game play/replay, (but of course never say never :p) .
     
    Last edited: Feb 16, 2012
  34. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    247
    Speed is a concern mostly on mobile devices. Probably won't be an issue on desktop. But those damn phones.....


    I see why you used a dictionary... but what you were really aiming for was a Sparse Array perhaps. There is no such container built-in, but you can build one (or get one off the intertubes).

    In either case, I think a queue would be more ideal for recording. In a game where death could happen unpredictably (step to the left.. pow!) I'd need the recorder always on and just throwing away old data.

    Surgery might be tough since you rely on a sparse-array like behavior. Hmmm.
     
  35. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Thank You...!!! Now its working perfectly fine..!!! i missed out few important things while extending SavesState.cs, but nevertheless you solved it...!!!! now will soon implement in my real project and try to contact you back if any problem persists..!! :) Thank you for your Time :)
     
  36. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    868
    Does the package record all properties automatically. i mean things other than AnimationState, Transform and Rigidbody.
    for example, playing a sound or animation events and maybe particle properties.
     
  37. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19

    Now that i have integrated the LineRendererScript into my project, the line trace is being recorded :) . But i get an error from the EZReplayManger saying "You already inserted at position XX for game object XYZ(UnityEngine.GameObject)'" . In My Project the Line Trace Sript is dynamically attached to the GameObect and that GameObject is marked sor recording. Now For That gameObject Dynamically there are 7 more GameObjects being attached dynamically(Using Instatniate) . Now when i start recording i get that error from EZManager. I have created a seperate Dictionary for LineRendererState in ObjectToPropertiesMapping. I kno i m Overloading somewhere, Any Idea???? Please Suggest me....!!! :)
     
  38. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    No it does not record everything automatically.. this would create immense overhead, and is also not very easy to do :) but it is fairly easy to extend. In the first post of this thread I uploaded 2 free demo files, so you can check whether the package works with your project out of the box. If not, integration should just be but a few scripting steps ahead :) Which steps these are, I have written in the documentation, (see here: http://www.softrare.eu/user_files/unity/Readme.pdf ). Until now, every project/script I faced, could be recorded and played back using the EZ Replay Manager.
     
    Last edited: Feb 17, 2012
  39. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Is everything being recorded as it should (so you are not missing a trace or something) ? If you delete (or don't instantiate) these 7 gameObjects is the message still shown or not? This message will be shown if you try to insert frame (i.e.) 3 for gameObject A although gameObject A already has a SavedState listed at frame 3. So be sure to check that you don't record anything double, like i.e. you marked a gameobject for recording twice (i.e. one by Object2Record-script and the same by listing it in the gameObject2record-list in the EZ Replay Manager-prefab). Anyway I think the error should be easily prevented from occuring. Please check everything and feel free to report back to me :)
     
    Last edited: Feb 17, 2012
  40. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Ok i have cheked everything and i have only listed a empty gameobject to be recorded for which all the line trace scripts and the gameobjects get attached. Now my doubt is, as per your way of extending Saved State , i have included one more class for LineRenderer state which you have given which is extended by base class SavedState. Do i need to have one more dictionary for LineRenderer state in ObjPropertiesMapping??? or do i need to use the same dictionary which you have given. Because in your solution to line trace you had mentioned to replace all the "SavedState" with "LineRendererState". The problem here is think the gameobject is getting recorded at the same "recorderPosition" in the dictionary. Kindly help me with this one.... !!!
     
  41. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Not very easy to follow. As said, as long as everything is recorded correctly, you can temporarily switch off the warning messages (showHints and showErrors to false). Would you care to send me the scene in the meantime? I will have a look into it and send it back to you corrected as soon as possible. If its a small thing which jumps right into my eyes I will report back today or tomorrow. If it is more difficult, please wait till monday, there is so much to do at the moment, I am litteraly drowning in work ....... :)
     
  42. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Putting those two to false will work as far as the line trace is concerned , but other things in my project are not being recorded. The material color change for a gameobject is not being considered for recording , should i have to again extend the saved state ?? add one more dictionary in object2propertiesmapping??????? :)
     
  43. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Sorry for my late response. Please if you wish me to be able to identify and eliminate the root cause of the problem (with which the error messages occur) send me the whole scene (with all related objects). From remote it is very difficult if not impossible to repair.

    To have the material color saved you indeed have to extend SavedState again but just write your extension code in LineRendererState.cs (no need to replace it again in object2propertiesmapping). Save the material color in the constructor: this.materialColor = go.material.color (If I am not mistaken) and reload it in the preparation-function: go.material.color = this.materialColor (giving you have declared this variable in the class header). This would be all ;) Please let me know if I can help you any further.
     
  44. aniket.ghode

    aniket.ghode

    Joined:
    Nov 15, 2011
    Posts:
    2
    Hey,

    Just tried out the Demo version of EzReplay plugin with our game. It works great. But we are looking for a feature to record the replays and transfer it over bluetooth or Wifi, as you said in this post that you are able to store the replays on hard drive. Do you think we can achieve the feature of transferring replay data with the latest update?

    Thanks,
    Aniket
     
  45. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Well yes, but keep in mind that on the target machine, all the objects which were recorded have to be present as prefabs. So if you are using the same scene for recording and replaying you should be fine :) I cannot say at this moment when the update will arrive, but you can expect it I would estimate before summer.. don't nail us down on this but we are doing our best :)
     
  46. aniket.ghode

    aniket.ghode

    Joined:
    Nov 15, 2011
    Posts:
    2
    That sounds great. We are using exactly same scene on all target devices, I wonder what kinda data I will get which I can send it over.

    Thanks for quick response.

    Aniket
     
  47. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    Hello,,, I think you have got my message, and i am badly waiting a reply for that :) :)
     
  48. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    Sorry, I don't understand, in my understanding I gave a response to all your questions. What is it you are waiting for exactly?
     
  49. Sudarsh21

    Sudarsh21

    Joined:
    Feb 9, 2012
    Posts:
    19
    You asked me to send my scene..!!!!! So i am waiting for your reply to my message so that i can send my dummy scene to you..!!!! I am nearing my completion of project , only thing remaining is Replay..!!! Please Please help me out..!!! It wud be of great help..!!! Waitiing for your reply :) :)
     
  50. softrare

    softrare

    Joined:
    Jun 12, 2011
    Posts:
    408
    I am very sorry, I did not receive a message :( If you'd like to know the email address to send the scene to, please have a look at the contact section of our homepage :) http://www.softrare.eu. You can expect an answer within the next 36 hours. Hope this is soon enough for you.