User Tag List

Results 1 to 5 of 5

Thread: please help me understand this bizarre bug involving ini++ and easing object

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,274
    Mentioned
    90 Post(s)
    Tagged
    0 Thread(s)

    please help me understand this bizarre bug involving ini++ and easing object

    I've spent half a day hunting a bug. Usually if I'm systematic enough I can isolate the problem and find and understand the culprit (usually PEBKAC, naturally). This time though, I've isolated the bug as much as I can, but I'm still really confused. I'm not even 100% if it's a bug, though it's weird, whatever it is. Partly because it seems to rely on at least 3 different factors, any two of which seem to cause no problems on their own until the addition of the third.

    I suppose the practical upshot of it is simple: don't omit items in INI groups. But because the circumstances to produce this bug seem so specific and so peculiar it's hard to know what's really going on, and it makes me wonder how else (if at all) similar bugs might surface. I'd be really grateful if @Yves or @Anders or some other person smarter than me could help me understand what's happening so I can try and stay clear of any such trouble in the future. It's hard to explain what the bug is, but I'll do my best. I've attached an MFA that shows it as clearly as I could muster. In a nutshell, it seems that:

    if you try use the Ini++ object to set an altVal to the value of a non-existent item in an INI file, Fusion will just make the altVal zero.....except if you are using Anders' Easing Object and you reference that altVal in your easing parameters and you happen to use a certain combination of other numbers and/or operators in those parameters then - though Fusion will still claim that the altVal is 0 - the easing object will end up making unexpected calculations that wildly misposition the object. In the attached MFA, you can see that when an object is told to ease to [altVal+0] it moves to X=0, but when it is told to ease to [altVal+1] it moves about a billion (!) pixels too far.

    So, obviously a part of the problem is that you shouldn't try and read information from an INI by referencing an item that isn't in there. I thought you could, but I was obviously wrong. That part's easy. But something else seems to be not quite right here in a number of places. A bunch of questions spring to mind:

    -Perhaps it's INI++'s fault for not converting [non-existent value] into a plain 0? But perhaps that's not INI++'s responsibility?
    -But the easing object never spoke to INI++ directly. It got the [non-existent value] from Fusion via an altVal, which got it from INI++. So at what point did this weird phantom [zero that doesn't seem to be a zero] materialise? INI++? in the altVal? In Easing Object? A combination?
    -When Fusion got the [non-existent value] from INI++, it claimed to output 0. You can see in the MFA that the altVals in question are all, according to the string object, 0. Yet Fusion clearly passed on [something not quite the same as 0] to the easing object. Could Fusion perhaps be patched to forcibly clean up a [something not quite the same as 0] and store it as a 'pure zero' in the future?
    -What is the [something not quite the same as 0] that Fusion gave to the easing object, and why did the easing object do such strange things with it...but only when other simple numbers in the equation were changed?
    -Why does this crap always happen to me?
    Attached files Attached files

  2. #2
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    106
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I just got a similiar issue with magic deque yesterday.
    In my project, before one unit's turn start, there is a routine that iterates through all units, uses their "speed" to fill theirs action bar, and continues to loop untill one unit's action bar value has exceed the action threshold.
    Units' ID and action bar value are storaged in a magic deque, and the deque is sorted each time when the bar is updated. it works fine if I erase everything and push value per loop, but if I intialize the deque before loops, then use "change value at element array" to update values, first time everything works properly, but when I end my turn and start another calculation, I get one unit's action bar value at about one billion(and the numbers start from 114…) in deque while the value in this unit's alterable value is correct.
    As we all meet a issue like that, I presume it might because when it tries to retrieve an value, fusion passed it incorrectly, just like trying to read a value via a dangling pointer in cpp.
    (But I get the same value everytime, even after restarting fusion,so it couldn't have something to do with pointers.)

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    110
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Must be storing as a float in the alt value 0.0 If you convert it to an Int when reading the values from the INI it works

    If you set Freds value to 0.0 in the INI without converting it will produce the same error..

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,274
    Mentioned
    90 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fnkycoldmadeanr View Post
    Must be storing as a float in the alt value 0.0 If you convert it to an Int when reading the values from the INI it works

    If you set Freds value to 0.5 in the INI without converting it will produce the same error..
    You know, I actually was wondering at one stage whether it was a case of 0 becoming 0.0, but for some reason it didn't occur to me to actually test it, and then the thought passed. Thanks a million, fnkycoldmadeanr! This all seemed so mysterious to me and was spinning my head, and now you've shown it to be dead simple I'm going to put INT() around the values I import from INIs as a habit, to safeguard against this idiosyncracy. Cheers!

    @ Clickteam and/or @Anders : perhaps the easing object could be updated to ignore floats for certain functions, since it doesn't seem to like them?

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    110
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    https://github.com/Andos/Easing
    Hopefully just a case of putting int around the inputs but I don't know much about cpp

Similar Threads

  1. Replies: 3
    Last Post: 29th September 2019, 06:45 PM
  2. Replies: 13
    Last Post: 30th December 2015, 04:04 PM
  3. Easing Object with Trigonometry
    By yuigoto in forum Fusion 2.5
    Replies: 4
    Last Post: 17th December 2015, 06:59 PM
  4. Easing Object Android bug?
    By Outcast in forum Android Export Module 2.5
    Replies: 4
    Last Post: 8th March 2014, 10:54 PM
  5. [bug] Easing Object
    By StingRay in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th September 2013, 09:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •