Making my own basketball statistics program

Like real basketball, as well as basketball video games? Talk about the NBA, NCAA, and other professional and amateur basketball leagues here.

Re: Making my own basketball statistics program

Postby dwayne2005 on Sat Sep 23, 2017 2:51 am

I made some changes since then, but seem to have broken it.

Things I have changed:

Searches now only require the first 3 letters of each name. I appear to have somehow broken this feature before compiling it, so I won't bother with the upload I had prepared until I fix it. I am baffled by the error, since it was working just prior. It may be season related somehow. When it's working, I was generating searches with Isa Tho (Isaiah Thomas; not case sensitive). I hope to make it more flexible, allow a custom number of letters down to a mimimun of bare initials but I need to get the basics working first.

Player names are now erased with a right click of the mouse button. No longer the need to delete characters.

The first two digits of years are now set to the corresponding century. Quick fix to alleviate having to type up 4 numbers.

When you change the range values, a right click of the range values now sets it back to default.

I have removed the horrible default green click down colours (now navy blue) and the shadows to buttons.

I have added two buttons to the GUI for selection of regular season, playoffs or both output and for the adding of 'above' figures, removing the options from the .ini.

I have fixed the disappearing 'limit of games' box besides the teammates and opponents generations.

I hope to add a quiz in it that will give you a multiple choice to guess whose game a specific set of stats was from the chosen range when multi player searches are done. Should be a easy. It won't just be a game, but could aid in memorization skills.


