Re-Volt-America / RVA

Website and backend of Re-Volt America
https://rva.lat
GNU Affero General Public License v3.0
14 stars 1 forks source link

Lap values aren't being rounded up at tracklists #106

Closed EstebanMz closed 1 month ago

EstebanMz commented 5 months ago

As I suggested the formula to calculate the amount of laps for a track based on an average lap time, I can compare the number of laps between the tracklist and my personal spreadsheet (which I'll index below). After playing an advanced class lobby we started to notice quickly there were many tracks that should have one more lap, and it's because the generator is truncating the calculated lap values. There's a funny example where Desolate District 1 has a value of 2.99 laps for advanced and you can tell how many laps showed up in the generator. Tracklist Generator RVA 2024-A.xlsx

BGMP commented 5 months ago

@EstebanMz How is this issue invalid? I don't understand

EstebanMz commented 5 months ago

@EstebanMz How is this issue invalid? I don't understand

It currently gives values one lap below the recommended for many tracks.

BGMP commented 5 months ago

@EstebanMz How is this issue invalid? I don't understand

It currently gives values one lap below the recommended for many tracks.

hm, okay let me clarify this. Issue labels are for issues. By labelling this issue as invalid, you're saying that your own issue is invalid. This would be best labelled as a bug imo

BGMP commented 5 months ago

Resolved by https://github.com/Re-Volt-America/RVA/commit/f0c7219517253782253b4d353aab4dbf326b5f81

EstebanMz commented 5 months ago

Unfortunately I have to reopen this issue because I've find out that this fix isn't being appiled if the class is Semi-Pro or Random. Yesterday, when I was doing some balance changes, I noticed already a couple of suggestions shouldn't be there if rounding had worked, today after I generated the tracklist for this week I could notice it only happen with Semi-Pro and Random classes. Maybe it has something to do that to calculate the laps for Random class it just takes the values for Semi-Pro.

BGMP commented 5 months ago

@EstebanMz Please be more clear as to what the problem is so that we can fix it.

The implementation was copied from the Excel formula schematics you provided so, unless there is another rounding problem or an issue with the constants, I don't understand where this is coming from.

See the relevant code below:

https://github.com/Re-Volt-America/RVA/blob/6179db0072d82c77bd49c4a926e37ad84f833cb6/app/models/track.rb#L27-L35

https://github.com/Re-Volt-America/RVA/blob/6179db0072d82c77bd49c4a926e37ad84f833cb6/config/application.rb#L123-L132

EstebanMz commented 5 months ago

You're right, it's a bug that doesn't make sense, the only thing I can see is that values for those classes are integers instead of decimals in the second document you referenced, perhaps 1.0 instead of 1 does a difference.

BGMP commented 2 months ago

@EstebanMz Is this still not working properly?

EstebanMz commented 2 months ago

No, it's still a bug. Could you try with changing CATEGORY::SEMI_PRO and CATEGORY::RANDOM to 0.99 or 1.00? I remember I did tests with my reference spreadsheet and 0.99 gave the same results than 1.0. I haven't generated the tracklist for this week, so I could test if it's fixed right after.

BGMP commented 1 month ago

@EstebanMz I have updated the constants to 1.0. My guess is that the number 1 was being treated as an integer and that it interferred with the calculations somehow. Let me know if this fixed anything next week when you generate the track lists

EstebanMz commented 1 month ago

You're right, it's a bug that doesn't make sense, the only thing I can see is that values for those classes are integers instead of decimals in the second document you referenced, perhaps 1.0 instead of 1 does a difference.

I was right 4 months ago 😭, and just in case I just tested it. The funniest part is that last night I took my excel and highlighted the tracks that I always had to fix their lap values lol.