Results 1 to 6 of 6

Math Help - Creating an equation

  1. #1
    RJS
    RJS is offline
    Newbie
    Joined
    Mar 2010
    Posts
    4

    Creating an equation

    Hey,

    I'm creating a game whereby a user reaches different levels. Starting at level 1 and working up as they gain "experience".

    I'm using graph software to work out a good equation that increases the users level at a steady rate.

    what i currently have is pretty bad "(x+10)^4 - 500" x being the users level. and using the graph software i can predict what y (their experience) needs to be in order for that user to level up.

    The current equation is far too steep, i need something that starts off easy and gets slightly harder after each level up..

    Any suggestions, help, links as to how i can achieve this would be greatly appreciated.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    -1
    e^(i*pi)'s Avatar
    Joined
    Feb 2009
    From
    West Midlands, England
    Posts
    3,053
    Thanks
    1

    Re: Creating an equation

    You could use a geometric series, for example say that to get from level n to level n+1 will be r times more than it takes to get from level n-1 to n.

    In equation form it would be u_n = ar^{n-1}. You can pick a suitable value for a (the starting value) and for r.

    For example if a = 100 and r=1.2 you'd need u_3 = 100 \cdot 1.2^2 = 144 (total) experience points to reach level 3 and u_{10} = 100 \cdot 1.2^{10} \approx 620 (total) experience points to reach level 10.

    To get from level 1 to level 2 would require u_2 - u_1 = 120 - 100 = 20 exp but to go from level 8 to 9 would need u_9-u_8 = 515 - 430 = 85 exp points. Increase r to require more experience points to level up.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    RJS
    RJS is offline
    Newbie
    Joined
    Mar 2010
    Posts
    4

    Re: Creating an equation

    Hi e^(i*pi)

    I thank you for your detailed solution to my problem, however my poor math ability means i don't actually understand what you have written.

    If possible can you explain what each letter represents? and break the equation down so i can reproduce it in php code.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    -1
    e^(i*pi)'s Avatar
    Joined
    Feb 2009
    From
    West Midlands, England
    Posts
    3,053
    Thanks
    1

    Re: Creating an equation

    a is the first term of your equation. In terms of your experience points this is the amount required to get from level 0 to level 1.
    r is the common ratio. For your purposes this is akin to the growth rate between levels
    n is the number of levels
    u_n is the amount of experience needed to get to level n

    For the purposes of your game a and r can be arbitrarily defined by you depending on how you want the results to pan out.

    The equation to give the total amount of experience from level 1 to level n is u_n = a \times r^{n-1} with the definitions above.

    If you want to find out the experience needed between two levels (let's call them p and q) then you have u_q - u_p = ar^{q-1} - ar^{p-1} = a(r^{q-1} - r^{p-1})

    Spoiler:
    You can use exponent laws to simplify that to ar^{-1}(r^q - r^p) but it's probably unnecessary


    ------------------------------------------------------------------------------------------------------------

    Another way to approach the question is to use an exponential relationship.

    y = Ae^{kx}

    Where y is the experience needed, A is the initial experience needed, k is your growth constant and x the level required. In this example you can modify A and k.
    If this is too strong you can change the base of your exponent by making it something other than e - for example y = A \cdot 2^{kx} where the symbols are the same as above
    Last edited by e^(i*pi); July 7th 2011 at 03:25 AM. Reason: typo
    Follow Math Help Forum on Facebook and Google+

  5. #5
    RJS
    RJS is offline
    Newbie
    Joined
    Mar 2010
    Posts
    4

    Re: Creating an equation

    I cant seem to reproduce your examples in my graph software, using your example to go from level 1 to 3 i get the value 52.8383 not 144.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    -1
    e^(i*pi)'s Avatar
    Joined
    Feb 2009
    From
    West Midlands, England
    Posts
    3,053
    Thanks
    1

    Re: Creating an equation

    What equations did you use?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. creating arc
    Posted in the Geometry Forum
    Replies: 1
    Last Post: June 10th 2010, 10:36 AM
  2. Creating a Cubic Equation with Coordinates
    Posted in the Algebra Forum
    Replies: 8
    Last Post: April 19th 2010, 06:05 PM
  3. Creating an equation to model a curve
    Posted in the Statistics Forum
    Replies: 0
    Last Post: March 1st 2010, 05:19 PM
  4. help with creating differential equation..
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: January 24th 2009, 02:32 PM
  5. Replies: 3
    Last Post: August 10th 2008, 11:17 PM

Search Tags


/mathhelpforum @mathhelpforum