Scoring

At the end of each level, the game will calculate a score based on how the player performed in the level. There are 3 factors which affect the player's score:

* The amount of gems collected,
* the time it took to finish the level,
* and the amount of challenge coins collected.

## Tips on getting S+ rank

* Collect enough gems to purchase the "Gem Magnet" upgrade from the shop and equip it. When playing a level with it equipped, make sure to at least pass close by a gem, as it'll be collected even without touching it.
	+ Additionally the "Double Gems" upgrade can also be purchased and put in the second upgrade slot to have a chance at getting twice the gems from each one. This works particularly well on the larger red gems if you're lucky.
* Collect all Challenge Coins on the S+ attempt. This might seem counterintuitive at first since it'll take longer to clear the level, however collecting the Challenge Coins will boost the score you get, even on recompletions.
	+ If a specific coin is too hard for you to collect consistently, it's best to skip it to avoid a lower time score.

## Scoring Relevant Level Information

To get parTime in milliseconds, multiply parTime by 1000.

## The Math

This part of the page will go over the math which the game uses to determine the player's score.

The game uses a math function called "clamp" which will force a number to go inbetween a certain range. An in-article example is: "clamp x between 0 and 1", meaning the number x changes into 1 if it's greater than 1, or into 0 if it's less than 0. (1,27 -> 1 and -0,52 -> 0)

### Gem Score

Relevant variables:

* t
o
t
a
l
G
e
m
s

{\textstyle totalGems}

 is the total amount of gems in the level
* g
e
m
s
C
o
l
l
e
c
t
e
d

{\textstyle gemsCollected}

 is the amount of gems collected by the player
* g
e
m
B
i
a
s

{\textstyle gemBias}

 is a given level's "gemBias" (See table above)
* g
e
m
B
o
n
u
# s
t
o
t
a
l
G
e
m
s
∗
0.9

{\displaystyle gemBonus=totalGems\*0.9}

To start off, if

t
o
t
a
l
G
e
m
s

{\textstyle totalGems}

 is 0, then

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 will return 0 and everything beyond this will be ignored.

An initial

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 is given with:

g
e
m
s
C
o
l
l
e
c
t
e
d

t
o
t
a
l
G
e
m
s

{\textstyle {\frac {gemsCollected}{totalGems}}}

,
afterwards

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 is clamped between 0 and 1.

Then

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 is divided by

g
e
m
B
i
a
s

{\textstyle gemBias}

.

If

g
e
m
s
C
o
l
l
e
c
t
e
d
>=
g
e
m
B
o
n
u
s

{\textstyle gemsCollected>=gemBonus}

 then

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 is increased by 0,1.

A temporary variable

# i
g
e
m
B
o
n
u
s
1

{\textstyle i=gemBonus+1}

 is decleared, and while

i
<
g
e
m
s
C
o
l
l
e
c
t
e
d

{\textstyle i<gemsCollected}

,

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 will be increased by 0,0125 and

i

{\textstyle i}

 will increase by 1.

Finally,

g
e
m
S
c
o
r
e

{\textstyle gemScore}

 is clamped between 0 and 1,25

### Time Score

The Time Score is relatively easier to calculate than the other two.

Relevant variables:

* t
i
m
e
T
o
B
e
a
# t
p
a
r
T
i
m
e
∗
2

{\displaystyle timeToBeat=parTime\*2}

 (Find parTime from the table above)
* t
i
m
e

{\textstyle time}

 is the time it took to complete the level
* t
i
m
e
B
i
a
s

{\textstyle timeBias}

 is a given level's "timeBias" (See table above)

t
i
m
e
T
o
B
e
a
t

{\textstyle timeToBeat}

 and

t
i
m
e

{\textstyle time}

 must be converted into milliseconds.

The resulting score can be calculated using the following formula:

t
i
m
e
S
c
o
r
# e
t
i
m
e
T
o
B
e
a
t

/

t
i
m
e

/

t
i
m
e
B
i
a
s

{\displaystyle timeScore=timeToBeat/time/timeBias}

### Challenge Coin Score

Relevant variables:

* t
o
t
a
l
C
o
i
n
s

{\textstyle totalCoins}

 is a given level's "# of Coins" (See table above)
* c
o
i
n
s
C
o
l
l
e
c
t
e
d

{\textstyle coinsCollected}

 is the amount of coins collected by the player
* c
o
i
n
W
e
i
g
h
t

{\textstyle coinWeight}

 is a given level's "coinWeight" (See table above)
* c
o
i
n
B
i
a
s

{\textstyle coinBias}

 is a given level's "coinBias" (See table above)
