Search Unity

Timeline events?

Discussion in 'Timeline' started by Buzzdev, Jun 24, 2017.

  1. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    787
    And all events in the time between would get collected and called? So no event ever gets skipped?

    Being a dev myself I can see that it wouldn't be as "neat" or easy to do, but I think its the same old story of "do you want your code to be fast and easy to reat? Or do you want it to actually be correct?", no?

    There are lots of things that could be done. For example only doing the "sweep" for tracks that actually want it!

    If we have a cutscene that has an event which triggers some kind of interaction, and then that event gets skipped for whatever reason and a player is simply locked into the cutscene without any way to advance or break out of it... that'd be a bug that would be horrible to diagnose and fix.

    This stuff shouldn't be by design.
    People will use it for things you didn't anticipate - as is always the case - and furthermore timeline is (or will be) a core component of Unity, not just some random asset store package.

    So personally I think that at some point sometimes we have to pay some price (in terms of code complexity, special cases) to get a solution we actually want.

    There doesn't have to be any state machine setup. You already have a place (or rather multiple place) where you can do a sweep from old position to new; and only certain tracks will be affected anyway (tracks like activation tracks, whose ONLY purpose is to get triggered correctly)
     
    awesomedata likes this.
  2. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    I can understand where @seant_unity is coming from with Events being intended to handle this issue -- but as you said, "is it correct?"

    Really, if the user cannot add really tiny clips without issues, at least throw him a bone when he's trying to add the really small clip that lets him know the problem and also the alternative + workaround with a warning message. (Perhaps a checkbox with the "ClipCaps" associated with the track/clip internally as @seant_unity suggested the other user to code for himself? I'm sure there are other users out there who will try small clips in Timeline and also wonder why it's not working, so why not make it available to everyone by default??)


    That said -- I think the answer to the question of "is it correct" comes from how it is seen by those closest to the end-result (i.e. the devs using Unity for real products).

    And due to the fact that it is (reasonably) seen as a "bug" by most Unity users, and just as "sloppy coding standards" by more veteran Unity users who have presented a "quality" code-based product to their users and have had to deal with "design" issues like this both from demands from their users -- as well as required heavy "workaround code" demands from some poorly-designed Unity + API features they require on a regular basis. Either way, I really feel stuff like this is genuinely a problem and should be proactively addressed without always hand-waving it aside.

    I guess it boils down to the eternal question -- "Who should win this battle -- Unity devs or gamedevs?"



    In this case, I think "the customer" should fit the bill... since they are "footing the bill" too aren't they? You Unity guys are customers too -- You guys don't want the smashed loaf of bread -- You want the perfectly good one right next to the smashed loaf of bread for /your/ money. Why should anyone here be any different? -- Sure, the smashed loaf of bread can make the same kind of toast -- but it's not great for sandwiches anymore. I guess we've all got to use the smashed bread (Unity) to make toast just because the Unity devs can't see why we might want to make sandwiches with "our" bread?

    I really don't think it's so unreasonable to expect "fixes" for small things like this that are "only issues to one or two" because MOST people who have these don't ever speak of them. There's larger fish to fry, and a bug report is a pain in the ass when you've got deadlines.



    I respect you guys' hard work for real -- I'm a developer myself. But because I'm a developer, I know from experience that this sort of thing can be dealt with before it's ever an issue as long as you are seriously thinking about the end-user from the very outset and onward throughout the project.



    If you design something properly (that is -- if you design with the worst possible user in mind who exists solely to destroy your system and then complain it's broken), your code truly will become "correct" and smaller fixes like this are a LOT easier to manage. Perhaps that wisdom can at least be applied to the next "big feature" Unity plans to release? -- That, or fix your team / workflow / overall-mindset if it is a personal / manpower issue. Either way -- the product (Unity) needs to be handled (and programmed) correctly. Although "correct programming" is relative -- "correct to the user" is pretty clear:

    If it seems like it /should/ work -- it /should/ work.

    Tiny clips in the timeline /should/ work in an editor that clearly shows them there -- or at least give an error message / warning + workaround for things like this when the user tries to place a tiny clip in the timeline if you plan to have an alternative way to deal with them (i.e. Events). This is so that the user knows he might have to do some sort of obtuse code-workaround if he ends up "needing" something that breaks your system (such as tiny clips.) There should always be thought in this sort of thing -- and there would be if you were thinking of your users before yourself. Treat them like an old granny who has never touched a PC before. You'll generally be pleased at how pleased your users will be with you. -- Just my two cents.
     
    Last edited: Jan 22, 2018
    Deeeds and dadude123 like this.
  3. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    787
    I see that in a similar way.

    Sounds to me like the devs have one specific use case in mind and for other problems they want to offer dumb "workarounds".

    Everyone here already knows how this will end: people complaining, and simply dropping Timeline for their projects. ¯\_(ツ)_/¯

    But when your actual customers don't use Timeline because it does not work for them*, then who are you even developing it for??
    Isn't it a waste of time and money to develop something that people will find broken?

    (*) It is a critical bug, even if you argue that its by design or whatever. Sure you can argue about design decisions and philosophy and whatnot, but at the end of the day people will expect this to work and they are simply not interested in the reasoning why it is like it is.

    That being said, I do appreciate the hard work! And I don't want this to come off as an "attack", but there's a mistake being made here and it has to be called out.
     
    awesomedata likes this.
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    966
    You are correct, there are a lot of things that can be done to solve the problem.

    A sweep is a perfectly valid solution. There is a performance penalty to doing a sweep, and as developers I'm sure you agree that efficiency matters. So making it as option would be necessary.

    Correct me if I'm wrong, but the use case for using a small clip is at a certain point you need to change the state of something. i.e. There's a point in time the state should be change from X to Y, and then stay at Y.

    When I say events are our preferred solution, it's that problem I'm referring to. Visually, we think these should be represented differently, to convey the different behaviour to the user of the timeline. The events aren't really clips (or maybe they are, you could think of them as clips having infinite length).

    The tracks we provide don't require an accumulation of state. That is evaluating at a given time doesn't depend on previous evaluations.

    We've seen examples where that assumption isn't what is wanted. That's fair. There was a great forum post about a track that accumulates the transforms from previous clips, and to accomplish that they used a mixer playable. The same could be done to implement a sweep behaviour.

    So if we are missing use cases where events are not a preferred solution to small clips with sweep behaviour, please share! We would love to make sure we can handle that as well.
     
    ledbetterman and JJC1138 like this.
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,100
    how about just keyframes that fire / are events?
    So you just set a property on the keyframe that is an event. make it look different than a normal keyframe and done right? probably not ... but just thinking along
     
    Deeeds likes this.
  6. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    I can see that being useful for fighting and action games (placing hitboxes and hurtboxes) or even just walking and playing a sfx on a per-footstep basis. This would be incredibly tedious to program an entire system to do when we could just piggyback off of Timeline's basic functionality and do this visually without having to write out our own editor. Since there'd be a LOT of these in such a game, it'd be useful to tie these to animation keyframes directly!

    To be clear, there are animation events -- but keeping the Animation separate from the timeline's clip events would allow for a large hitbox on one timeline where the clip is present (in which the entire timeline represents a choreographed attack sequence), a smaller hitbox on another, and maybe a hurtbox on another -- all while playing back the same animation clip on each of these separate timelines and just using the animation event to reference that specific timeline's properties at a given point on the timeline's playback location. Thus simple "Animation Events" alone would actually not be as useful as they would be when tied to Timeline Events for these sorts of things -- the Timeline itself could query the animation playing, and, perhaps based on the speed of the clip (which, in some cases in action games, that speed could be very small and thus affect its duration!) its hitbox or hurtbox size could be increased/decreased automatically via Timeline Events firing based on a clip's length.



    At the very least, if you make a punch, kick, and shoryuken uppercut animation separately, you might want to patch those together to make a hyper-combo with larger hitboxes and heavier damage for each consecutive attack in the timeline. You'd probably just name the timeline "HyperComboUppercut" or something, but it would consist of those various animations and they each would have an animation event associated with their keyframes -- that animation event would correspond with the event fired in the timeline (at the same time) that sets the hitbox size and damage for each consecutive attack in the combo. Each animation could be executed separately too (in their own independent timeline) using their same animation events (alongside their timeline event companions) so that they could act independently as single attacks of their own as well -- as long as each "attack" also has a timeline associated with the events it needs to correspond to.



    This above, @seant_unity, is one use case I would personally use Timeline for (quite often) while making action games.

    Stuff like that might be very specific, but sometimes you need that sort of flexibility for animation events to be tied to specific keyframes on a timeline (simultaneously tied to a clips' start/end or to specific keyframe(s) during the clip while it exists on a timeline.)

    Of course, not every user can realize that their system could be more efficient if done another way, so I think that having the behaviors represented differently visually and also having the option to have the "sweep" behavior on or not is a great idea -- but! -- I don't think you're realizing that the "sweep" pass can also be done at design time (i.e. not just at runtime!) and simply generate and also be associated with a data file (such as a .sweep file?) to be read from! This would definitely help performance on complex tasks like the style of animations in action/fighting games mentioned above. Additionally, this could set Unity even further apart from its competitors because, as far as I'm aware, only 2D packages have options similar to this (but still not quite as robust!) -- so for Unity to support this for 3D animations too, I feel like there's a HUGE potential there that you guys aren't seeing yet.
     
    Last edited: Jan 23, 2018
    ledbetterman and Lars-Steenhoff like this.
  7. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    787
    I see where you are coming from.
    Please correct me if I got this wrong because I *think* your implementation already fixes that certain type of problem I have in mind.

    An "event" on the timeline will be some sort of fake clip that has a start time (when the event will be called at the earliest time) and extends forwards in time infinitely. That means as soon as the event is "entered" it is called once, and then never again (unless the timeline gets reset or loops around or something like that) because the event remains "already triggered".


    Now that should be fine for some things, but I have a scenario here where I am not sure what you imagine will happen:

    1) what if I have two events (or alternatively an extremely short activation track that pulses an object just for one frame) close together?

    I imagine in the two events scenario my events would both get triggered, but I wouldn't be assured that they run in the correct order (which I can't have)

    And in the "short activation clip" I imagine that at low framerates the whole thing might be skipped entirely. (my activation clip in time span 5.0-5.02sec and frame #1 at 4.7s and frame #2 at 5.1s)


    I guess we can at least work around the second problem. When someone wants an object to be active for only one frame, they should activate it through a timeline event (as planned) and then have the object deactivate itself with a script after it is done.
     
  8. Gord10

    Gord10

    Joined:
    Mar 27, 2013
    Posts:
    129
    I wish we had Timeline events in this version of Unity. My workaround is to create objects like ATC_ChangeScene, whose purpose is to change the scene when it gets enabled.
     
  9. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    968
    What is the easiest way to start a 2nd timeline after the first one finishes without events. I have an audio introduction to a VR model that ends with '...if you are unsure what to do a tutorial will begin in a moment'. My plan was to start a timer at the end of the first one, wait 5 seconds, then start a controls tutorial. Should I forget working through a timeline event workaround and just start a timer at in Awake for the length of my first timeline + 5 seconds? Or I guess I could do one long timeline with a big gap.

    And what's going on with this? I glanced at those Playable packages on the asset store. There aren't any demo scenes, I don't have time for that. I've used assets for years where you can drag a gameobject with a component in and fire off anything you want at a point, just like the UI.
     
    Lars-Steenhoff likes this.
  10. nathanjams

    nathanjams

    Joined:
    Jul 27, 2016
    Posts:
    170
    https://forum.unity.com/threads/timeline-events.479400/#post-3185580

    There is an event trigger plunging here.

    You could write a little script (triggered from the event plungin at the end of your first timeline) with a corourtine that delays that start of the method and then run the tutorial timeline.

    This should work. I’m using this plugin for lots of things. Just be sure the clip length isn’t too small. Sometimes the events aren’t registered if so.
     
  11. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    I've been using timelines for some time now, and have reworked some of the code that Marius George kindly shared here to enable events (it's crazy that it didn't ship with events).

    I've currently updated the code so that I can toggle whether to invoke a method with a single string arg, or no args. Everything is fine and dandy, except for one thing - the value in my property drawer for the string argument value never propagates to my clip clone. I've no idea why this is the case - the serialization for property drawers and timeline clips seems totally crazy to me. What would cause this value to show up in the property drawer; but never be present in my behaviour?

    The values in particular is this one
    SerializedProperty startArgProperty = property.FindPropertyRelative("StartArgValue");
    EditorGUILayout.PropertyField(startArgProperty);

    Here's the full code if someone can work out why this startArgProperty shows up in the inspector; but is always "" in my eventbehaviour, I'd be really grateful

    Code is here :https://gist.github.com/georgejecook/71b57ebd1f78593831a48e0af4eb4172
     
    Deeeds likes this.
  12. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    966
    From a brief glance, TimelineEventClip.CreatePlayable is overwriting the value from the inspector with an (empty?) value from the TimelineEventClip. Remove that line, and I suspect it would work.
     
  13. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    @seant_unity you, sir, are a very kind person! Thanks for taking the time. Thanks to you I've now better understood Marius George's code, and had time to look further into it. It was indeed how you said.

    Thanks! Can't wait for a more robust solution to this issue from you guys, and also looking forward to timeline _relative position_ animations. That will be a HUGE feature when it makes it's way into a build :)
     
    seant_unity likes this.
  14. nrvllrgrs

    nrvllrgrs

    Joined:
    Jan 12, 2010
    Posts:
    12
    https://forum.unity.com/threads/timeline-events.479400/#post-3185580
    Using the above code as a point of reference, is it possible scan for events given a director and named track in the editor?

    I am trying to make something similar to Audio Shield. I have an Audio Clip track and an Event Track that is annotated with the desired points of impact (i.e. the player "blocking") but I need to spawn the projectile N seconds prior to impact, which is dictated by a speed. So I would like to write a script that scans the event track and adds a new Event Clip N seconds before every "Impact" event clip.
     
    rmsulliv likes this.
  15. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    I made a yet another makeshift solution. A DIY class kit that could make your own method invoker track. The different is that it is very tightly connected to your game code.

    Screenshot 2018-02-23 09.31.08.png

    - Utilize generic for subclassing. You get a track hardwired to your class which is not as flexible as reflection-invoking or string-SendMessage, but the compiler can check if your class changed or become unlinked and I like it that way. You make 2 new files per one game class that you want to invoke its public methods. One for asset and one for it's own track.
    - Does not use listener in the scene, connect with ExposedReference.
    - You could name the drop down for choosing the method however you want via the enum in the class that you made. Specify the enum-method pair via a dictionary hardwired in the class code.
    - Selected enum becomes clip's name automatically. Makes it easier to see on the timeline.
    - Supports only parameterless public method. I planned to add one more `Action<float>` invoker and the `float` argument would corresponds to clip's length.
    - Invoke method with `OnBehaviorPlay` ,so it would be still subject to the clip too short - might never play timeline sampling problem that one Unity team mentioned in this thread.

    https://github.com/5argon/E7Unity/tree/master/InvokerPlayable

    Subclassing is like this (C#6 syntax) Put the class you want to call its method in the generic and it would be available as an argument in MethodPairings

    Screenshot 2018-02-23 12.23.06.png

    There are 2 required abstract overrides, and you will need one another custom enum so that it would be your drop down by Unity's UI. The enum definition can be any name but should be private so that it won't pollute the namespace.

    You can just use Unity's Playable Track, or if you want your own exclusive track you require 3 more lines of code. This time put your asset class created earlier in the generic :

    Screenshot 2018-02-23 12.20.11.png
     
    Last edited: Feb 23, 2018
  16. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    337
    Can we crowd-fund frame event feature?
     
    Deeeds, StaffanEk and awesomedata like this.
  17. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    Lol

    I can't knock them too hard on this right now. They did mention it should be done by 2018.1 or 2018.2 (it looks like it might be 2018.2 since I didn't see it in the roadmap on 2018.1), but really, the way builds have been going and all the new features and tools they keep giving us (i.e. Probuilder), and the way they seem to be taking feedback seriously again, I think they are really planning to deliver on this promise. I'd rather the feature be late than it be broken though, so as much as I hate to have to wait more, maybe there's a reason for all this waiting right now.

    We'd all love to hear about the progress on a feature we thought would be in upon release, so I definitely understand your frustration. I've wanted this for a long time too.

    Perhaps someone at Unity could speak up once and awhile about these kinds of things? -- It might be nice to hear how it is going so far with features/fixes like these to those who have less faith in them than I do.
     
    GameDevCouple_I and 5argon like this.
  18. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    In the recent version suddenly a Test Runner silently gains a category filtering (You can use NUnit's [Category()] attribute) long after a forum post (https://forum.unity.com/threads/why-the-regressions-to-test-runner-in-unity-5-6.471548/) that I have been subscribed to last year waiting for the feature (around Unity 5.6 era). They did listen and try to implement things so I have very high hope for Unity team. Albeit a bit too long for some feature that seems simple.

    But I doubt frame-trigger event will be easy to implement because of its conflict with stateless nature of Timeline. It might take more time than we thought...
     
  19. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    I think a lot of these flexibility/regression issues might have to do with the major rewrite I was told they were doing on a lot of their old/outdated backend systems. That's a pretty huge task for a product like Unity -- even with a crapload of programmers chained to their keyboards. These smaller side-effects (like no Animation Events or Timeline Events) tend to come from things that interact on multiple levels w/multiple systems that happen to be "in-flux" atm, so I'm sure animation as well as timelines are included in those types of systems. Regardless, I really hope it comes before 2018.2, but I'm not getting my hopes up. There's a lot of stuff that has to fall into place before multi-level systems like the two here can be properly intertwined without serious bugs cropping up in unexpected places later on. I just hope it comes soon!
     
  20. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    Hey I saw this in a patch note. I assume this is with Animation track, the already existing event system in the Animation clip can now triggers when the Timeline is sampling it. It is not exactly Timeline event but at least it is the first officially supported way of putting events in the Timeline.

    Screenshot 2018-03-02 20.30.22.png
     
    ZiadJ and awesomedata like this.
  21. CyRaid

    CyRaid

    Joined:
    Mar 31, 2015
    Posts:
    80
    Where do I find p1 to download? Is it stable version?
     
  22. B3ukenn00tje

    B3ukenn00tje

    Joined:
    Sep 8, 2015
    Posts:
    2
    hey I just saw this post and I was brainstorming about this problem.
    I was thinking about using the textswitcher in combination with a script that looks for changes in the text.
    then when the text changes it sends the text via a messages system to invoke the functie which is tied with the string placed by the textswitcher.

    I'm not able to test right now but do you guys think this idea can work?
     
  23. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    I've got a pretty decent solution I've been using for months. I've just open sourced it.

    I'll put it on asset store today/tomorrow..



    github is here https://github.com/georgejecook/UnityTimelineEvents

    Thanks to Marius George from farflunggames.com who posted something up here months ago that got me started.
     
  24. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    To add to that as well; I've got some experiments with mulitple params for methods, and passing in transforms/gameobjects - I'm happy to receive pull requests for improvements/feature suggestions.

    Asset store asset will (of course) be free.

    UPDATE: Asset store package submitted for review.
     
    Last edited: Mar 28, 2018
    Deeeds, pojoih, Hoorza and 1 other person like this.
  25. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    If you like what I implemented, you can buy me a beer - or pass my details onto someone - I'm looking for some Unity3d/VR/Xamarin Forms gigs. T H A N K S :)
     
    pojoih likes this.
  26. makyoo

    makyoo

    Joined:
    Apr 10, 2015
    Posts:
    1
    low fps mobile devices,and the clip only 1 or 2 frame.
    OnBehaviourPlay will be miss ! !?
     
  27. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    Yep -- mentioned before in this very thread to @seant_unity, etc., etc.

    The consensus was roughly "There are currently no plans to handle this scenario, but we'll see what happens." (assuming I'm remembering correctly) -- I've heard that particular response a number of times when users bring up issues like these to the Unity team, so who knows?

    I hope they do try to get it in there at least. It seems like the time we've been waiting for 2018.2 to arrive should at least fix this issue of "skipping" events by letting us "pre-scan" some Timelines at a normal rate to check for tiny events like this. Even if we have to associate a file/data with it to accomplish such short clips, having the ability to do so would definitely be worth it for some of the Timeline applications I can imagine using it for.


    Also!

    Thanks @Infrid and Marius George for tossing people a bone! -- Seems like this was a long time coming, and I don't think most of us want to wait anymore for 2018.2 to get here before we can all use this powerful feature! :)
     
    Last edited: Mar 29, 2018
  28. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    Okay - I previously had it using Marius's George's solution for storing starttimes/endtimes, which I now realize solves this issue - I changed the code though, because I had issues when editing timelines (I'd have to mute/unmute the timelines for changes to take effect). But it sounds like that's a better problem than randomly skipping. I'll change the code back to how it was - so this should be working fine with dropped frames by the weekend.

    I'll ping back when it's done.
     
  29. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    Maybe a simple "refresh" button that automatically mutes/unmutes all the timelines at once to refresh the changes?

    The user could press that when he's ready to see his changes reflected (rather than digging through each timeline to find the tiny "mute" button and do it himself).
     
  30. Infrid

    Infrid

    Joined:
    Jan 14, 2012
    Posts:
    67
    @makyoo @awesomedata - I'm going to leave as it is - a read of the unity bug tracker here, and perusing several other repos that use the same function in their behaviours leads me to believe the impact is minimal. https://issuetracker.unity3d.com/is...lay-does-not-always-get-triggered-in-timeline

    The worse case scenario is that it will be called a frame or two late - which is an utterly moot point as far as I can see.

    The clips are many 10's of frames long, at least - so they are not going to get skipped. I've not seen a single instance of it skipping in months of continual use, under varying loads.

    Thanks for the concern though - if it becomes a problem - raise an issue on github, and I can revisit it ;)
     
    SunnyChow likes this.
  31. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    Thanks for looking into it @Infrid!! -- Really, the only thing I could see it being an issue with is frame-based fighting or beat-em-up games where only on certain frames you would have a hitbox (attack area) and most others your hurtbox (damageable area) may exist or change sizes or play a sound.

    Now that I think about it, I do wonder if there's an "easy to implement" workaround for this particular issue of frame-rate dependence. Perhaps a script that plays over some portion of the length of the timeline that can determine how much time has elapsed since its own invocation and activate/deactivate scripts/instances/whatever along the timeline in the Timeline's stead? I feel like even this might be reinventing the wheel though. The only issue I could see with something like this other than copying the functionality of the Timeline is that the first couple of frames could potentially be missed, but that would be a better trade-off (I think) than the middle frames being missed at random points.

    Anyone have any thoughts on this?

    Regardless, thanks for taking the time to share this with us @Infrid -- I'm sure even with its current behavior, there are tons of people who will find this crazy-useful, and even a little delay in an event is better than the event not being able to fire at all! -- So thanks again man! :)
     
    Deeeds likes this.
  32. Hoorza

    Hoorza

    Joined:
    May 8, 2016
    Posts:
    20
     
  33. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    Speaking of fighting games and Timelines missing frames -- check out the Timeline flags in "Nier: Automata" (an Action game, not a Fighting game) and how they were dealt with:

     
  34. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    337
    In my case, i am just using it for an animation for a promotion-use software. If we just play from the begining to the end, it's fine. but when we need to jump to a specific frame, it's a mess. Some of the PlayableBehaviour
    's events are not called, and it doesn't trigger our events. Also the framerate is low, it's just skip my event trigger chip if it's too short
     
  35. ABalliache

    ABalliache

    Joined:
    Mar 18, 2013
    Posts:
    1
    Thank you for the package. I'm having the problem that if my frame rate drops, clip(s) can get skipped and events never thrown. Is there a way that I can catch when a timeline has skipped clips so that I can bulk raise them?

    Thanks,
     
  36. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    813
    This is what we were talking about with @seant_unity regarding fighting and action games' per-frame events.

    I suggested to "sweep" specific user-defined Timelines and associate the "sweep" data generated with a particular Timeline at design time (in the editor). This association can be done via an asset file (or internal Timeline class property) generated for each Timeline marked like this.

    Seems like this could work for everyone without changing much at all of the current implementation.

    Thoughts, @seant_unity?
     
    Last edited: May 12, 2018
    Lars-Steenhoff likes this.
  37. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    Okay so, to recap, we have tons of solutions for this, and none of them just work all the time?
    • zmacbean's solution is "messy" in the sense that the custom event gets called every frame the event exists on the timeline.
    • HypothicEntropy's solution calls the animations directly, but this suffers from async issues, and also breaks several of Timeline's builtin features.
    • adamgryu's solution doesn't repeat events when the timeline loops, and also the events trigger even if you jump into the middle of them. (basically you'll have NPCs stepping on each others lines, for example, or events firing basically at the wrong time, if you try to jump to a specific point in the Timeline.)
    • tezza2k1's Custom Track/Playable that binds to a script offers simple, clean one-shot triggerable events,
    • KikkidEdd1's implementation requires you to write and wire up two new scripts for every event you want to trigger, on top of several other scripts sitting in the project directory.
    • seant_unity's official Word-of-God Unity Team example triggers twice if you pause the game while the event is playing. (Honestly, does anybody really expect better from Unity Team by this point? If the official solution were ever the right one, we wouldn't even be having this conversation.)
    • Lars-Steenhoff's solution is specifically for use with Playmaker.
    • mgeorgedeveloper's composite approach is said to be robust and well-documented, but lacks parameter support.
    • Infrid's open-source UnityTimelineEvents repo randomly skips events if you try to actually use them as discrete one-shot events that happen at a particular time.
    • Event Player by Threeyes, currently free on the Asset Store.
    As usual, I'm here because Google decided to tell me that this was where I could learn how to do it right. 3 forum pages of posts later, I discover that nobody knows how to do it right. Unity Team shipped a feature as out-of-beta off the back of a Unite demo that was nothing but smoke and mirrors. Timeline isn't done. It doesn't exist. It's not real. It's a fake feature.

    Congratulations, ladies and gentlemen. Now not only are all the video games Vertical Slices, but the tools used to make the games are, as well. First the Asset Store took over Unity, now this. I suppose six months from now you won't be able to buy specific items from the Assets Store, you'll have to gamble with lootboxes just to get your tech!

    How much further is the community going to let Unity decline before we stand up and DO something about it?
     
    Last edited: May 22, 2018
  38. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,100
    Unity is doing something about it. we can give feedback how it should function and it will land this year.
    I understand the pain of waiting.

    #88 its coming in 2018.2 or 2018.3
     
  39. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    What more feedback could we possibly need to give them above and beyond "you should be able to make the rest of your game happen when the cutscene is over!?" The developers knew better, and the investors made them release it anyway. Every single artist and programmer at Unity Team is being thrown under the bus by the suits in charge. They're ruining the rest of America, and they're ruining our video games. This is a trajectory we've been seeing for years, in every part of the video game industry, and now Unity, which was once poised to be a game-changer, is just as toxic and fetid and bloated as everything else. If you're not fighting to change this, you're fighting for the status quo. If you're not part of the solution, you're part of the problem. This is not normal, it's not sane, and it's not all right. Hold the corporate executives accountable for their bad decisions. They're ruining things for the rest of us. Stop pretending it's fine and fight for what they're taking away from you, goddammit. Unity used to mean something.
     
  40. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,100
    no need to curse, but yes your right about that the timeline was released before it was finished. and this is frustrating.
    it could have stayed in preview until it was ready to be called final.
     
  41. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    It's not just about Timeline. Timeline has no business being on the front page, but there's more to it than that. I'm more upset about the overall general trajectory of Unity over the years. This whole event is just another nail in the coffin. Every new release, old ways of doing things are stripped out and changed, old scripts stop working. Things which used to be free now have to be bought, or even re-bought. I miss the days when Unity was a quirky up-and-coming 3D game dev solution. I miss the days before they started recruiting executives and investors from the once and future Worst Company in America, Electronic Arts. I miss the days when I thought it would be possible to complete a game and make money off of it before the ground shifts under me and I'm forced to update and they move the target again. I miss the days before they stopped treating me as a customer and started treating me as a wallet with legs.
     
  42. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,100

    Yes I can understand where your coming from, seeing you are using unity for 10 years now, just like me, and it seems that sometimes things that could be so simple are done in ways that are over complicated or never implemented at all, but I see good things coming. especially with the package manager. and then hopefully the core unity will stabilize and we get many new features without them breaking the old ones.
     
  43. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    Do you not see how things have changed over those ten years? Do you not see how the change in business model was caused by the change in leadership? You can't just "hope" that things will magically get better on their own. They never will. That's now how these scummy corporate suits run things. It's in their nature to take and take and take until the entire venture collapses in on itself, then they escape on a golden parachute and move on to the next business to ruin. If you want this to change, if ANY of us want ANYTHING about the video game industry to change for the better, we need to stand up and fight for it. You might think you're protecting your status quo by doing nothing, but you're not. You're protecting their status quo. And their status quo has always been to devour and consume your status quo. They don't get rich by helping you succeed. They get rich by selling you a dream with an expiration date.

    Timeline's Vertical Slice Release is just the latest push where they try and see how much they can get away with, how much they can get us to swallow.

    You mark my words, lootbox gambling is coming next to the Asset Store. I don't mean an asset that lets you put lootboxes into your game, I mean a system whereby you have to pay with real money to gamble with lootboxes to see whether you get the assets you needed or not. Why would they do this? Simple. It's the one bad idea from AAA video games they haven't used yet. They put DLC into Unity, then they put Microtransactions into the DLC, now everything's a subscription service so you can't even own the tools. Where else could they possibly go from here but lootboxes? It's the stupidest idea imaginable, but you watch. They'll do it. And you and I will be having this same conversation again a month from now, and you'll be telling me that the lootboxes "aren't so bad" and I'm "freaking out over nothing." Maybe the lootboxes will contain skins for the Unity editor so you can use the argument "It's just cosmetic." At first. Because after they put in costmetic lootboxes, the next step is always to put in non-cosmetic lootboxes. I've been through this process more times than I can count. These sleazy corporate snakes are all the same. They never change, they never learn, and they never care. Unity has been slowly selling its soul for the last ten years. And unless you and all the other good, decent people in the Unity community reading this stop taking it, stand up, and actually do something about it, they'll be coming for all of your souls next. If they haven't already got them.
     
    Last edited: May 22, 2018
    pepipe, awesomedata and Threeyes like this.
  44. Threeyes

    Threeyes

    Joined:
    Jun 19, 2014
    Posts:
    26
    I happen to write a new Plugin call Event Player, it will let you organize the Event more easier. the Plugin is design in component-style, which cover some common situations, also no extra coding is needed.

    When Timeline finally came out, I add some Script to support Timeline Event, please give this a try and send me feedback:)
     
    Last edited: Jun 30, 2018
    Lars-Steenhoff likes this.
  45. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    Huh. The weird thing is I saw this icon when I was looking for a solution in the asset store, but I skipped over it because it didn't look related to Timeline. Try adding the word "Timeline" to the name of the product. If the name "Timeline Event Player" is already taken, try naming it "Qui's Timeline Event Player" or something like that.

    Adding it to the list.
     
  46. Threeyes

    Threeyes

    Joined:
    Jun 19, 2014
    Posts:
    26
    Thanks for your kind suggesttion! Which remind me that I forgot to set the Tags!:)
     
  47. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    Any idea why it doesn't work? I just want to run the method ShowPlayerShip() in my own GameManager singleton. (Not inherited from any of your code.)

     
  48. jilt

    jilt

    Joined:
    Nov 7, 2014
    Posts:
    49
    It's set to Runtime Only, so it won't work in Editor? Just a wild guess.
     
  49. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    319
    Huh. I never had to change Runtime Only before to get Unity Events to work when I run my game by clicking the play button at the top of the editor.

    Anyway, I set it to Editor And Runtime, and it still doesn't work. Figured it out. I was using an Event Player, when what I actually needed was a Timeline Event Player.
     
    Last edited: May 22, 2018
    Lars-Steenhoff likes this.
  50. Threeyes

    Threeyes

    Joined:
    Jun 19, 2014
    Posts:
    26
    Sorry for the late reply (and the lame tutorial)

    you have to right click on the track and "Add Event Player Clip”, then set the "Event Player" reference:
    未标题-1.png

    Please check out the Demo Scene"2 EventPlayerTrack“, after selected the GameObject "Director (Check this out too!)", you can see the Timeline Window as following:
    微信图片编辑_20180523002936.jpg

    Thanks :)
     
    Last edited: May 23, 2018
    Lars-Steenhoff likes this.