0
\$\begingroup\$

I'm making a score system that will be based on several factors, how many collectibles you have obtained, how few hits you have taken, etc. I want to add in a multiplier based on how quickly the player manages to finish the game.

So far the only thing I've thought of is to have a maximum time, and to subtract the final time from that number. So as an example, say I set the maximum number to 300 seconds and somebody beat the game in 220 seconds, that would leave 80. This could be divided into a smaller number and then used as a multiplier on the total score.

It works but feels a little limited. What would be a better way to achieve this?

\$\endgroup\$
2
  • \$\begingroup\$ Can you describe the specific way in which this feels "limited" to you? In what way would you like to see this improved? \$\endgroup\$
    – DMGregory
    Commented Nov 24, 2018 at 8:21
  • \$\begingroup\$ Well I'm just not a huge fan of this dependency on another arbitrary number really. It feels like there's a more clever way to mathematically achieve this. I suppose I may be wrong but I just wanted to hear some other thoughts on it. \$\endgroup\$ Commented Nov 24, 2018 at 8:34

2 Answers 2

1
\$\begingroup\$

So it sounds like you want an equation that starts at a large number where t = 0, and approaches 1 as t approaches infinity, yes? For example it would be a multiplier of 10 if they complete the level in 0 seconds, and a multiplier of 1 if they complete the level in infinity seconds. Here’s a starting point:

$$\frac{9}{100 ^ {t/300}} + 1$$

Where t is the amount of time taken, 9 is 1 less than the maximum multiplier (10 in this case), and 100 and 300 can be tuned to adjust how quickly the multiplier approaches 1. With 100 and 300, the multiplier moves down from 10 to 2 at about 150 time units, and is very close to 1 at 300 time units.

\$\endgroup\$
1
\$\begingroup\$

You can use this formula:

$$\frac{t_{half}}{t_{half} + t} \cdot {x}$$

If t = 0, score equals to x, the maximum score.
If t = thalf, score equals to half of x.
If t goes to infinity, score goes to 0.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .