Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • time-based point system

    9 answers - 939 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I'm writing a game script and the point system will be based upon time.
    The less time there is between event one and event two, the higher
    score you'll get for event two. However, I've got a problem figuring
    how to do this. Here's why. I don't want the score system to just be
    a straight charted system. Y'know, like if the time is between x and y
    then the points you get are z. I want to mathematically figure out the
    pointage. That's what I can't figure out how to do. If it were such
    that the more time there is, the more points there are, that would be
    easy. I could just multiply the time by something or other. , if
    there was a time limit between the two events, that, too, would be easy
    because I could subtract the amount of time spent from the possible
    amount of time and multiply by something for points. Neither of these
    are the case. Any suggestions?
  • No.1 | | 1316 bytes | |

    Jay wrote:

    I'm writing a game script and the point system will be based upon time.
    The less time there is between event one and event two, the higher
    score you'll get for event two. However, I've got a problem figuring
    how to do this. Here's why. I don't want the score system to just be
    a straight charted system. Y'know, like if the time is between x and y
    then the points you get are z. I want to mathematically figure out the
    pointage. That's what I can't figure out how to do. If it were such
    that the more time there is, the more points there are, that would be
    easy. I could just multiply the time by something or other. , if
    there was a time limit between the two events, that, too, would be easy
    because I could subtract the amount of time spent from the possible
    amount of time and multiply by something for points. Neither of these
    are the case. Any suggestions?

    You haven't indicated what _is_ the case, so this question cannot yet be
    answered. You have to specify what the points measure, how they measure
    it, and how they change over time. you do that, you can define (or
    get help defining) how to calculate them. As it is you've not given
    nearly enough information to answer your question.
  • No.2 | | 1812 bytes | |

    , this is a game. So the points are abstract. It's like an arcade
    game in respect to the points. They don't actually mean or represent
    anything. The only point is to get a high score. The idea is that the
    faster the user acts (or reacts) the greater amount of points they'll
    receive. Simplified, I need a fuction or statement that takes in a
    small number and spits out a big number. The smaller the input, the
    larger the output.

    Erik Max Francis wrote:
    Jay wrote:

    I'm writing a game script and the point system will be based upon time.
    The less time there is between event one and event two, the higher
    score you'll get for event two. However, I've got a problem figuring
    how to do this. Here's why. I don't want the score system to just be
    a straight charted system. Y'know, like if the time is between x and y
    then the points you get are z. I want to mathematically figure out the
    pointage. That's what I can't figure out how to do. If it were such
    that the more time there is, the more points there are, that would be
    easy. I could just multiply the time by something or other. , if
    there was a time limit between the two events, that, too, would be easy
    because I could subtract the amount of time spent from the possible
    amount of time and multiply by something for points. Neither of these
    are the case. Any suggestions?

    You haven't indicated what _is_ the case, so this question cannot yet be
    answered. You have to specify what the points measure, how they measure
    it, and how they change over time. you do that, you can define (or
    get help defining) how to calculate them. As it is you've not given
    nearly enough information to answer your question.
  • No.3 | | 690 bytes | |

    Jay wrote:

    , this is a game. So the points are abstract. It's like an arcade
    game in respect to the points. They don't actually mean or represent
    anything. The only point is to get a high score. The idea is that the
    faster the user acts (or reacts) the greater amount of points they'll
    receive. Simplified, I need a fuction or statement that takes in a
    small number and spits out a big number. The smaller the input, the
    larger the output.

    There are any number of functions which fit this property, like f(x) =
    1/x. You'll have to define more clearly what properties of this
    negative function you want to narrow it down beyond that.
  • No.4 | | 1035 bytes | |

    That function is absolutely no good for this situation.

    1. Take a small number.
    5.4348809719085693

    2. Put it in the function.
    f(5.4348809719085693) = 1/5.4348809719085693

    3. Get a large number?
    0.18399666987533483

    That number is even smaller. I want a large one coming out.

    Erik Max Francis wrote:
    Jay wrote:

    , this is a game. So the points are abstract. It's like an arcade
    game in respect to the points. They don't actually mean or represent
    anything. The only point is to get a high score. The idea is that the
    faster the user acts (or reacts) the greater amount of points they'll
    receive. Simplified, I need a fuction or statement that takes in a
    small number and spits out a big number. The smaller the input, the
    larger the output.

    There are any number of functions which fit this property, like f(x) =
    1/x. You'll have to define more clearly what properties of this
    negative function you want to narrow it down beyond that.
  • No.5 | | 1796 bytes | |

    Jay wrote:

    That function is absolutely no good for this situation.

    1. Take a small number.
    5.4348809719085693

    2. Put it in the function.
    f(5.4348809719085693) = 1/5.4348809719085693

    3. Get a large number?
    0.18399666987533483

    That number is even smaller. I want a large one coming out.

    f(x) = 1/x is just one example of a function that has the property of
    being a "negative function" -- the smaller number you put in, the larger
    number you get out, and vice versa. Your statement didn't clearly
    indicate that the outputs need to be bigger than the inputs, just that
    they need to be bigger the smaller the outputs are. The more general
    function would be f(x) = A/(x - B). Choose A and B as desired so that
    f(x) x for all x you care about. choose another function, like
    f(x) = A - B x or any number of other functions. There literally are an
    infinite number of possibilities.

    The point is, as I've already said, you haven't given nearly enough
    information to give you a useful answer. You haven't indicated, for
    instance, anything at all about the domain or range of the function that
    you want: What values do you need to plug in? What range of values do
    you need to get out? you have clarified to yourself what
    properties you want, that will help you define the function.

    At this point you're the only one who knows what properties you want,
    and unless you define them up front, it results in a very unsatisfactory
    guessing game of proposing a function, you telling me what's wrong with
    it, and repeat until either or both of us get bored.

    And, by the way, this is a question about mathematics, and so has
    nothing to do specifically with Python.
  • No.6 | | 845 bytes | |

    At Thursday 14/9/2006 00:46, Jay wrote:

    >, this is a game. So the points are abstract. It's like an arcade
    >game in respect to the points. They don't actually mean or represent
    >anything. The only point is to get a high score. The idea is that the
    >faster the user acts (or reacts) the greater amount of points they'll
    >receive. Simplified, I need a fuction or statement that takes in a
    >small number and spits out a big number. The smaller the input, the
    >larger the output.


    1/x, or 1000/x, or 1000-x, or 1000*exp(-x) or
    All decline differently, play drawing them and choose whatever tastes you more.

    Gabriel Genellina
    Softlab SRL

    P R D
    Todo lo que saber, y lo que ni imaginabas,
    en Yahoo! Respuestas (Beta).
    Probalo ya!
  • No.7 | | 1988 bytes | |

    I'm sorry. I never considered what you said about the relationship
    about the input and output. I'll take my thread elsewhere to a math
    board.

    Erik Max Francis wrote:
    Jay wrote:

    That function is absolutely no good for this situation.

    1. Take a small number.
    5.4348809719085693

    2. Put it in the function.
    f(5.4348809719085693) = 1/5.4348809719085693

    3. Get a large number?
    0.18399666987533483

    That number is even smaller. I want a large one coming out.

    f(x) = 1/x is just one example of a function that has the property of
    being a "negative function" -- the smaller number you put in, the larger
    number you get out, and vice versa. Your statement didn't clearly
    indicate that the outputs need to be bigger than the inputs, just that
    they need to be bigger the smaller the outputs are. The more general
    function would be f(x) = A/(x - B). Choose A and B as desired so that
    f(x) x for all x you care about. choose another function, like
    f(x) = A - B x or any number of other functions. There literally are an
    infinite number of possibilities.

    The point is, as I've already said, you haven't given nearly enough
    information to give you a useful answer. You haven't indicated, for
    instance, anything at all about the domain or range of the function that
    you want: What values do you need to plug in? What range of values do
    you need to get out? you have clarified to yourself what
    properties you want, that will help you define the function.

    At this point you're the only one who knows what properties you want,
    and unless you define them up front, it results in a very unsatisfactory
    guessing game of proposing a function, you telling me what's wrong with
    it, and repeat until either or both of us get bored.

    And, by the way, this is a question about mathematics, and so has
    nothing to do specifically with Python.
  • No.8 | | 1082 bytes | |

    13 Sep 2006 21:03:35 -0700, "Jay" <jaysherby (AT) gmail (DOT) comdeclaimed the
    following in comp.lang.python:

    That function is absolutely no good for this situation.

    1. Take a small number.
    5.4348809719085693

    2. Put it in the function.
    f(5.4348809719085693) = 1/5.4348809719085693

    3. Get a large number?
    0.18399666987533483

    That number is even smaller. I want a large one coming out.

    Basically, you are going to have to define the condition that
    produces the maximum points, such that anything /beyond/ that reduces
    the maximum.

    Say the maximum points for step X are "10" Say you allow
    0.1seconds before points are lost. Then, how rapidly are points lost?

    def points(pmax, time, t0, t1):
    #pmax = maximum points
    #time = time duration taken
    #t0 = time allowed for maximum points
    #t1 = time at which zero points available
    slope = pmax / (t1 - t0)
    return max(0.0, pmax - (slope * max(0.0, (time - t0))))

    Then get fancy Maybe put in an exponential fall off, or
    logarithmic
  • No.9 | | 1086 bytes | |

    Jay wrote:

    That function is absolutely no good for this situation.

    1. Take a small number.
    5.4348809719085693

    2. Put it in the function.
    f(5.4348809719085693) = 1/5.4348809719085693

    3. Get a large number?
    0.18399666987533483

    That number is even smaller.**I*want*a*large*one*coming*out.

    Not satisfied with with the shrink-wrapped functions available at your local
    math-mart? Make your own from only a few data points:

    from __future__ import division
    import bisect

    def make_function(*points):
    """Finest built-to-order maths since Archimedes"""
    points = sorted(points)
    xvalues = [p[0] for p in points]

    def f(x):
    i = bisect.bisect(xvalues, x)
    if i == 0:
    i = 1
    if i >= len(xvalues):
    i = len(xvalues) - 1
    x0, y0 = points[i-1]
    x1, y1 = points[i]
    return (y1-y0)/(x1-x0)*(x-x0) + y0
    return f

    if __name__ == "__main__":
    f = make_function((0, 100000), (1, 100), (2, 10), (3, 1))
    for i in range(-1, 21):
    x = i / 10
    print x, "", f(x)

    Peter

Re: time-based point system


max 4000 letters.
Your nickname that display:
In order to stop the spam: 4 + 3 =
QUESTION ON "Development"

EMSDN.COM