truyet / hotween

Automatically exported from code.google.com/p/hotween
0 stars 1 forks source link

OnComplete is not reliable? #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create 50 or more waypoints
2. Increase timescale to 12 or 13
3. Run through the waypoints with loop.

What is the expected output? What do you see instead?
Expecting OnComplete to only trigger when the end waypoint has been reached.
Eventually the OnComplete will trigger before the end waypoint is reached.

What version of the product are you using? On what operating system?
1.1.006 Windows

Please provide any additional information below.
Speed is set to 10
Increasing and decreasing the Timescale is being used to move faster along the 
waypoints dynamically. Increasing Speed only takes affect after a loop.
When the timescale gets above 12 it will eventually trigger OnComplete. 
My project is using a path with 110 points and the cutoff is usually between 98 
and 108.

Original issue reported on code.google.com by enigma...@gmail.com on 5 Jul 2012 at 5:21

GoogleCodeExporter commented 9 years ago
Will get on it within the weekend. Thanks for reporting it, and sorry for the 
bug.

Original comment by daniele....@gmail.com on 5 Jul 2012 at 11:47

GoogleCodeExporter commented 9 years ago
Tried to replicate this issue (with 110 waypoints and a timeScale that 
increases from 1 to 15), but OnComplete appears to work perfectly. Could you 
attach a non-working example so I can see what's going on?

Original comment by daniele....@gmail.com on 5 Jul 2012 at 5:55

GoogleCodeExporter commented 9 years ago
You may have to try it a few times and run it for a few loops. It doesn't break 
100% of the time. I would say 10% of the time once it hits waypoint 98 or above 
running at timescale 12 and above onComplete will finish.

Also try using 2 waypoint paths. The onComplete finished prematurely more often 
when multiple paths are looping at the same time.

Do you have a way to debug onComplete? It would be easier if I could send you a 
total time and the time when onComplete happens.

Original comment by enigma...@gmail.com on 7 Jul 2012 at 1:16

GoogleCodeExporter commented 9 years ago
I'm sorry, but I re-tried many times with more than one path, but without 
success (or better, without failure :P - at least in the meantime I updated 
HOTween with new stuff). I re-checked the code but can't find a reason why this 
bug might happen, so I'd really need a sample. Not sure what you meant with 
sending me a total time plus time of issue.
Sorry if this issue is so difficult to replicate, and thanks for the help.

Original comment by daniele....@gmail.com on 7 Jul 2012 at 7:07

GoogleCodeExporter commented 9 years ago

Original comment by daniele....@gmail.com on 13 Jul 2012 at 8:04

GoogleCodeExporter commented 9 years ago
(just changing labels)

Original comment by daniele....@gmail.com on 14 Jul 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Since our project is hitting the deadline I won't have time to completely 
sample code. 

I am using Waypoint Manager System to create the waypoints. The last time this 
happened it seems that OnComplete has the correct time duration but it's at the 
wrong waypoint when the end comes.

For example I have 110 waypoints with a duration of 342.0085. Most of the time 
it will go all the way to waypoint 110 and end right at the duration. When it 
goes wrong, OnComplete triggers with a duration of 342.0085 but the object is 
at waypoint 99 instead of 110.

It feels like somehow changing the timeScale is sometimes throwing off the 
tweening.

When I get more time I will try to create a sample Unity project with just the 
waypoints and objects with a button that increases the timescale by 1 each 
click. For now it will just be a known bug that happens occasionally.

I really appreciate the efforts to help nail down the problem and even with 
this issue it's still a really great asset.

Original comment by enigma...@gmail.com on 14 Jul 2012 at 4:06

GoogleCodeExporter commented 9 years ago
Thanks :) I'm actually still trying to replicate the error, though I never used 
such a long duration. Will try it now.
A question: when onComplete happens erroneously, did you notice that the object 
was at the exact position of a previous waypoint, as you mentioned, or 
sometimes it could be in the middle between two waypoints? Knowing that might 
help me understand it better.

Original comment by daniele....@gmail.com on 14 Jul 2012 at 4:46

GoogleCodeExporter commented 9 years ago
Yes something at really high timeScales like 18-20 it will stop between 
waypoints.

I'm starting to think it could be a timing issue with the button clicks 
happening right when it hits a waypoint or something that would make it hard to 
duplicate and only happen sometimes.

It almost always happens towards the end of the path though at waypoint 98 or 
higher. Is there something that could adjust or refactor the duration after the 
waypoints have been set?

Original comment by enigma...@gmail.com on 14 Jul 2012 at 5:11

GoogleCodeExporter commented 9 years ago
No, there is nothing that can change the "real" duration after the tween has 
been set (apart the new UsePartialPath method, which is not in the version 
you're using). Mhmm I will try tomorrow to build a project with buttons, as you 
mentioned. As of now, I "tween" the timescale onward and backwards while the 
path is running. Maybe that will help.

Original comment by daniele....@gmail.com on 14 Jul 2012 at 7:24

GoogleCodeExporter commented 9 years ago
Update. The last few times onComplete finished prematurely happened on a 
waypoint. The timeScale was between 10.3 and 11.7 and the loop number was 
between 6 and 9.

I'm not sure if this helps but until I can get you sample code I thought this 
might be useful information.

Original comment by enigma...@gmail.com on 16 Jul 2012 at 8:51

GoogleCodeExporter commented 9 years ago
Latest with a little more information.

I have logs that trigger onComplete and when an object reaching a waypoint. 
This is a larger path with 400 waypoints.

Object reaches waypoint 349 at 0.01656641 TimeScale: 10.25001
Object reaches waypoint 350 at 0.01656672 TimeScale: 10.25001
Object reaches the end position 1332.812 at 0.01656672 TimeScale: 10.25001

This waypoint shares the same position as the starting waypoint. It seems to 
trigger onComplete more often when it reaches any waypoint that shares the same 
location as the first one. Although it has stopped on other waypoints.

I'm going to try moving this waypoint by a fraction and see if that help.

Original comment by enigma...@gmail.com on 17 Jul 2012 at 3:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hey thanks a lot for the latest infos. And sorry if I'm being kind of 
unresponsive, but these days are being a mess.
I made many other tests and the tween always completes at the exact ending 
waypoint. We are talking about *OnComplete*, and not *OnStepComplete*, right? 
OnStepComplete usually doesn't coincide with the last value of a tween (unless 
it's the last loop), but with a "further" one (which depending on the loop type 
can be a value near the end one or near the starting one), because HOTween uses 
"precise increments", meaning that it doesn't simply stop and restarts when a 
loop completes, but precisely calculates where the value should be according to 
the elapsed time (this is actually a feature, which allows HOTween to run with 
almost perfect timing and motion).
If so, I'm starting to think this might be somehow related to Simple Waypoint 
System. If/when you have time, could you send me a small package with a sample 
scene with all those waypoints and SWS implemented? Even if it doesn't 
reproduce the bug, it will be a different starting point for me, and I will see 
exactly how the loop and the waypoints are set.

Original comment by daniele....@gmail.com on 18 Jul 2012 at 1:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Might've found the issue. I talked to Baroni yesterday (who mentioned this 
issue too), and it actually seems to be related to SWS (though neither Baroni 
nor I could understand the reason), and to the fact that it re-creates the 
tweens at some determined positions. Baroni is working on a new release which 
avoids this bug and implements the new HOTween "partial path" option.

BTW, yesterday I managed to see this issue in a project Baroni sent me, which 
contained an older version of SWS. While instead everything seemed to run well 
on your sample (even after many minutes, and also when I started playing with 
speed). I'm not sure which version of SWS I have, but maybe Baroni already 
released something that fixes this?

Original comment by daniele....@gmail.com on 19 Jul 2012 at 4:28

GoogleCodeExporter commented 9 years ago
It doesn't happen 100% of the time. You may have to run it 4-5 times in order 
to see it complete early. I have the latest version of SWS that is submitted to 
the Unity Asset Store.

Original comment by enigma...@gmail.com on 19 Jul 2012 at 6:36

GoogleCodeExporter commented 9 years ago
I had it run a lot without anything happening. Maybe I have an older version of 
SWS without this issue? I'll try again later. Anyway, I marked this as a 
non-HOTween issue, so I guess it's up to the new SWS now :)
I asked Baroni, and he told me he's in contact with you about the new SWS 
release, so this will be solved soon.

Original comment by daniele....@gmail.com on 20 Jul 2012 at 9:29