Actually, I had hoped to start it out as a statistics program and then mold it into a manager/simulator program so it made sense to have a game making interface as opposed to a conventional utility interface that might be gotten from a proper competent programmer (there is only one other free stat program I know that has NBA stats, and that is Bball Sports SuperDB).
Problem is GameMaker is horrible for this kind of thing, but I'm sticking with it anyway. It's too far along now to go back, and I do not have the patience to learn everything anew in another program. I have created some complex (for my brain anyway) algorithms. Gamemaker doesn't provide many options for an interface for the presentation of data. It doesn't have easily available input boxes or menus, and the user created 'plug ins' are very game'ish.
This is what it looks like so far:
At the moment, it calculates splits based on individual game data just as a site like basketball-reference does. For instance, it has totals, totals per team if the player is traded, home totals, away totals, win totals and loss totals. I don't have splits for months like basketball-reference, instead what I have is a system of customizable days (the 3 input boxes at the top to the right of the name) where for instance you can set it to split the data up into every X number of days (bottom left of the trio of boxes), and days between played games for pre absence and post absence (bottom right).
This system only splits data this way if the data is sorted by date. If it is sorted by another column, such as minutes, it splits the data up into groups of that data. For instance, if 5 was inputed and points was sorted, it will split the data up into every 5 points. So if a player had a game of 50 points, then it will split the data up into 46-50, 41-45, 36-40, 31-35, etc so you can see the pattern of statistics that corresponds with each grouping.
To the right of the trio of boxes is the filter boxes, so you can for instance filter out the triple double games in the data. This impacts the splits. If you filter out games, the splits will only take into account the data that is not filtered out.
Currently, it can display all the games and all the totals/averages of players who played against a player but I need to integrate this into the main data not the totals, so it can be filtered out and sorted among the games. This should also speed it up greatly. At the moment, it takes 26-27 minutes to generate all the players that are associated with SG or SF positions that Jordan played against from 1985-2003 in the regular season. It is exponential. It takes probably 10 seconds for a single season for all positions, but could take hours to generate it for all seasons. When I integrate it into the main data, it will be part of the same loop as the main data so I have hopes of maybe cutting time down. But it's still very slow to work with when handling large amounts of data.
The second line of data in the main window (the advanced stats) is freely customizable in the programs .ini. I've created an algorithm that will turn formulas into the functions used in the program. This is one of the reasons why the data takes so long to process, it processes new formulas rather than simply pulls out preprocessed generated data. At the moment, the customization is a bit 'weird': numbers have to be 5 digits long, like $5.. for 5 or $50.. for 50 or $5.5. for 5.5. This was to simplify the algorithm (all the variable names are also 5 digits long: eg. PLPTS, TMPTS, OPPTS). I have other priorities than fixing this. While it can calculate equations using parenthesis, it also fails to calculate more than one parenthesis inside a parenthesis and I spent hours trying to figure out why before giving up!
The program also generates graphs. This for LeBron James in 2015-16:
This shows the correlation of scoring with points differential (how many points the game was won or lost by), with scoring measured from left (high) to right (low). It is set to the mean method which averages it out, so below the line indicates below average points differential, above the line indicates above average. It is colour coded, and actually a 3 way comparison but two of the 'ways' are set to differential here. Here, it is just two colours: yellow (above 0) and white (below 0). Some yellow falls below the mean average. The colour gradient is determined by how the main data is sorted and whether it has splits set but it shows the range from yellow to white.
This shows that when LeBron scored above average, it had very little correlation with win-margin but when his scoring efficiency was high (points/FGA) regardless of how many shots he took it had a much greater correlation.
This shows the correlation with minutes played:
The differential was worse the longer LeBron was on court. This isn't because LeBron was bad, it is because star players are rested in blow outs and spend much more time on court during close, competitive games. This pattern goes for every star player I've looked at from every era so far. (So if I were to ever branch it out into a historical manager, I'd make players play less in blow outs and more in close games and games within reachable deficits rather than simply set it to a players average.)
EDIT: I have adapted the program to now run all the opponents totals in the same loop, but it is erroring when doing multiple seasons with player specific positions so I couldn't run a speed test. It should be much faster now, but when all positions are included over a career it took 45 minutes before I gave up waiting. However, singular season outputs take about 30 seconds, if that.
An example of what I'm talking about: from all of the players who played against Jordan's team in 1990-91. The V/ needs to be changed to something. The Win-Loss under the name implies it is Jordan's win-loss, it is in fact the players. So a 1-4 record is 4-1 for Jordan. I have yet to create a system to integrate Jordan's averages adjacent these figures. Okay, it is wrapping at the wrong line length but anyway...
- Code: Select all
DATE/GAME DIFF +/- MINS FGM FGA 3PM 3PA FTM FTA ORB DRB TRB AST STL BLK TOV PFS PTS
ON OFF MINS% FGM% FGA% 3PM% 3PA% FTM% PTS% ORB% DRB% TRB% AST% STL% BLK% AST: FTA: SCORE EFF
===============================================================================================================================================================
910302INDCHIH +21 - 24:-- 5 9 0 0 8 13 1 2 3 3 1 0 3 0 18
Detlef Schrempf -.-- -.-- 50.0 55.6 11.0 0.0 0.0 61.5 44.4 3.0 4.7 3.9 3.1 0.9 0.0 1.0 0.0 2.00 +0.40
901222CHIINDA -10 - 30:-- 6 10 0 0 8 10 3 2 5 4 2 0 1 6 20
Detlef Schrempf -.-- -.-- 62.5 60.0 11.1 0.0 0.0 80.0 40.0 6.5 4.8 5.7 3.9 1.8 0.0 4.0 44.0 2.00 +0.77
901130CHIINDA -29 - 26:-- 4 5 0 0 4 4 1 3 4 2 1 0 3 1 12
Detlef Schrempf -.-- -.-- 54.2 80.0 6.1 0.0 0.0 100 33.3 2.3 9.4 5.3 1.9 1.0 0.0 0.7 5.0 2.40 +1.32
910323CHIINDA -14 - 16:-- 3 6 0 0 3 3 0 2 2 3 0 0 3 3 9
Detlef Schrempf -.-- -.-- 33.3 50.0 7.6 0.0 0.0 100 33.3 0.0 6.3 3.1 3.1 0.0 0.0 1.0 8.5 1.50 -0.01
910410INDCHIH -5 - 29:-- 2 6 0 0 7 8 6 9 15 7 0 0 2 3 11
Detlef Schrempf -.-- -.-- 60.4 33.3 7.0 0.0 0.0 87.5 63.6 13.0 23.7 17.9 7.1 0.0 0.0 3.5 6.3 1.83 +0.77
---------------------------------------------------------------------------------------------------------------------------------------------------------------
V/Detlef Schrempf -7.4 - 125:00 4.0 7.2 0.0 0.0 6.0 7.6 2.2 3.6 5.8 3.8 0.8 0.0 2.4 2.6 14.0
1-4 -.-- -.-- 52.08 55.56 8.59 0.00 0.00 78.95 42.86 5.50 9.63 7.49 3.82 0.79 0.00 1.58 7.18 1.944 +.657
===============================================================================================================================================================
910320CHIATLA -22 - 30:-- 3 13 1 5 2 2 2 2 4 7 0 0 1 2 9
Doc Rivers -.-- -.-- 62.5 23.1 13.3 20.0 38.5 100 22.2 3.7 7.7 5.0 6.5 0.0 0.0 7.0 4.8 0.69 -0.46
910310ATLCHIH -35 - 24:-- 1 5 0 2 2 2 0 2 2 2 2 0 0 1 4
Doc Rivers -.-- -.-- 50.0 20.0 5.5 0.0 40.0 100 50.0 0.0 5.1 2.2 1.8 2.0 0.0 2.0 3.0 0.80 -0.17
910212CHIATLA -9 - 33:-- 2 7 0 2 2 2 1 1 2 4 0 0 1 1 6
Doc Rivers -.-- -.-- 68.8 28.6 8.2 0.0 28.6 100 33.3 2.4 3.7 2.9 4.0 0.0 0.0 4.0 3.5 0.86 -0.51
910111CHIATLA -3 - 32:-- 8 15 2 5 0 0 0 1 1 4 0 0 0 4 18
Doc Rivers -.-- -.-- 66.7 53.3 19.2 40.0 33.3 0.0 0.0 0.0 2.8 1.3 4.6 0.0 0.0 4.0 7.7 1.20 -0.04
910118ATLCHIH +9 - 34:-- 7 13 4 5 0 0 0 5 5 5 4 1 1 2 18
Doc Rivers -.-- -.-- 70.8 53.8 17.8 80.0 38.5 0.0 0.0 0.0 11.1 6.4 5.5 4.1 1.0 5.0 3.0 1.38 -0.22
---------------------------------------------------------------------------------------------------------------------------------------------------------------
V/Doc Rivers -12.0 - 153:00 4.2 10.6 1.4 3.8 1.2 1.2 0.6 2.2 2.8 4.4 1.2 0.2 0.6 2.0 11.0
1-4 -.-- -.-- 63.75 39.62 12.47 36.84 35.85 100 10.91 1.35 6.36 3.54 4.40 1.26 0.21 7.33 4.04 1.038 -.204
===============================================================================================================================================================
910111CHIATLA -3 - 42:-- 6 19 1 3 10 12 4 8 12 1 3 0 2 2 23
Dominique Wilkins -.-- -.-- 87.5 31.6 24.4 33.3 15.8 83.3 43.5 9.8 22.2 15.6 1.1 3.3 0.0 0.5 4.6 1.21 -0.03
910118ATLCHIH +9 - 40:-- 12 23 2 7 8 11 1 8 9 3 2 1 1 1 34
Dominique Wilkins -.-- -.-- 83.3 52.2 31.5 28.6 30.4 72.7 23.5 3.0 17.8 11.5 3.3 2.0 1.0 3.0 2.5 1.48 -0.12
910320CHIATLA -22 - 36:-- 11 19 1 2 5 6 1 6 7 4 1 1 3 0 28
Dominique Wilkins -.-- -.-- 75.0 57.9 19.4 50.0 10.5 83.3 17.9 1.9 23.1 8.8 3.7 1.1 1.1 1.3 0.0 1.47 +0.47
910310ATLCHIH -35 - 30:-- 6 17 0 2 2 2 5 3 8 3 0 3 3 0 14
Dominique Wilkins -.-- -.-- 62.5 35.3 18.7 0.0 11.8 100 14.3 9.3 7.7 8.6 2.6 0.0 2.9 1.0 0.0 0.82 -0.16
910212CHIATLA -9 - 42:-- 13 29 2 4 9 9 5 6 11 3 1 1 3 1 37
Dominique Wilkins -.-- -.-- 87.5 44.8 34.1 50.0 13.8 100 24.3 12.2 22.2 16.2 3.0 1.1 1.1 1.0 3.5 1.28 -0.08
---------------------------------------------------------------------------------------------------------------------------------------------------------------
V/Dominique Wilkins -12.0 - 190:00 9.6 21.4 1.2 3.6 6.8 8.0 3.2 6.2 9.4 2.8 1.4 1.2 2.4 0.8 27.2
1-4 -.-- -.-- 79.17 44.86 25.18 33.33 16.82 85.00 25.00 7.17 17.92 11.87 2.80 1.47 1.26 1.17 3.26 1.271 +.073
===============================================================================================================================================================
910312CHIMINA -32 - 18:-- 2 4 0 0 3 3 3 3 6 3 1 1 0 2 7
Doug West -.-- -.-- 37.5 50.0 4.5 0.0 0.0 100 42.9 7.5 7.9 7.7 3.0 1.0 1.0 3.0 5.2 1.75 +0.65
---------------------------------------------------------------------------------------------------------------------------------------------------------------
V/Doug West -32.0 - 18:00 2.0 4.0 0.0 0.0 3.0 3.0 3.0 3.0 6.0 3.0 1.0 1.0 0.0 2.0 7.0
0-1 -.-- -.-- 37.50 50.00 4.55 0.00 0.00 100 42.86 7.50 7.89 7.69 3.00 0.95 0.95 3.00 5.20 1.750 +.655
===============================================================================================================================================================
910328NJNCHIH -34 - 14:-- 4 7 0 1 2 4 1 1 2 2 0 0 0 3 10
Drazen Petrovic -.-- -.-- 29.2 57.1 8.1 0.0 14.3 50.0 20.0 2.1 2.0 2.1 2.0 0.0 0.0 2.0 7.3 1.43 +0.37
910216CHINJNA -12 - 25:-- 7 10 1 1 2 2 1 2 3 1 1 0 3 2 17
Drazen Petrovic -.-- -.-- 52.1 70.0 11.6 100 10.0 100 11.8 2.0 4.7 3.2 0.9 1.0 0.0 0.3 4.4 1.70 +0.78
---------------------------------------------------------------------------------------------------------------------------------------------------------------
V/Drazen Petrovic -23.0 - 39:00 5.5 8.5 0.5 1.0 2.0 3.0 1.0 1.5 2.5 1.5 0.5 0.0 1.5 2.5 13.5
0-2 -.-- -.-- 40.63 64.71 9.88 50.00 11.76 66.67 14.81 2.04 3.26 2.63 1.43 0.47 0.00 1.00 5.67 1.588 +.595
===============================================================================================================================================================
EDIT: It has gone from 26-27 minutes to 14 minutes to generate totals for SG and SF rivals (and those marked either for secondary positions) for the career of Jordan. In addition, I've added in an option to count the games so it can process for instance only players with whom he played against 10 or more matches. This speeds up the generation considerably. For all positions, it is under 10 minutes. For just Jordan's position, it would rather less than that.