* t
i
m
e
W
e
i
g
h
t

{\textstyle timeWeight}

 is a given level's "timeWeight" (See table above)

To start off, if

t
o
t
a
l
C
o
i
n
s

{\textstyle totalCoins}

 is 0, then

c
o
i
n
S
c
o
r
e

{\textstyle coinScore}

 and

c
o
i
n
W
e
i
g
h
t

{\textstyle coinWeight}

 will both return 0 and everything beyond this will be ignored.

A coin score is given:

c
o
i
n
S
c
o
r
# e
c
o
i
n
s
C
o
l
l
e
c
t
e
d

/

t
o
t
a
l
C
o
i
n
s

/

c
o
i
n
B
i
a
s

{\textstyle coinScore=coinsCollected/totalCoins/coinBias}

Finally if

c
o
i
n
s
C
o
l
l
e
c
t
e
d

{\textstyle coinsCollected}

 equals

t
o
t
a
l
C
o
i
n
s

{\textstyle totalCoins}

,

c
o
i
n
S
c
o
r
e

{\textstyle coinScore}

 is multiplied by 1,25.

### Final Score

By now you should have

g
e
m
S
c
o
r
e

{\textstyle gemScore}

,

t
i
m
e
S
c
o
r
e

{\textstyle timeScore}

 and

c
o
i
n
S
c
o
r
e

{\textstyle coinScore}

 calculated from the three sections above this one.

Various variables from the previous calculations may be needed for this, in addition the new relevant variables are:

* g
e
m
W
e
i
g
h
t

{\textstyle gemWeight}

 is a given level's "gemWeight" (See table above)
* t
o
t
a
l
W
e
i
g
h
t

{\textstyle totalWeight}

 which will remain as 0 for now.

If

t
i
m
e

{\textstyle time}

 is less than

t
i
m
e
T
o
B
e
a
t

{\textstyle timeToBeat}

 then a few things will be changed:

* g
e
m
W
e
i
g
h
t

{\textstyle gemWeight}

 is decreased as such:

g
e
m
W
e
i
g
h
t
−
t
i
m
e

/

t
i
m
e
T
o
B
e
a
t
∗
t
i
m
e
W
e
i
g
h
t

{\textstyle gemWeight-time/timeToBeat\*timeWeight}

 and then clamped between 0 and 1,25.
* c
o
i
n
W
e
i
g
h
t

{\textstyle coinWeight}

 is set to be the same as

g
e
m
W
e
i
g
h
t

{\textstyle gemWeight}

Then

t
o
t
a
l
W
e
i
g
h
t

{\textstyle totalWeight}

 is set as such:

t
o
t
a
l
W
e
i
g
h
# t
g
e
m
W
e
i
g
h
t
t
i
m
e
W
e
i
g
h
t
c
o
i
n
W
e
i
g
h
t

{\textstyle totalWeight=gemWeight+timeWeight+coinWeight}

Now, the

t
o
t
a
l
S
c
o
r
e

{\textstyle totalScore}

 is calculated using the following formula:

t
o
t
a
l
S
c
o
r
e

g
e
m
S
c
o
r
e
∗
g
e
m
W
e
i
g
h
t
c
o
i
n
S
c
o
r
e
∗
c
o
i
n
W
e
i
g
h
t
t
i
m
e
S
c
o
r
e
∗
t
i
m
e
W
e
i
g
h
t

t
o
t
a
l
W
e
i
g
h
t

∗
2500

{\displaystyle totalScore{\frac {gemScore\*gemWeight+coinScore\*coinWeight+timeScore\*timeWeight}{totalWeight}}\*2500}

 after which

t
o
t
a
l
S
c
o
r
e

{\textstyle totalScore}

 is then clamped between 0 and 9999.

And finally

t
o
t
a
l
S
c
o
r
e

{\textstyle totalScore}

 is rounded to the nearest whole number to remove decimal numbers.

## References

1. ↑ Getting a score lower than 250 will still result in the F rank being given.
2. ↑ Information taken from the method `CalculateGemScore()` in `VibrantVenture.UI.EndCard.ScoreCalculator.cs`.
3. ↑ Information taken from the method `CalculateTimerScore()` in `VibrantVenture.UI.EndCard.ScoreCalculator.cs`.
4. ↑ Information taken from the method `CalculateCoinScore()` in `VibrantVenture.UI.EndCard.ScoreCalculator.cs`.
5. ↑ Information taken from the method `CalculateScore()` in `VibrantVenture.UI.EndCard.ScoreCalculator.cs`.