0
\$\begingroup\$

In my game I am solving a problem, and I am getting certain points for each problem. Just like collecting numbers falling from the top.

Now I want to calculate a high score on the basis of two items i.e. solved points and time it took to solve until the user get it wrong.

How would I rank any player based on the two events?

\$\endgroup\$
  • \$\begingroup\$ Presumably you tried doing something simple like multiplying the solved points and the time by a weighting coefficient each, then adding the results together? Is there something you find unsatisfactory about that simple approach that we can help you improve upon? Also, are you really using the deprecated language unityscript, that has not been supported in Unity for several years now? \$\endgroup\$ – DMGregory Jan 6 at 18:15
  • \$\begingroup\$ In my game, 1st it was how much time player can survive and 2nd way to collect points was the same as collecting coins for which the player will be awarded 1 or 2 points depending upon different objects. Now on leaderboard either can be max time survived or total coins collected. I want to know how I can calculate high score by combining both. \$\endgroup\$ – Ravi Pal Jan 7 at 4:50
  • \$\begingroup\$ Would any of these do the trick: (total points) = (1st way) + (2nd way) or (total points) = (1st way) * (2nd way)? \$\endgroup\$ – Filip Milovanović Jan 7 at 5:34
  • \$\begingroup\$ If both ways units were some like int points then I can add or multiple. But 1 way is time unit and 2nd way is int points. Has anyone noticed how high score is calculated in games like - Subway Surfer, Temple Run. \$\endgroup\$ – Ravi Pal Jan 7 at 5:39
  • 1
    \$\begingroup\$ Honestly there are many approaches you can take to solve this and the solution you pick depends on how high of a number and how precise you want your scores to be (for example is 1,000,000 points normal or is it just 0% to 100%). Usually what I do is something like float pointsPerSecond = 1.0f; float pointsPerCoin = 10.0f; int finalScore = (int)(survivalTimeInSeconds * pointsPerSecond) + (int)(coinsCollected * pointsPerCoin); It's a simple formula and should help you keep your scores in a predictable range without limiting the max score. \$\endgroup\$ – Benjamin Danger Johnson Jan 7 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.