Search Unity

Chronos – Time Control – Unity Awards Winner

Discussion in 'Assets and Asset Store' started by LazloBonin, Apr 9, 2015.

  1. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Ha! I sure hope I can convince an engineer to give me Serialize() and Deserialize() methods. PM me about the plugin if you have more specific questions.
     
  2. RdArrogantKnight

    RdArrogantKnight

    Joined:
    Jun 24, 2013
    Posts:
    13
    Ah, that is disappointing news. I did my own Replayer (pretty hacky version of it just to suit my purposes, though) class a few weeks ago, but it would have been great to see what you come up with.

    By the way, am I right in thinking that objects don't store a Snapshot at the beginning of their lifespan? I think what I'm seeing sometimes is objects not rewinding to their point of origin, but to the first Snapshot afterwards. It's not really an issue I'm worried about right now, but is my guess correct?
     
  3. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Hm, I'm pretty sure I record a snapshot at Start. If not, I'd consider it a bug. If you can confirm it, I'll fix it.
     
  4. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    By the way, I'm sorry for the delay for v.2.0.6, it's still in the UAS review pipeline, which is out of my control!
    I'll publish v.2.1 hopefully this week, otherwise around the middle of next week.
     
  5. maltadirk

    maltadirk

    Joined:
    Mar 12, 2014
    Posts:
    43
    You're right. I was running Unity 5.0.1. Didn't notice the update was essential. Updated to Unity 5.2.0 and everything is working smoothly :) Thanks
     
  6. maltadirk

    maltadirk

    Joined:
    Mar 12, 2014
    Posts:
    43
    Hey @ludiq
    Being its more efficient to have something loop inside a coroutine, instead in an Update function like the following:

    Code (CSharp):
    1. void Start ()
    2. {
    3.     StartCoroutine(Example());
    4. }
    5.  
    6. IEnumerator Example ()
    7. {
    8.     while (true) // Repeat infinitely
    9.     {
    10.         // DO REPEATED FUNCTIONALITY SUCH AS HAVING AN OBJECT MOVE IN AN INFINITE LOOP
    11.  
    12.         yield return null;
    13.     }
    14. }
    I understand there is the functionality time.WaitForSeconds and its works great for having a repeated action happening on a timely manner, such as spawning. But is there a way I have have Chronos slow down the time on something looping with script, such as moving a platform. I don't need to rewind, simple slowdown or speedup.

    Thanks
     
    Last edited: Sep 14, 2015
  7. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Congratulations for being finalist of Unity awards, I have voted for you on the list, as you surely deserve it for making something really special and unique, and that can change much how a game could be done, and for making theat beautiful and well done intro video

    although I still have not been able to make it work, but is not your fault, it is me that really have not yet what are the essential things to do for making it work

    FOR USING FRACTURING EXPLOSIONS

    As far as I know for making fracturing explosions as shown beautifully on the video, you must attach a clock to each fragment involved in the explosion, SO the object must be already pre-fragmented before the explosion happens with a clock attached on each fragment and controlled by the root clock, so considering this:

    Could be it be possible to use a software that makes a real time and dynamic fracture during ru time instead of pre-fracturing the object? There are already 3 of them in asset store, Exploder, Fracture Pro and Dino Fracture. BUT I think that none of these may work correctly with Chronos because you can not add any clock to any fragment as they are not yet created.

    thanks for your help and I wish that you really become winner in the Unity awards
     
  8. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Ok, let's get this working once and for all for you SpaceRay! ;)

    Let's break this down:

    First stop right here: you don't need a Clock on each fragment, you need a Timeline. I know this concept is sometimes confusing, but they're quite different. A clock is exactly what it says: something that ticks at every frame and has a time. Chronos clocks are different from real world clocks in that they have an adjustable speed, called the (local) time scale. A timeline is different: you can think of it as a watch. It observes a clock, but doesn't tick by itself. The advantage of timelines is that many can observe the same clock (in these cases, they're global clocks, or "shared" clocks, if you want), and they can also be affected by area clocks. For more information about this, have a look at the Structure part of the tutorial: http://ludiq.io/chronos/tutorial#Structure.

    You're right, the timelines need to be attached to each segment before the explosion happens, but timelines can be added via script, not only to in the editor to pre-fractured objects. For example, take the following "pseudo-code": it first fractures the object, then adds a timeline to each fragment, then calls the explosion.

    Code (CSharp):
    1. GameObject objectToExplode = ...;
    2.  
    3. // FracturationLibrary could be something like
    4. // Ultimate Fracturing Destruction, Exploder,
    5. // Fracture Pro or Dino Fracture, etc...
    6. GameObject[] fragments = FracturationLibrary.Fracture(objectToExplode);
    7.  
    8. foreach (GameObject fragment in fragments)
    9. {
    10.     Timeline fragmentTimeline = fragment.AddComponent<Timeline>();
    11.     fragmentTimeline.mode = TimelineMode.Global;
    12.     fragmentTimeline.globalClockKey = "Root"; // Or any global clock you want
    13. }
    14.  
    15. FracturationLibrary.Explode(fragments);
     
    Last edited: Sep 19, 2015
    s1fr and SpaceRay like this.
  9. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Quick update: I'm leaving for Boston tomorrow for Unite 2015, but I'm working really hard tonight to get version 2.1 out in the review pipeline. 2.1 will be the particle system update: support for faster non-rewindable particle systems with none of the current limitations, and support for Stop / IsAlive / enableEmission on rewindable particle systems.

    There are a lot of kinks to work out here, I have to monitor a rewindable and a non-rewindable system to make sure they behave exactly the same way (and that well... isn't easy). Here's a screenshot of my progress. I'll keep you updated!
     
    Tony707 and hopeful like this.
  10. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    Looking forward to the update!

    A couple minor requests for a future version...

    Is it possible to have the Gizmos in its own subfolder? I noticed a number of other assets I have, usually have them in their own folder (i.e. Gizmos\Chronos\Recorder.png). Just to reduce clutter,since Chronos has a number of icons!

    Another would be, is it possible to default the gizmos icons to false in the scene view? I remember that step in the tutorial, going through each one and disabling them. I think it'd be beneficial to disable them by default, then let the user select which they want to display, since all by default can clutter the scene very quickly
     
  11. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Thanks very much for your answer and detailed explained, now understand it, sorry for the confusion and for mixing things

    And also very good and useful that it could be added the timeline by script to assets that use Dynamic fracture

    Enjoy and have a good time in Unity 2015 Boston and come back with the reward!
    You are very lucky and fortunate to be able to go there.

    thanks very much for your help
     
  12. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Oh, sure! If it doesn't break the gizmos that they're not in the root, I'll keep that in mind for v.2.1.

    If it is possible, I don't know how! Please do tell if you know.
     
  13. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    I just arrived at Unite! Anybody here want to meet up at some point?

    PS: I'm sorry, but as you might have noticed, I didn't manage to finish 2.1 in time for Unite. As soon as I come back I'll get on it, though!

     
  14. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    1) I don't think it breaks anything, since the other assets I use display them properly despite being in sub-folders

    2) Actually, I don't know either! I saw in the most recent changelog for MasterAudio that he wrote "Gizmos now default to off for ___ and only show for ___ instead". I'm not sure how the author is doing it, possibly via code though since I didn't notice any .meta changes.
     
  15. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    476
    Just wanted to say congratulations on the Unity Award! I haven't actually got Chronos yet but I can tell its a quality asset!
     
  16. superwendel

    superwendel

    Joined:
    Jun 18, 2013
    Posts:
    105
    Also wanted to poke my head in here and say congratulations on the Unity Award!
     
  17. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Woooot thank you all so much for your support! Chronos won the Unity Award in the Asset Store category :) Here's me awkwardly showing off the awesome cube trophy (and not totally understanding what just happened).



    Now, back to business: I'll resume working on v.2.1 (the particle system update) and hopefully release it very soon (although maybe not today, because I'm exhausted from Boston and everything). I also had the chance to talk with some insightful developers at Unite and I might have an idea to fix and finish the Replay plugin everyone keeps bugging me about ;). If it works, maybe you'll see it released somewhere in the next few months (hopefully weeks!).

    Thanks again for your support (and votes!). I'm kind of disappointed I didn't get to meet any of you at Unite, but I'm sure we'll have other occasions. Cheers!
     
    Fab4, TonyLi, Shizola and 2 others like this.
  18. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi,

    Great asset, I'd like to use it to slow everything down except the player while changing weapons, would this be easy to do?

    Also would the sound effects slow down on everything except the player, as I'd like them to or mute them, would this be easy to do?

    Also would the UI response time slow down as I would not want that ..

    Thanks.
     
  19. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    That is all perfectly possible and easy. Follow the tutorial to get a better idea of how Chronos separates different time scales.

    In your specific case, the player's timeline would watch its own local clock, while everything else would follow a root global clock. You'd set the root clock to something really slow (e.g. 0.1), but leave the player clock and all the UI clocks at 1.

    Timelines work on audio sources automatically too by adjusting the pitch, so they would "just work" in your scenario.
     
  20. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    OK, thanks for the reply .. Looks like you have another customer ..
     
  21. Arx

    Arx

    Joined:
    Jan 28, 2014
    Posts:
    22
    Hey @ludiq I just noticed the following behaviour:
    1. Setup: an object has a Timeline which references a Global Clock, let's say a clock called "Root". Record Transform is False. The object also has Rigidbody2D component attached and is not kinematic.
    2. pause the global clock - set the timescale of Root to 0
    3. move the object - change its transform.position (e.g move it somewhere in the scene)
    4. unpause the global clock - set the timescale of Root to 1
    5. the object immediately moves back to the position it has been in before pause
    Why is this happening? In my case, this is an unwanted behaviour, as I want to pause the game, move the object to another position and then unpause the game.
     
    Last edited: Oct 2, 2015
  22. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    That is normal behaviour if you have "Record Transform" checked: it's needed for proper rewinding. If you moved an object at a point in time, but did not move all of its previous snapshots, it would not look correct. You can disable it if you don't need to rewind.

    If Record Transform is disabled, I'd consider this as a bug. Could you please confirm?
     
  23. Arx

    Arx

    Joined:
    Jan 28, 2014
    Posts:
    22
    Yes, I can confirm the Record Transform is disabled.
     
  24. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    I'll look into it for v.2.1.1.
     
    Arx likes this.
  25. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    v.2.1 has been released!
    The particle system update is here!
    Changelog:
    • Added optional non-rewindable particle systems without limitations
    • Proper support for Stop(), IsAlive() and enableEmission on rewindable particle systems
    • Inspector warnings when for detectable limitations
    • Removed unnecessary using UnityEditor
    • Code style improvements

    Roadmap.
    Inspired by Unity's great new tradition of giving estimates and plans, here's my roadmap for the next few versions:
    • v.2.2: (0~1 month) Inspector-based recorder to rewind any property without any scripting
    • v.2.3: (2~3 months) iCode Integration
    • v.2.4: (3~4 months) Built-in joints support
    This is not a guarantee of any feature or timeframe, but it's my current reasonable estimate of what will be available and when. I'll try to update this if anything changes.


    Price drop!
    Chronos is now just 40$. That's 20% off! Maybe forever, maybe not. This is an experimental pricing that aims at letting more indies get their hands on quality plugins. If the results are as good (or better!) than before, it'll stay like that. Otherwise, the original price of 50$ will come back. Either way, you might want to grab it now: http://u3d.as/bX5
     
    Last edited: Oct 6, 2015
    ikazrima, Arx, Tony707 and 2 others like this.
  26. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Hi Ludiq

    I'm very tempted to pick this up. Before that, how's the performance in mobile? I didn't see it mention in the store page.

    p/s : Even without mobile support, I'm still likely to get this ;)
     
  27. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Apart from rewindable particle systems, performance should be great. It does mention "Mobile support" in the promo images and the description. :)
     
  28. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Ah okay, I must have missed it. :)
    Anyways, I think I won't touch the particle system (yet!). Just some platforming/puzzles for my mobile game.
    I'll pick this up later ;)
     
  29. mwozniak93

    mwozniak93

    Joined:
    Feb 4, 2015
    Posts:
    11
    Hi, Is this part important?:
    I mean, why the gravity is turned off? Because of it My character doesnt jump properly...

    Code (CSharp):
    1. protected new Rigidbody2D rigidbody;
    2.  
    3.         protected override void Start()
    4.         {
    5.             base.Start();
    6.  
    7.             rigidbody.gravityScale = 0;
    8.         }

    And btw : how can I use non-rewindable timeline? I want to slow down my particles but I do not want to record them. After adding Timeline I still get fps massive downgrade and lags.
     
    Last edited: Oct 10, 2015
  30. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    On your Asset Store page you mention that you are trying a new lower price. I just wanted to let you know I bought your asset because of the lower price.
     
    LazloBonin likes this.
  31. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    It is incredibly important! The whole physics code depends on Chronos manually controlling gravity.

    You should use Chronos equivalent methods to Unity's basic physics methods when making your character jump so that everything "just works". A list of those is here: http://ludiq.io/chronos/migration

    For particle systems, simply uncheck the "Rewindable Particle System" checkbox in the Timeline inspector.
     
  32. mwozniak93

    mwozniak93

    Joined:
    Feb 4, 2015
    Posts:
    11
    Ou thanks, it looks like I did not update chronos correctly, because when I downloaded update it gave me error that there is already chronos namespace...
    And that was right because I did have two chronos assets ( I do not know why they didnt replace each other) and then I probably deleted newer verision of chronos...
    All in all - Thanks!
     
  33. mwozniak93

    mwozniak93

    Joined:
    Feb 4, 2015
    Posts:
    11
    !!!!!!
    IMPORTANT:
    My project is doomed because of update... I was pooling objects from PhysicsTimer2D array and now even when I changed PhysicsTimer2D[] to Timeline2D and change access in object to .rigidbody2D I get error.
    I figured out that it happens when I try to access transform like this:
    Code (CSharp):
    1. array[i].transform.component = ...
    I was using PhysicsTimer2D whole time, now I updated Chronos.
    What should I change PhysicsTimer2D[] and PhysicsTimer2D to ?
     
    Last edited: Oct 13, 2015
  34. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Since 2.0, it's called RigidbodyTimeline2D, and it's no longer a Component. You can access it from GetComponent<Timeline>().rigidbody2D. If you need to know which Timeline is attached to the RigidbodyTimeline2D, you can use RigidbodyTimeline2D.timeline
     
  35. Arx

    Arx

    Joined:
    Jan 28, 2014
    Posts:
    22
    Hey @ludiq, any progress with this issue? I don't mean to rush you, but we're trying to reach a deadline with our game and if there's any simple "hack" to fix this (maybe hardcoding a hacky "if" statement somewhere or something like that), I'd gladly do it that way for now and then wait for the proper solution to come out.

    If there's no such easy fix, I completely understand, just tell me so - and I'll devise a different workaround to this problem myself.

    Edit: or maybe if you'll just point me in the right direction, if you have an idea what to look for, I'll try to find such a hack myself :).
     
  36. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    I'm terribly sorry Arx, I somehow forgot to note down that bug report and didn't get to it. It will be fixed in the next version, but in the mean time, I'll send you a fix via PM!
     
  37. Arx

    Arx

    Joined:
    Jan 28, 2014
    Posts:
    22
    Thank you very much for the fix you sent me - it works - and for your wonderful support too!

    Just so you know, this fix also solved another issue for me, about which I wasn't sure if it's related to this or not. I have a few trapdoors which use Hinge Joint 2D component. Attaching Timeline to them works and enables the Chronos functionality for them, but pausing (setting timescale to 0) and unpausing (setting timescale back to 1) caused the hinge to behave very strangely - suddenly rotate around their anchor for a few times and then stop.

    It's also possible that a similar anomaly can be experienced while using Wheel Joint 2D + Chronos and pausing/unpausing the time, because sometimes the object "jumps away" for a while and then returns - but I haven't been able to reproduce this reliably, so I don't want to draw conclusions. Just a heads up.

    Thanks again! :)
     
  38. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    I haven't yet even tested hinges with Chronos; if they work, it's somehow "by mistake". As the roadmap states, this is planned for v.2.4, and it might take a while, because hinges are truly not anywhere near my area of expertise.

    Regarding the problem you mentioned in the PM: the object loses its velocity with the fix because you're essentially telling Chronos not to record a snapshot before pausing the clock and applying it afterwards. Therefore, the velocity disappears as well as the transform's position and rotation. Because this is a bug, I'll reconsider including the fix in the next version. What I might do, instead, is allow public access to the "zero snapshot" (pre-pause snapshot), so you can edit it's position and rotation manually somehow. I might even include an easy way to do that with all recorded snapshots! (e.g. Timeline.rigidbody.MoveSnapshots, Timeline.rigidbody.RotateSnapshots).

    Please let me know if you need that feature imminently to hit your deadline so I can arrange my schedule accordingly!
     
  39. oOZerOo

    oOZerOo

    Joined:
    Mar 1, 2011
    Posts:
    12
    Can it have 4.x version?Because My project is 4.X ,I don't want to Upgrade the project to 5.x!
     
  40. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Hi Oozeroo!

    I unfortunately do not maintain different assets for earlier versions of Unity. You will need to upgrade your project.
     
  41. Arx

    Arx

    Joined:
    Jan 28, 2014
    Posts:
    22
    No, it's not that critical - the "hack" I did in the ApplySnapshot() seems to be quite sufficient for now and we don't use rewind functionality, so no problem here. But thanks, you helped me!
     
    LazloBonin likes this.
  42. Tony707

    Tony707

    Joined:
    Jun 15, 2015
    Posts:
    38
    Hi,

    Thanks for the last upgrade and the non rewindable option, huge performance improvements !

    Unfortunately we still have to maintain a little hack in the particle system timeline
    in order to adjust the playbackspeed to the root AND the children particle systems.

    Would it be possible to include this functionnality in a future release ?

    Thank you.
     
  43. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    When you adjust particle system playback speed in Unity, does it affect the children's too?
    ParticleSystemTimeline only tries to mimic the default Unity ParticleSystem behaviour.
     
  44. Tony707

    Tony707

    Joined:
    Jun 15, 2015
    Posts:
    38
    Well no the playbackspeed does not affect children by default in Unity :).
    (Behaviour I do not understand since they provide Play/Pause/Stop that can affect children but anyway...)

    Ok no problem I understand you want to provide the same API.

    Thank you.
     
    LazloBonin likes this.
  45. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Hey everyone!

    Quick heads up: Chronos is 40% off this week for the Birthday bonanza sale. Grab it while you can!

    :)
     
  46. Jay11

    Jay11

    Joined:
    Aug 8, 2015
    Posts:
    7
    Hi,

    Thanks for the amazing asset.

    Quick question: in my project, I am adding a force to a rigidbody2D in the Start function. But it seems like it is not affecting its velocity at all, regardless of the time scale.

    Here is the code:
    Screen Shot 2015-11-06 at 17.11.32.png
    Time is not a null and all the parameters are correct.
    I even tried to set the velocity directly but the velocity was still not changed..

    Do you see what I am doing wrong here?

    Thanks
     
    Last edited: Nov 6, 2015
  47. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Hi Jay!

    That seems like a script execution order hiccup. Chronos has to wait until Start to set the relation between Timelines and Clocks (just like any extra-object relationship in Unity can't be done in Awake). I think what is happening is that the time scale is still at 1 when you call AddForce, because your script gets executed before Timeline.

    Try going in Edit > Project Settings... > Script Execution Order and putting Chronos.Timeline at a negative number (e.g. -100) then test again. Tell me if it works!
     
  48. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hiya!

    I'm interested in Chronos for creating a replay of gameplay. Is this possible/feasible/stupid? I'd like to be able to save that replay and allow people to play it back later or upload it for sharing purposes. It can't be video because the purpose of it would be to view the action from different angles and so on....

    Is Chronos suited to this kind of behaviour?

    Thanks :)
     
  49. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Hey hippo!

    Unfortunately, that's not possible. If you look at the thread, it's probably the #1 request.

    I had been developing a separate plugin to do that, and while it's mostly working, there are too many roadblocks in the Unity API that prevent me from making it a true, full fledged replayer (and I want to uphold some quality standards). I'm keeping it in mind, but after weeks of (almost literally) banging my head against the wall, I'm pretty despaired. :/
     
  50. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    If you have any suggestions for Unity that would make it possible, tell them about it. :)