This image shows the same Russell Westbrook 3 way interplay from the previous post from a different angle (I haven't done anything to the graphs since I started):

Image

The game differentials are here shown by their height above or below the line (the mean average, not 0). By default (can be customized in the .ini), below the line does not mean deficits. It means below average, which could include deficits. Since the average points differential for Russell Westbrook was under 1 point, most of the below the line represents deficits. But if I were using a Golden State player, for example, a large amount of the below the line bars would still be positive differentials. The yellow to white colour coding now represents defensive rebound percentage. The more yellow it is, the higher the rebound percentage. There is a very good correlation with the first graph and a perfect correlation with the second graph because left to right shows defensive rebound percentage also.

So you can see there is a better correlation with winning margins for higher rebounding games by Russell Westbrook than lower rebounding games where the majority of games are below the line (below average and in many cases, if not all, deficits). Some of these graphs are skewed by the fact that many games have the same values. If you had 10 x 8 rebound games, they would all be displayed in a row and the order of the differentials is fairly random between them, sometimes showing larger differentials earlier and other times showing them later. This might explain the differences between the two graphs more than anything meaningful.

EDIT: My program and features work okay in normal GameMaker Studio compiling. However, using YYC to build it is what is causing the issue. It is not generating any kind of error, besides not doing what it is doing elsewhere.

EDIT: The latest version: https://www.mediafire.com/file/p19whm70 ... tatsCQ.zip I didn't change the programming language to get it to work, just bundled a few repeated tasks into a couple of variables and it seems fine now. The new name thing isn't fully integrated. It requires the last data searched to contain the players name for it to work. So you can't just jump from Russell Westbrook 2017 to Michael Jordan 1985 by typing Mic Jor.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Mon Sep 25, 2017 2:36 am

Russell Westbrook went 33-9 (78.57%) when getting a triple double during the regular season in 2016-17. So he went 13-26 (33.33%) without. How's that for diametric. Although, the numbers seem to indicate he is better for the team at 10-20 points per game. That said, that applies to many star players as well.

Current state of affairs.

Image

https://www.mediafire.com/file/y846oozs ... tatsCQ.zip

There was a significant issue with ranging and then reranging. It basically caused the program to crash, but I didn't know about it because it only crashes when compiled with YYC mode. I do almost all my testing without compiling in YYC, but the problem should have done something with that build also.

I have added in basic fixed 3 tabs and created a better page system for the data that should make it easier for adding tabs in the future.

No, I do not like the colours of the highlighter, but it is the closest to what felt right with the inbuilt colours. I'll get to customizing it in the future. I am colour 'blind' (red/green colour deficient which may affect RGB blends, probably nothing regarding the yellow), so I don't really know how it looks, just that it doesn't look quite right but satisfactory to my eyes.

The highlighter serves no purpose at the moment besides making it easier to follow the lines. It is possible I'll make it so highlighting entries allows you to range the selected data. At the moment, only 1 entry can be highlighted.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Tue Sep 26, 2017 2:33 am

Well, that version was another broken one. I had changed the name of a variable to the grid it normally references but that broke it somehow. It worked, but it is much slower and at least the above average/average/below average median splits didn't work, if not splits in general.

https://www.mediafire.com/file/u4y56l7x ... tatsCQ.zip

I done the median splits on a single player for the first time I remember and I also noticed it, too, was broke. I had accidentally not thrown in an equal sign in the right place and it was carrying over the minimum value from the average bracket to the below average bracket.

It means the below average output was broken, and has been for a very long time, if not the start. I used this range method, for example, for generating season wide height averages relating tall players to average players to below average players. The values were wrong (which I could have seen had I simply added up the numbers to verify that it was working as it should and not just looking like it was). Here are the correct values. The conclusions are pretty unaffected, though.

Image

Noticing this problem made me fix it not working properly when columns were sorted ascending and also made me insert the displacement input into the value. The above average uses a +1 displacement. The median average height in the league was one inch shorter in 2016-17 than it was in 2015-16. I have given it a +1 to make it more relatable to the previous season. The difference seemed to show far fewer shorter players played in 2016-17 compared with 2015-16 (at least 25% less) and there was a resurgence in the taller players, but the truth is once you account for this inch the numbers were close to the same so the displacement was a must.

I have added two unlabelled buttons to the right of the range boxes. After you have performed a range operation once, the minimum and maximum values possibly change for every other value. Pushing, the top one after such a range operation changes the numbers in the boxes to reflect the current ranges. It is more possible to avoid the program crashing out because it has a 0 size grid (which I'll get to sooner or later) with this.

Image

The second lower button resets all the ranges to the players season bests, which is now needed if there are many boxes which need resetting.

I have begun messing with button graphics a little. The tabs are now boxed shape (quick fix, I figured I would need to do something better). I like the input boxes the way they are but the miscellaneous other buttons need some changes. I done some subtle changes to the text presentation. For instance, removing all the values for which there are not splits and removing one dotted line from the totals outputs. I'll need to make it look less like a text presentation at some point. The RA (for 'range') button is now R/S for ('range/splits') as it does both of those operations.

UPDATE: There is only one bug that I have noticed in the last day, and it's not important. The buttons to the right of the ranges disappear when running team mates and opponents searches. They do prevent using ranges for those searches, but as I've almost never touched them myself it is probably not worth uploading a correct for them. I have begun messing with drawing lines in the output and think as things are, I'll not use horizontal lines in the main screen, but will use horizontal lines in the splits and team mates/opponents outputs to separate the two players.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Tue Oct 10, 2017 6:49 am

Still working on it.

One of the most interesting things is something I completely, and utterly stupidly overlooked. Since I've got this program that can islolate any statistical game through range searches, when I generate team mate and opponent stats why am I restricting it to seasonal output? It'll make a far more versatile and interesting feature if I extended it to the range searches. So now it can, for instance, isolate what Russell Westbrook team done player by player when he triple doubled:

Image

And when he didn't:

Image

You can now see just how much a style of play benefits which players. That's another thing I overlooked until now. I couldn't invert the ranges. There was no way of getting stats for the non-triple double games. Granted, you could get them for the full season and compare it against triple doubles, but there was no feature in my program to be able to get the games which weren't. And it was really, really easy to do! There is now another new button for inverting the ranges.

I have added a black bar below the main output section. This black bar so far has 'tooltips' explaining just how to use each feature in concise and easy to understand text. Hopefully, if that is a problem it won't be anymore! Eventually, I'll extend it to include a rolling summary of the game stats the mouse is now dropped over as well.

Before, I was building up to an idea to have a variable amount of tabs the user can open and load, but that is discarded now. I wanted to set all the pages into arrays and the whole idea of doing arrays of entries into arrays of pages didn't please me for the time being. When you select entries, they get copied over to the PAD. They can be deselected and moved from the PAD until a new search is performed. I think an analysis of alternate stats is better done when the figures are on the same screen. They all now drop one entry at a time when scrolled like the main screen, and putting them into arrays allows me to format the entries with lines and colours which I can't do with it being built up the way it was.

This is how the main game stats screen did look last week:

Image

And the totals/splits:

Image

I have found an oversight that greatly speeds up teammates and opponents generations, but only when doing a small amount of data, like single seasons. I don't know what the processing speed is for the really long ones, maybe it has helped more than I think but I am a skeptic.

I had warnings about losing data from teammates and opponents generations. I intentionally chose to not store this data as it extends massive grids into even more massive grids. The first round of data is printed as it is generated. Maybe I'll add it for the future, but now I have a warning about why that is happening.

I have fixed the DIFF and +/- ranges from not working in conjunction.

I have put the data into individual archives, so it no longer takes forever on first boot. It takes too long for comfort to load up seasons as you go but nowhere near as long. Eventually, I'll look at putting them all into singular text files. I can already do that, but I don't want to.

I want to do up a context menu for the entries so that you can generate team mate and opponent relevant stats for every split.

I probably came close to a fatal asthma attack a few days ago, and have been suffering asthma a lot these last few days. I'm out of breath by moving so like to spend time on the laptop doing slow things like this.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Wed Oct 11, 2017 4:17 am

Current version:

https://www.mediafire.com/file/491yfdio ... tatsCT.zip

The 3 letter team code searches are producing erroneous output that I seem to have somehow missed. The pad feature isn't yet scrolling so it has limited space.

If you're baffled about what the features do and how to access them, the new box should be of help! In explaining here, I just write out paragraph after paragraph. Even though I intend to have that box scroll game stats eventually, the tips will always be stagnant as you need to backtrack over sentences so is limited to a concise area forcing me to make them as concise and to the point as possible.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby Dee4Three on Wed Oct 11, 2017 5:01 am

While I probably would never use this, I want to give you some credit for the effort and results here. I am sure this will be useful to many if they give it a chance.

I don't know anything about gamemaker, but it's pretty clear your goal and your effort. It's also clear that you are making progress and getting results.

Keep up the good work!
"I don't know if I practiced more than anybody, but I sure practiced enough. I still wonder if somebody - somewhere - was practicing more than me." - Larry Bird

Check out my YouTube channel

https://www.youtube.com/channel/UCvHJXrqit8Dc6HBY5P6EmAA


Follow me on Twitter

https://twitter.com/Dee4Three84
User avatar
Dee4Three
NLSC Team Member
NLSC Team Member
 
Posts: 9673
Joined: Sun Mar 30, 2014 12:34 pm
Location: New Hampshire, USA

Re: Making my own basketball statistics program

Postby dwayne2005 on Wed Oct 11, 2017 5:15 am

Many thanks! It's good to get some encouragement. I admit it can be difficult to justify this many uses and interpretations of the data. Usually I get a feeling, a theory about something and I'd like to test it out but it comes out of the blue after 3 months? Confronted with the GUI, the ideas just don't come to mind all that often, it is something that just happens and isn't forced. It's not something that comes to you on the spot. But this is what I enjoy doing and will see it through to the end. I intend to get into programming other things and games, if possible, and feel I am learning a tonne from it.

(By the way, not covered in the program is that copy to clipboard is done with the CTRL key. No GUI for it yet. I forgot also, the last uploaded version had a broken algorithm. I have to copy the data into pages and copy those pages into a full file to get a workable copy to clipboard and the variation I used didn't work, it wasn't grabbing all the games. I have run tests on the present version and it has worked on every test, but I won't rule out it not being 100% right yet.)
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Tue Oct 17, 2017 4:02 am

https://www.mediafire.com/file/9vjkdhn0 ... tatsCU.zip

Mainly fixed up some bugs (and coming a step closer to finishing customizability of the second row of data), including the two most common sources of program crashing:

1) When the data is filtered to nothing either through a name misspell or overdoing the ranges, it continually reported the grid couldn't be shrunk to <=0 and would crash. That has been fixed.

2) Just after sorting the columns, applying a filter operation would also trigger a crash. Fixed.

The main issue that has been resolved is custom calculations (accessible in the settings.ini file). I had fixed the error that was triggering it to not acknowledge parenthesis correctly to my knowledge maybe a month or so ago but didn't realize I had done so because I didn't type the equation up correctly thus producing erroneous results at the time. The reason for that misshap was the 5 character necessity for number values, a thing that I want to look into fixing soon.

Since the custom calculations is now working, I have added custom labels to all but scoring efficiency which is done up a unique way that I'm meditating on. So most of the second row of stats can be freely customized to your own equations but I expect the format to change a little due to plans to drop the requirements for 5 digit variables.

I have fixed up the data errors with the team search to my awareness. It was done up a unique way to the other calculations, so needed some special considerations. Also, the filters weren't working right when applying to team search results due to only one grid being backed up and filtered. I have integrated the rivalry splits into the team data.

I have fixed up at least one, if not all, occurrences of the graph bars on the main screen swallowing the screen. It also now refreshes to changed filter ranges. There were a number of graph labelling issues that were also fixed.

I believe splits weren't working properly with advanced stats due to the lack of setting median/min/max values. This was a recent error I introduced when referencing those values for the insertion of labelling the entries.

I had added a button for filtering Home/Away games. GameMaker when building with YYC is telling me there are warnings with the 'if' command but they appear to not cause any issue and I haven't a clue what the hell it's problem is!

I have added 'tooltips' for the non-customizable ON/OFF ratings explaining just what each value means (on = the points differential per minute when a player was on court; off = the points differential per minute when a player was on court subtracting the points differential per minute when a player was off court, therefore it basically turns the bench performance to the 0 value and relates how much better or worse than that a player was.

(The value to the right of scoring efficiency is also a similar measure. It relates back how much more efficient he was than the rest of his team, so in essense tells you whether or not he was being a needless ball hog. One difference is that that relative score can at the moment be customized in the .ini but it relates back to other stuff in the program that correlates it with the scoring efficiency score and won't work independently.)

I have tweaked some visual aspects, including removing the double width black bar and replacing it with a dark blue bar for team mates/opponents and team searches. I have made initial moves to possibly highlighting the sorted column at the header but to draw it all up in different colours I'd need to give every item is X,Y coordinates which sounds like a pain in the...

I have fixed up an issue when using decimal points in the split value that caused the labelling to count wrongly on the custom tab. I have not fixed the fact that the labelling continually counts down when there are games splits in unison with this data yet.

I have removed the empty spaces when performing custom splits where there is no data for that split. For instance, if a player has a top of 38, then a second best of 34, and it is split into 1 point, it won't show the spaces for the splits for 35, 36 and 37 anymore.

I have not fixed the lack of scrolling of the PAD tab. There are some copy issues remaining.

The ON and OFF columns are not sorting correctly due to the method I have devised to remember previously sorted data and combine it with the currently sorted data, as well as the Name column which only comes up during certain multiplayer searches. I thought I had fixed the former many months ago. I may have done so and then reverted to an earlier version losing the fix.

There was another terminal crash related to the PAD feature that I need to look into.

Among the things I need to fix: splitting playoffs and regular season games in team searches and applying my quick name search feature to all data. Once the data for the games has been generated, there is no distinction between regular season and playoff game with that search mode. I need to somehow get into the mindset to fix up earlier seasons before about 1984.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Fri Oct 20, 2017 5:39 am

What I am looking into is making the teammates and opponents stats more robust. I have changed the way the data was sorting so that all the lines of stats in the gens show after sorts and filters. I have already introduced the filters having an effect on the averages when filtered. But what I'm after is creating custom splits on a player by player basis. For instance, if you want to see how much every assist by LeBron James affected Kyrie Irving's stats, that should be possible. On the surface, it should be easy to implement. But I'm absolutely lost in the code and it's not working the way it should be! I've spent a day on it and got a lot of the imposing stuff out of the way, but I'm not sure how long it will take me to achieve this final step before cleaning out all the bugs and nuancing it. I have no idea what is breaking and why...

Once I achieve this, I'll make the program flawless as possible and then later investigate the simming/management angle.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Sun Oct 22, 2017 3:14 am

It's working, but there are some issues.

Image

Irving doesn't seem to have benefited off LeBron James' game at all. There is a definite trend to lower efficiencies and less scoring corresponding to each successive assist by LeBron. While not a huge one, it is a negative trend.

Image

This is for Stockton and Malone in 1996. Malone also doesn't appear to have been a significant beneficiary with each successive assist, but there is a slight positive effect on scoring and scoring efficiency.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Tue Oct 24, 2017 3:57 am

https://www.mediafire.com/file/mgavjp6o ... tatsCV.zip

So let's say you want to find out how Jordan performed per assist by Scottie Pippen in 1996.

First thing you do is you perform a search of Michael Jordan in 1996.

After the results come up, on the bottom right of the display box you will see buttons marked TMM (teammates) and OPP (opponents). You want TMM, but in order for this button to work you first need to enter a number in the box at the right for a limit of games (which is used to speed up searches, which isn't needed for TMM over 1 season). Just type in 1 and press TMM.

When the team mate games come up, you need to first sort a statistic by left clicking on its header (click once so it is descending order). So here you left click assists because you want to see the relationship between Pippens assists and Jordan's productivity. You will get a warning about how the algorithms depend on the sorting method and how the numbers on the SPLITS tab will cease to be updated as a result. Just okay through that.

In the pyramid of 3 boxes to the left of the min/max range boxes, which read -1 (top), 0 (bottom left) and 0 (bottom right) type in 1 in the bottom left box. This will split the selected sorted statistic (assists) into groups of 1, so say a player had a top of 15 assists it will create custom splits of: 15, 13 (if there is no 14 it is skipped), 12, 10, 9, etc. If you type in 2 instead, it will cluster 14-15, 12-13, 10-12, etc.

Now you need to perform a filter search of Scottie Pippen. In order to do this, you need to find his entry in the SPLITS tab and right click it.

Once you have done this, you need to click on the box at the top right of the screen marked either RA or R/S (it alternates due to the fact that I previously didn't have a split operation on TMM/OPP searches but now I do I need to fix that back to always read R/S).

Once you have pressed that button, you should see the results in the CUSTOM tab.

Because the results are going to be a bit unclear, you can try the + method (click the slim button to the left of the top box on the triangle). The plus method adds up all results above, so rather than 15, 13, 12, 10, 9, etc. it becomes 15, 13-15, 12-15, 10-15, 9-15 etc. The bottom most split is the season average of the player across all games. This will show greater trends.

Another thing you can do is group the results in a cluster of 3 splits (above average, average and below average splits). This is based on difference from the medium average. For example, if the middle assist game for Pippen in 1996 was 7, then entering a value of -2 in the bottom left of the pyramid of boxes will generate a difference from the medium range of 2, making the middle average range 5-9, the above average 10 or more and the below average 4 and under (previously you couldn't do these kinds of splits with a -1 value; it was an oversight from a variable I had used when I had these splits set to the right box and has now been fixed).

Image

Shows that when Scottie Pippen was getting less than 5 assists that season (for an average of 3.0), Jordan was scoring 29.0 PPG at an efficiency of 1.143 (+.041 over rest of team).

When he was getting 5-7 assists (for an average of 5.6) Jordan's efficiency declined to 1.102 although remained stable relative the rest of the team at +0.048. Despite a decrease in efficiency, his scoring rose to 30.5 PPG suggesting he was a benefactor of the assists.

When Pippen was getting over 7 assists (for an average of 9.3) Jordan's efficiency increased 1.211 and +1.24 over the rest of the team! His scoring went up to 31.0 PPG.

It also shows the teams were winning by bigger margins when Pippen was above average (+15.5) and below average (+14.5) in assists than when he was average (+8.4). So why is this? Notice both players were playing around 80% of the game compared with 76% in the other brackets. Players play longer minutes in closer games, creating a negative correlation. This may also be clouding the effect on scoring efficiency as everyone on the team is playing worse in those games. An ideal would be to sort it by assists per minute instead and then split those. While it can sort by assists per minute instead, I don't know how the splits respond to those sorts. My guess is not very kindly. I'll have to look into that.

At some point, I'll also look into flipping the splits so that it is Jordan stats that are sorted.

EDIT: Fixed the display of per minute stats and splits regarding per minute stats (which would trigger a crash previously). There are still issues with the custom splits of per minute stats (such as the perculiar fact that it won't sort another column after sorting the first column after applying a split and the labeling has issues). But if the output is correct, per minute doesn't do much to change this pattern after all. I also fixed a critical crash that was occurring in yesterdays release.

EDIT2: No, the splits weren't working properly over per minute stats. That should be fixed now. I've also added in the ability (triggered by left click of the text next to each range) to switch the ranges from standard statistics, to the custom and per minute statistics. I have also changed the on and off statistics to show per x minutes set in the settings.ini (36 by default) which makes it easier to understand.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Wed Nov 01, 2017 6:16 am

Newest version (same lettering, different version): https://www.mediafire.com/file/nyjeqc9d ... tatsCV.zip

I have fixed up the 5 character obligation for inserting numbers into custom formulas (no more *$100. now you just enter *100). When I went to insert some customizability in terms of the number of front digits and decimal digits, I removed the negate operation from the program for the last value and inserted it into the equation in the settings.ini by initially repeating the preceding equation and negative it from it. All my equations were working up to that point so I thought it was working until then. I finally flipped enough switches to get it to work and inserted the ability to reference previous equations in the formulas (CUS##) but not future formulas (for example, for the 18th and last formula, you can type in CUS17- at the start of the equation to replicate what I done originally). The only issue I can see with the equations now is inserting negative numbers. I don't know what effect it has but I guess it won't work if you insert say -7*PLPTS/TMPTS but 0-7*PLPTS/TMPTS should work... I have also made the numbers multiply when + and - are used which should keep the individual games and totals accurate but there are some circumstances where that might conceivably not work.

All the filters can now be flipped between game/per minute/custom stats. I've cleaned it up since the last update that no one touched so that all the values should reset correctly.

I have changed the ON/OFF values to be multiplied by the per minute setting. So now it is easier to understand as the deficit/advantage a player has while on court versus on court relative his bench (off). For example, rather than reading something obscure like +.312 it now reads +11.2 when the per minute setting is 36 minutes, meaning the team averages +11.2 points when he is on court were he to play 36 minutes.

Still have to fix up the sorting of the ON/OFF values, among other things.

NBA Playgrounds seems to register rebounds incorrectly. Even pros can't even handle the recording of basic statistics even competently, so I shouldn't be so concerned if things have gone awry from time to time.

Considering all the things I'm doing and how many times I have mucked up, I've been wondering when a goof will give me inspiration. And I have found one. When going to a TMM (teammate search) and selecting a player, performing the same TMM search again seems to limit games to when that player was active. I say seems to because that players game number remains the same, while everyone elses changes accordingly. Let's say you have Russell Westbrook with an 81 game season. You perform a TMM search on him, and then select Steve Adams who it reports played 79 of his 80 games with Russell Westbrook. Once he is selected, if you perform a TMM search again, you would expect all the other teammates in the original output to differ between 0-2 games, and for Steve Adams to get the exact same number of games, and they all do! So on that basis, it seems to work that way. I have not investigated why it is doing this yet, but it allows me to do something I had been wanting to do but couldn't think of a decent way to implement it: increasing the number of teammates for it to filter through. So instead of just seeing Scottie Pippen and Jordan, you could also do a teammate operation isolating the games to Scottie Pippen, Dennis Rodman and Jordan, for instance. It is a glitch, but it is one I am considering turning into a feature. One problem with doing it this way rather than say inserting another name box or a prompt for another name on the main screen is that you have to perform the search multiple times, which adds time to processing it. I can see ways of improving the dynamics of the program with it, though, and in fact it wouldn't hurt having both options. At the moment, if you switch out of the player it loads up a grid with just 2 games and I don't know why.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Tue Nov 07, 2017 5:28 am

Image

The first lines [AST >9]. [AST 7-9], [AST <7] are the statistics for the data range, in this case filtered for LeBron James.

So what this shows is how two players (Kyrie Irving and Kevin Love) do corresponding with whether LeBron James was above average, average or below average for assists based on the median average (middle value of a range).

This data is restricted to games all 3 players played in, so is different from the previous analysis which showed Kyrie didn't benefit at all. Here, Kyrie's scoring does increase, but it is not clear it is because of James' assists. In fact, even though his efficiency doesn't decline significantly, it is significantly worse than the rest of his team which might suggest James' assists are making everyone but him more efficient.

On the other hand, Kevin Love seems a huge improvement in scoring and scoring efficiency corresponding with James' assists. But he is also spending significantly more time on court (69% to 61/62% or +4 minutes)

This feature can add up to 5 players and is for the TMM search operation only. The OPP mode will need some additional stuff that I'm not sure how to put together, or even if I should bother at all. I need to clean up a few things. I'd like to adapt what I know about the way it is handling the data to give player breakdowns on right click of the normal splits/totals on the main search before I forget what it is doing exactly.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby shadowgrin on Tue Nov 07, 2017 12:19 pm

I'm just waiting for you to remove the significant bugs and release it so I can edit some stuff you coded, release it as my own, and take credit for all your work.
HE'S USING HYPNOSIS!
JaoSming2KTV wrote:its fun on a bun
shadowgrin
Doesn't negotiate with terrorists. NLSC's Jefferson Davis. The Questioneer
 
Posts: 23230
Joined: Thu Dec 12, 2002 6:21 am
Location: In your mind

Re: Making my own basketball statistics program

Postby dwayne2005 on Mon Nov 27, 2017 3:39 am

I'm taking a break off from it. I have too many other things I consider a priority right now. But you can amass team mates and opponent players to get stats for 2 on 2 or 3 on 3, etc. rivals. Eg.

Image

(It makes sense to have the average age here, which I will be adding.)

However, as it is done, it is time consuming to do it over a career. With all the searches it performs for every added player, it probably takes about 15 minutes. I haven't thought up a quicker fix yet, but it shouldn't be hard.

What I want to do is focus on giving you the ability to put in a bunch of formulas and it try and guess the results of games based on those formulas, determining which is the most accurate predictor. For team searches, of course.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby BPDHoplite on Tue Dec 05, 2017 9:57 am

Being blunt it looks horrible :?

Nothing on your skills but is there any better base/layout you could use?


I make games too an I know the effort it requires but just wondering.
Used to be called DaCrispy


YouTube - https://www.youtube.com/channel/UCkG6-Q ... 6S0t9jikJQ
NCAA Bsketball 18 - viewtopic.php?f=153&t=104626
College Hoops 2K - viewtopic.php?f=136&t=106815
Update Mods for NBA 2K11 - viewtopic.php?f=136&t=105434
Updated G-League for 2K11 - viewtopic.php?f=136&t=106723
Discord - https://discord.gg/J6mFNkeFDd
User avatar
BPDHoplite
Still the NLSCs resident Jimmermaniac
Contributor
 
Posts: 1289
Joined: Thu Mar 09, 2017 4:59 am
Location: Ireland

Re: Making my own basketball statistics program

Postby Murat on Sat Dec 09, 2017 12:10 am

Pretty cool, dwayne

DaCrispy, you remind me of me back in 2010
Murat
Contributor
Contributor
 
Posts: 6457
Joined: Sun Feb 14, 2010 6:07 am
Location: US/East Coast

Re: Making my own basketball statistics program

Postby BPDHoplite on Sat Dec 09, 2017 5:27 am

Lol.

I am just looking at it in a way of what would make me want to play this ahead of another basketball sim such as PCF 17 . Not Hating :cool:
Used to be called DaCrispy


YouTube - https://www.youtube.com/channel/UCkG6-Q ... 6S0t9jikJQ
NCAA Bsketball 18 - viewtopic.php?f=153&t=104626
College Hoops 2K - viewtopic.php?f=136&t=106815
Update Mods for NBA 2K11 - viewtopic.php?f=136&t=105434
Updated G-League for 2K11 - viewtopic.php?f=136&t=106723
Discord - https://discord.gg/J6mFNkeFDd
User avatar
BPDHoplite
Still the NLSCs resident Jimmermaniac
Contributor
 
Posts: 1289
Joined: Thu Mar 09, 2017 4:59 am
Location: Ireland

Re: Making my own basketball statistics program

Postby shadowgrin on Sat Dec 09, 2017 6:55 am

It's not meant to be played, it's still a statistics program and not a stat simulation manager game.
HE'S USING HYPNOSIS!
JaoSming2KTV wrote:its fun on a bun
shadowgrin
Doesn't negotiate with terrorists. NLSC's Jefferson Davis. The Questioneer
 
Posts: 23230
Joined: Thu Dec 12, 2002 6:21 am
Location: In your mind

Re: Making my own basketball statistics program

Postby dwayne2005 on Fri Dec 29, 2017 3:20 am

It will be back at some point provided I don't die before then. I do have hopes to add siming/gaming potential, but there is still a lot of stuff I'd like to add to the statistical side of things. Given I am not working on it at present and there are some more positive feedbacks (not just sarcastic ones) I might compile the version with all the team mates/opponents improvements at some point. Before then, I should just get together all the playoff stats from last year...

Some analysis I done recently on Russell Westbrook lasy year and their wins and losses corresponding with how he performed in each stat:

Triple Double (12.7R, 12.7A, 31.6 AVG): 33-9 (78.57% +6.8 DIFF)
No Triple Double (8.4R, 7.8A, 31.6 AVG)): 13-26 (33.33% -5.7 DIFF)
7 or more rebounds (11.9 AVG): 42-24 (63.64% +3.5 DIFF)
10 or more rebounds (12.8 AVG): 36-18 (66.67% +3.9 DIFF)
13 or more rebounds (14.8 AVG): 17-8 (68.00% +4.1 DIFF)
7 or more assists (11.4 AVG): 43-26 (62.32% +2.7 DIFF)
10 or more assists (12.6 AVG): 38-12 (76.00% +6.0 DIFF)
13 or more assists (15.0 AVG): 16-6 (72.73% +9.4 DIFF)
More than 20 points (33.7 AVG): 40-32 (55.56% -0.3 DIFF)
More than 30 points (39.0 AVG): 27-17 (61.36% +1.4 DIFF)
More than 10 FTM (12.4 AVG): 15-19 (44.12% -3.2 DIFF)
More than 4 3PM (5.3 AVG): 14-5 (73.68% +6.4 DIFF)
More than 20 FGA (26.4 AVG): 36-26 (58.06% +0.6 DIFF)

Rival team mate rebounders when he was getting 10 or more rebounds:

Steven Adams: 7.8 / RW: 12.8 / CMB: 20.5 / TEAM: 48.1 / OPP: 40.7 (53 GP)
Enes Kanter: 6.7 / RW: 12.8 / CMB: 19.5 / TEAM: 47.5 / OPP: 41.1 (48 GP)

Rival team mate rebounders when he was getting less than 10 rebounds:

Steven Adams: 7.4 / RW: 6.4 / CMB: 13.8 / TEAM: 44.1 / OPP: 40.3 (26 GP)
Enes Kanter: 6.6 / RW: 6.6 / CMB: 13.2 / TEAM: 43.2 / OPP: 40.0 (23 GP)

Which seems to indicate he wasn't 'stealing' rebounds from team mates.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Sat Feb 24, 2018 5:15 am

I have resumed work on it in recent days.

The changes, some new, some a bit older:

When you generate a team mates or opponents output, you can now right click on them to add them or remove them. Adding them allows you to amass players to see how well they performed together as a unit (game data only, not play by play; not how well they performed when they were on court with one another). So if you wanted to see how LeBron James performs with Kevin Love, you type in LeBron James and then generate his team mates output and you can see a list of everyone including Kevin Love. But if you wanted to see how that partnership played with others, you'd add Kevin Love by right clicking on him which will bring up a prompt: either add or remove this player. Adding the player will put his stats below LeBron's and it generates all 3 way combinations in the output. You can add more and more players (I think I capped it off at 5).

You can add opponents this way too and when amassed you can compare, for instance, Michael Jordan and Scottie Pippen against Karl Malone and John Stockton.

This is an old change that I don't believe I uploaded, but a new change (last 2 days) is the ability to remove players from the calculation. Rather than removing players, it removes the games this player played in. So if you wanted to see how well LeBron James done without Isaiah Thomas, you can easily omit games IT played in. This generates some interesting facts about Tristam Thompson, who even without Isaiah had a 8-11 win-loss with Cleveland before the trades. When you couple him with LeBron minus Isaiah and with Kevin Love, you have a win-loss of 7-11 and with Dwyane Wade instead of Love you have a 5-9 stretch where Dwyane Wade shot numbers similar to Isaiah Thomas had in his 15 game stretch. This 5-9 stretch (35%) with Thompson became 17-3 (85%) without Thompson. For IT's 15 game stretch, every game was played with Thompson.

Yesterday I implemented a manually way of subtracking players. Eg. Type in LeBron James, perform the search, then type in "-Isaiah Thomas" and it will remove Isaiah's games from the stats. I hope to add a plus option for adding team mates or opponents, and once this happens it will be faster to amass players through team mate and opponent searches.

An older change was the ability to change the range boxes to per minute and custom ranges by clicking on the label on the left. I have been working to finesse that, and have also incorporated a button to change from per game stats to per minute stats in the display.

I have made the year input easier. Now it only requires the last 2 numbers, and there is a button that will advance up or down the years. I have also added the ability to right click on the totals outputs to filter for that data. So if you go to the page which shows the splits for Totals, Wins, Losses, Home, Away, v/ATL, etc. you can filter just that data simply by right clicking on the entry. All of these ranges could already been done except the time rivalries.

It includes all the stats to the allstar break. Several days ago, I had implemented a change to read the data from single files rather than from 500 or so individual ones. I thought this might speed it up, but it seems to be just as fast/slow, maybe a little slower. Which makes me wonder if it isn't like the thing about copying to clipboard, that the program works optimally by sharing the load. For example, rather than having 1 file for 400 players or 400 files for individual players, have 20 files each containing 20 players. This is how I managed to shrink the copy and paste time for tens of thousands of entries from over 10 minutes to almost instant so it's a long shot but worth a look. I want to be thorough. If I can rule out that, then I'll leave it as it is.

Current generation times on this slow computer:

Full single season player output: 12 seconds (first pass which generates game data from player data) / 8 seconds (second pass)
Team mate output, one season (1 game requirement): 2 seconds
Opponent output, one season (1 game requirement): 53 seconds
All season output: 137 seconds (first pass) / 102 seconds (second pass)
Michael Jordan, full career output including playoffs: 151 seconds (first pass) / 123 seconds (second pass)
Michael Jordan, full career team mate output (1 game requirement): 183 seconds
Michael Jordan, full career opponent output (20 game requirement): 331 seconds
Michael Jordan, full career opponent output (10 game requirement): 1185 seconds
Michael Jordan, full career opponent output (1 game requirement): 2.5 hours (loops over the data many, many times)
Last edited by dwayne2005 on Sat Feb 24, 2018 6:49 am, edited 3 times in total.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby Dee4Three on Sat Feb 24, 2018 6:29 am

This is great work and dedication on your part. When its complete I may check it out. Some of this could be helpful as I do daily fantasy lineups.

Im sure jumping into this project was scary (Not having programming knowledge). But clearly you are making strides.
"I don't know if I practiced more than anybody, but I sure practiced enough. I still wonder if somebody - somewhere - was practicing more than me." - Larry Bird

Check out my YouTube channel

https://www.youtube.com/channel/UCvHJXrqit8Dc6HBY5P6EmAA


Follow me on Twitter

https://twitter.com/Dee4Three84
User avatar
Dee4Three
NLSC Team Member
NLSC Team Member
 
Posts: 9673
Joined: Sun Mar 30, 2014 12:34 pm
Location: New Hampshire, USA

Re: Making my own basketball statistics program

Postby dwayne2005 on Sat Feb 24, 2018 6:37 am

I used to toy around with programming on the Amiga and C64 many years ago, but didn't get very far.

An example (computer voiced):

phpBB [video]


Blocks vs Steals analysis Part 1 (turns out blocks are more or less the same value between point guards and centres but steals seem to be far more valuable for point guards than they are centres):

phpBB [video]


Blocks vs Steals analysis Part 2:

phpBB [video]


Bare (actually, should be bear) in mind, the second row of calculations are customizable.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Wed Feb 28, 2018 2:39 am

Latest version.

http://www.mediafire.com/file/9ff63671k ... tatsCY.zip

I've been working hard trying to fix features. The latest is I've got the G (graphs button; I haven't worked on graphs since the start of this thread) turn into A and B when TMM (team mate) and OPP (opponent) searchs are made. There are two players on each entry, and this just switches between one or the other in regards to the range operation. But it won't sort that player or create splits based on that player yet.

I tried working on a video (by the way, I meant Frye was better for the Cavs not Thomas in the video; parenthesis isn't voiced very well) to show how to use all the features and why things do what, but fixing other stuff took too much out of my time to get it finished.

+ and - before the player name (no space between + or -, so eg "-Isaiah Thomas") will add (show only the games that player played in) or remove (show only games that player didn't play in). I didn't want this to bring up the multiple player display where you can compare added players because there is value in having standard stats as well, so in order to see the players stats side by side you need to perform a TMM or OPP search.

So let's say you wanted to find out what Jordan and Pippen averaged against Karl Malone and John Stockton. First you'll type in the main search of "Michael Jordan". Then you can type in any order: "+Scottie Pippen", "+John Stockton" and +"Karl Malone". After each addition you enter in, you get a pop up asking you if you want to add the player as a team mate or an opponent. If you're not careful, you'll wind up mistakingly selecting an opponent as a team mate and get a blank screen.

This will give you only Jordan's stats. In order to find out what all 4 players averaged against one another, you perform either a TMM or OPP search on this data. In order to do this, you need to set a minimum amount of games in the small black area to the right of OPP. Since the data has been filtered down from over 1000 to just 30 games (if you included playoffs) a 1 will be sufficient. This will bring up the stats of those 4 players plus any combination of 5th player, either on the team if TMM is selected or OPP if opponent is selected. If you want the combination to be of just 4 players, type in just two of the additions and run the search to fill in the last player.

In case it seems rather random, the reason why the numbers in the range boxes change colour after running a filter (R-S or range-split) operation is because the new data has different ranges. A red colour means the data is out of the range of the new (filtered) data. A yellow colour means it is inside the range. Next to R-S is a R button. Left clicking this sets the new min and max values corresponding with the current data. Right clicking resets it so the new search is performed on the full range of data. Leaving it as it is allows you to fine tune a previous search.

I am colour blind and I get the feeling there might be colour issues here that I don't see when it comes to red, green or mixtures (eg. purple, orange).

Once again, CTRL is copy to clipboard. If you perform a time consuming search and want to revert, switching between per game (P/G) and per minute (P/M) and back again seems to do the trick. Sometime I done broke right clicking adding of player and team mate / opponent specific filtering.
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

Re: Making my own basketball statistics program

Postby dwayne2005 on Fri Mar 02, 2018 2:36 am

Fixed the issues, and a bunch more which became apparent. But button clicking negating players is currently broken. I'm going to change is so it negates the selected filtered games.

---

I tweaked the 'shooting efficiency' formula to reflect true shooting at 0.44*FTA. I don't like using guestimates to account for and-1's.

EDIT: There is a bug when clicking around that causes the program to hang forever. It is part of the changes I was making and I'll figure out what I overlooked next time. I'll also look into adding back and forward next time.

UPDATE: Fixed a bunch of stuff and most of the way to make it remove custom filters from the data for team mates and opponents. Problem is, it is compiling differently from Gamemaker to YYC. It is fine in standard Gamemaker, but with YYC something is triggering massive loops and hangs. Since I do most of my testing on the faster to compile method, I miseed it whatever it was. I will need to spend a lot of time just trying to figure it out.

UPDATE: For some reason, have two WHILE loops which were asking that it keep repeating while the column was >"" was triggering a malfunction. It seemed like it was continuing to loop passed the data?
dwayne2005
 
Posts: 263
Joined: Fri Aug 29, 2008 2:00 pm

PreviousNext

Return to NBA & Basketball

Who is online

Users browsing this forum: No registered users and 12 guests