How Distance calculates cooldown percentage

This is something that I was curious about, as I wanted to make a graph detailing the eV to cooldown percent conversion. I was initially planning to go about this by getting various eV scores in game and keeping track of their percentage values - however, as you can imagine, this would be time-consuming, not very interesting, and - a feeling I had deep down since starting this brief project - might not tell the full story. So I decided to look and see if I could figure out exactly how it works. If you happen to also be curious - which, let's face it, if you're here, you probably are - here's how it works.

Trick Points vs eV

Something to note off the bat is that eV is actually a higher level value - it is not what the game uses to calculate cooldown directly. Instead, it uses a value that I will be referring to as Trick Points (TP) for the purposes of this document. This isn't too important, but there is a specific occurence where this does actually matter, which I'll get to later.

Now, this might be one of the less interesting sections, as I haven't actually looked into how TP is calculated completly - I was only interested in the cooldown formula for now. There's a few values used to calculate TP:

First, there is a float value that... I don't really know what it does, I haven't checked. Its value is the return value of a method that will always return 1 outside of Stunt, so I decided to ignore it for now. If I had to take a guess, I think this might be what handles the stale-trick preventation in Stunt mode, but that's pure speculation on my part. For the purposes of this document, we'll call it wtf , just because.

outside of Stunt, so I decided to ignore it for now. If I had to take a guess, I think this might be what handles the stale-trick preventation in Stunt mode, but that's pure speculation on my part. For the purposes of this document, we'll call it , just because. The base value for TP is just the addition of what I'll call Base Trick Points (BTP). Apparently, the game keeps track of the accumulated points of rotation tricks, wall/ceiling ride tricks, and hold position tricks (aka nosestands) seperately. Seems kinda weird, but there's probably a good reason for it. The game simply adds these three values together to obtain the total base trick points (TBTP).

(float)TBTP * wtf * TotalCombo

eV score has a little calculation of its own, though it's very simple: eV is simply TP * 5 .



...Kinda. Actually, there is one additional adjustment to the eV value that TP does not reflect - Stunt mode's sloppy and clean landing modifiers. These x0.5 and x2 modifiers are only made to the eV score. As such, while sloppy and clean landings will affect your score in Stunt, they will not affect the amount of cooldown recieved. Yeah, I'll admit that buildup was a little dramatic, as this is the only difference that exists between eV and the underlying TP value, but given the topic of this article is specifically about the cooldown calcuation, I figure it's worth noting.

Now for the cooldown itself

There are some base initial values used in order to calculate the cooldown percentage:

The int values minCooldownPoints and maxCooldownPoints , which are set to 50 and 300 respectively. These define the lower and upper TP bounds of the cooldown scale.

and , which are set to 50 and 300 respectively. These define the lower and upper TP bounds of the cooldown scale. The float values minCooldown and maxCooldown, which are set to 0.5 and 1.0.

First, your TP scored is converted into the linear parameter t via Unity's InverseLerp method: Mathf.InverseLerp(minCooldownPoints, maxCooldownPoints, TP) . This value is a float between 0 and 1, showing what TP equals as a percentage in the range 50 to 300.

via Unity's InverseLerp method: . This value is a float between 0 and 1, showing what equals as a percentage in the range 50 to 300. Following this, the cooldown percentage itself is a simple linear interpolation between minCooldown and maxCooldown, using the aformetioned t as the amount.

Interestingly, though, the rounding behaviour when the game displays the percentage in-game seems a little... off. The math doesn't look wrong - the calculation is simply cooldown * 100 cast to an int, so it should display properly, but... it doesn't, for some reason. As an example, the game shows 275 eV as providing a 50% cooldown. However, the raw cooldown float is 0.51 , so it actually gives 51% cooldown - the game just doesn't display it properly! I've been unable to reproduce this behaviour using the C# Interactive Prompt, so I assume this may be some kind of error in the way Mono, the .NET implementation that Unity uses, rounds floats to ints during casting.

Either way, that's all I have to say on this... and I must apologise for the probably shoddy and impossible to understand writing here, as I've been writing this for at least an hour straight, and it's nearly midnight... but I wanted to get this out today, so I can't be bothered to do much editing. Yeah, I'm gonna go to bed now. Peace.

Last updated: 2018-09-04 (minor text fixes)

Originally posted: 2018-08-31