0

I notice an issue in OccurrenceBefore method in Timeline

Lafsody@UrniqueStudio 3 weeks ago • updated 2 weeks ago 0

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:
Any