Pending Review

I notice an issue in OccurrenceBefore method in Timeline

Lafsody@UrniqueStudio 3 years ago updated 3 years ago 2

My team is developing game that have some SuperHot mechanic. The time will go forward when player move, other of that time will stop. And add some rewind mechanic. So we decide to use chronos as core library.

It's work so great as far as I test (except animator lol).

In fact, we still research how to do a lot of thing with chronos and found some bug.

Because almost of our game's time is stopping. When action begin we do a lot of thing in that same time-frame. Then when rewinding, something is not correct..

The situation is

At time x.xxxx we do 2 consecutive occurence as A forward then B forward

What we expect when rewind is do B backward then A forward

But it happend to do A backward then B backward

In my case happend in dialogue state machine

last state clear the dialogue then current state set new dialogue in the same time frame

last state occurence

- collect temp dialogue

- forward : clear the dialogue

- backward : set back from temp

new state occurence

- collect temp dialogue (in this case temp wil be null)

- forward : set new dialogue

- backward : return dialogue to temp

So when backward occurence happend in the last order as I said on the above, my dialogue become null after rewinded.

After I go deep down through code.

I suspect the line 456 in Timeline.cs in method

protected Occurrence OccurrenceBefore(float time, IEnumerable<Occurrence> ignored)

in if statement

(before == null || occurrence.time > before.time))

Isn't this line should be >= instead of >

At the state of rewinding that everything should go from right to left, I think it's better to use the right-most one if the time is equal.

IMO its nature should  work like stack instead of queue.

I'm not sure this will affect other part or not but fix it this way solve my case.

Chronos Version:
2.4.14 (July 16, 2018)
Unity Version:
Pending Review

Hi Lafsody, 

I'm very sorry for the late reply on this. Your explanation makes sense, and since you confirmed this fixed the issue in your case, I'm tempted to merge your change to the core source. Did you notice any side effect from it since then?

As far as I have tested in my game I still don't found any side effect yet.

And would you mind checking my another forum? I think you may able to merge two change in one update.