jleonard2099 / LHG_CollegeBB

Lance Haffner Courtside College Basketball
GNU Affero General Public License v3.0
6 stars 0 forks source link

Some team ratings stored as 100-x rather than as negative integer #16

Open jleonard2099 opened 1 year ago

jleonard2099 commented 1 year ago

When viewing teams, ratings that should range in negative values are showing only as positives.

For example, Def 3FGA% Adj is supposed to range from -5 to 5.

In the team view below, you can see values in the 90's.

2023-01-24 18_49_49-Courtside College Basketball - Change Team

jleonard2099 commented 1 year ago

After initial investigation, the following things have been discovered:

You can see if the value is negative (<0), it is stored as a positive integer by adding 100 to it. Therefore, -5 becomes 95, etc.

The manual states this value should range from -5 to 5.

In order to determine whether this is anything to be concerned about, we need to determine how these values are handled by the game EXE. Is it able to operate with both (either explicit negatives or 95+ ? ) Or does it operate one way?

From there we can then make a decision of how to handle the team view / edit routines. For example, do all team files need updated immediately to store - numbers? Does the manual need updated? etc.

jleonard2099 commented 1 year ago
The ratings that are treated in this way have been identified as follows: Rating Variable Posn in Data File
DEF FG ADJ defFGPctAdj% 2
DEF 3FG% ADJ V1% 3
DEF 3FGA/FGA ADJ V2% 4
DEF TO ADJ L%(2) 7
DEF FOUL ADJ L%(3) 8
jleonard2099 commented 1 year ago

Based on the relevant game code below in COLHOOP.BAS, it appears the game will subtract 100 for values over 20 (none of the ratings should be above 10).

This means, whether stored as a negative or in the 90s, the game will get the right value to use.

    F5%(P9, 2) = V1%(P9)
    If F5%(P9, 2) > 20 Then F5%(P9, 2) = F5%(P9, 2) - 100

    F5%(P9, 3) = V2%(P9)
    If F5%(P9, 3) > 20 Then F5%(P9, 3) = F5%(P9, 3) - 100

    F5%(P9, 6) = L%(P9, 2)
    If F5%(P9, 6) > 20 Then F5%(P9, 6) = F5%(P9, 6) - 100

    F5%(P9, 7) = L%(P9, 3)
    If F5%(P9, 7) > 20 Then F5%(P9, 7) = F5%(P9, 7) - 100

At this point, it is only worth discussing pros and cons of this approach, vs. simply saving the values as negative (-) and displaying them as negative (-). The convention of adding 100, only to take it away, seems to only be a source of confusion and inaccuracy with the team display.

The immediate "fix" would be for the team display to be updated to look for values > 20 to do the relevant subtraction.