User Tag List

Results 1 to 8 of 8

Thread: curve maths (depreciating gain) and custom timer

  1. #1
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    curve maths (depreciating gain) and custom timer

    Hi,

    I want to have a counter that increases/decreases it's speed based on the value of another counter. I'm using a custom timer to achieve this.

    So far I have a working example but I would like a gentler curve for the increase. Right now (I think) it's exponential but I would like something like a quadratic or sin movement (without the downturn) so that it never hits a wall but the speed increases quite a bit (but not as much as I have it now) at the start then gradually increases less and less as the counter goes up.

    I'm trying to make a game where the player stats are unlimited but the gain from them decreases as they add more (to infinity). Also the higher a certain stat the faster points can be accumulated.

    Another issue is that the custom timer is a little jerky at lower speeds, any idea why? Would this be fixed by a better equation?

    My maths is awful so I would greatly appreciate any help here.

    Cheers!


    Example:

    countspeed.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try Atan() for a curve that starts off steep and levels off.

    I personally like hyperbolic tangent, but it's not worth putting into MMF2.

  3. #3
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Thanks Eliyahu but I have no idea how to implement this. Again, my maths is terrible and I spent over 2 hours trying to figure out the exponential one (if that's even what I have going).

    If you could show me how to do this for stats/custom timer I would be most grateful.

  4. #4
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Atan(value(counter) only gives me values from 45-89. How do I use this? Can I set a range (like - operate on a scale btw 1-100 or 1000?)

    Help!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS 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)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the mfa btw! I was looking for a way to measure distance in my endless runner game mode

  6. #6
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    No probs RhysD.

    Can anyone help with the question?

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    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)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SolarB - Atan stands for arctangent, a trigonometry function that returns an angle. It's the opposite of the Tangent function (Tan) which takes an angle and returns a value that is the ratio of 2 sides of a right angled triangle. you can find out more here: http://en.wikipedia.org/wiki/Trigonometry

    If you give it values from 1-infinity, it will return values from 45-90 degrees. This is because Tan(45)=1 and Tan(90)=infinity (Tan(0)=0 by the way, and anything from 0-44 will give you a value <1)

    To convert this into another range, first find the difference in your original range using (90-45=45.0) - we'll divide by this value to get a range from 0-1
    Now we multiply by the desired range, eg (100-1=99), and add the desired lower range, eg 1

    So to get a range of 1-100 from a counter that goes from 1-infinity, use:
    99*((Atan(value(counter)-45)/45.0)+1

    If you want a range from 3-1000 use:
    997*((Atan(value(counter)-45)/45.0)+3

    I used 45.0 to make sure that MMF2 uses floating point maths, rather than integer maths, so I can have decimal values like 0.01, 0.234, etc. rather than just whole numbers like 1, 2, 3 etc.

    (BTW I haven't checked these in MMF2, but they should work )

  8. #8
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ayre, but it still gave me some weird values so I changed it to ATan(value( "Counter" )/45.0) and for some reason it worked (Increments big from 1 then slows down approaching 100).

Similar Threads

  1. How do you Create a Global Timer as a Countdown Timer
    By redpandagames in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 23rd February 2017, 10:08 AM
  2. Guidance on a custom countdown timer
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 25th June 2011, 06:20 AM
  3. Help with a custom timer
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 22nd July 2009, 03:06 AM
  4. Mouvement plateforme custom basé sur le timer
    By Olivier in forum Multimedia Fusion 2 - Technical Support
    Replies: 23
    Last Post: 27th October 2008, 01:33 PM
  5. Mouvement plateforme custom basé sur le timer
    By Olivier in forum File Archive
    Replies: 0
    Last Post: 26th October 2008, 03:26 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
  •