Hello!
I make mostly Skill Games and I have run into a slight bug/inconvenience. When the variable data source, or any other data source that can Exponentially Interpolate is set to do so with an Interpolation speed of less than 40, the variable data source never actually reaches its destined value, only very close to it.
For those who don't know, exponential interpolation is the gradual change of a number to a destined number, based off the difference between them. The common example of this is the "approaching the door" problem from Math class. Walking halfway the distance between yourself and the door, and then recalculating the distance, one can never reach the door because there is always some distance between you and the door. That is the simplest example. Below is what I assume Exponential Interpolation to be in the Trials source code...
With the method above technically "value" never reaches "destination", as there will always be a difference. I assumed though that RedLynx added a fail safe to Interpolation so that eventually, even if it takes a while, value will equal the destined value. For Interpolation Speeds above 40 this seems to be the answer, but not for those not below it. To demonstrate this get a variable data source, set it to 1, and give it Exponential Interpolation with Interpolation speed set to 10. Then using an Impulse Trigger and a Set Value event, make the Set Value event set the Data Source to 0. Finally attach a generic filter to the Data Source, checking to see if it reaches 0 (Example: Data Source == 0). If you then test the toolcards, and wait you will notice that the data source never actually reaches zero. Now I understand that even though Data Sources only show two decimal places, many more exist. But even with some clever extraction of the hidden decimals, I found the Data Source to still get hung up. For me, the data source stopped Interpolating at the number 1/2^48, suggesting it reached its decimal limit. So why not reach 0? I can imagine a simple solution to the problem in that...Code://These are variables I assume are used in interpolation, speed is from 1-100 double destination, speed, value; //The value is increased by the difference divided by the (101-speed) value = value+(destination-value)/(101-speed);
I don't know why this bug exist, and I can work around it pretty easy, but it still perplexes me. It has existed since Evolution, and was just wondering about it.Code:double destination, speed, value; //The value is increased by the difference divided by the (101-speed), ONLY if the difference is greater than .000001 if (abs(destination-value) > .000001)value = value+(destination-value)/(101-speed);elsevalue = destination;
Hope someone knows the answer!
-pneumaticbog484
Most numbers are left as is, as getting perfectly round floats is not necessary for general purpose editor use. The five advanced users, who know what it's all about, could use custom interpolation and rounding methods instead. And even for me this has been a problem only once and I got around it by adding two more tiles.
Thanks Mutetus! That rounding method solves all my problems. I can't beleive I didn't see that sooner... I think about things too much. I am still puzzled as to why it sometimes reaches its destination value and sometimes it doesn't. I was also wondering what Active Objects means in the Statistics Overview. I seem to max out that value consistently. So what does it actually represent? I assume it's objects that have physics and/or are moved by OBE.
I appreciate your feedback sparkierjonesz! And I've attempted to use curve data sources, but I have multiple data sources that I want to smoothly feed into a single data source to then use in a big math equation. Plus, sometimes the value just sits at a number, not interpolating so getting the curve data sources to time correctly would of been hard. In the end a multitude of curve data sources can't beat a single interpolation for me. But I am considering feeding in curve data sources as that would look smooth (all of these "smooth" values are used for animation that is really close to the camera, that's why I need them smooth and precise).
The reason I posted this question in the first place was because I simply needed to check my one data source to see if it equaled zero, but it never did.
Thanks again for the quick response you guys!
-pneumaticbog484
PS- I recently discovered the Xrotto statue inthe city. Great detailing on the rider; awesome job from the modeling team! I will definetly be using it in future maps.