r/BasketballGM 8h ago

Question oIQ seems to decrease 2pts efficiency

Post image

I was randomly looking at the code of the game engine (this is part of the index.ts file) this morning to understand a bit better what's happening under the hood.
I then realized that it is the same

p.compositeRating.shootingMidRange

which enters both the probability to take a mid-range, and the probability to make it.
The issue is that oIQ has a negative relation with the "midrange" composite rating:

shootingMidRange: {
ratings: ["oiq", "fg", "stre"],
weights: [-0.5, 1, 0.2],
},

Which is then multiplied with hardcoded values to get the raw chance of making the shot.

probMake = p.compositeRating.shootingMidRange * 0.32 + 0.42

So if I'm not mistaken, oIQ decreases the chance of taking a mid-range (which makes sense), but also decreases the chances of making it (which IMO makes no sense).

Can somebody confirm this?

More generally, if the probability of taking a shot is directly connected to the probability of making it, and if oIQ affects both equally.
Then, additionally to the counterintuitive effect on "midrange" seen above, it also means that players with good oIQ are going to take more "lowPost" shots than "atRim" (because oIQ has proportionally a bigger impact on "lowPost", than on "atRim"). But Layups are a much better shot to take than post shots, because of the existing prefactors in the "probMake" computation.
So you get this weird effect were a high IQ player will actually take less valuable shots.

Again, can somebody confirm I'm not mistaken?

If I'm right, I would suggest the following changes in the code logic:
- make all compositeRating for shooting positively affected by oIQ (I still think IQ should help you make better shots in general).
- add a new compositeRating.shotSelection which is mostly based on oIQ (and maybe Spd and Drb since it gives you more options).
- compute an expectedPointPerPossession for the player (taking into account FT), for each type of shot.
- use compositeRating.shotSelection and expectedPointPerPossession together to stir players shooting tendency towards their best shot.

I fully understand this is probably never going to happen, since it affects some mechanics which are at the core of the game engine. This is also not a critic of the godly work from Dumbmatter. The game is amazing, and I regularly have to force myself to stop playing, so I have time for other games.

Nonetheless, I think it would be a great idea, because it would make IQ behave a bit more like expected. It would also remove some weird behavior which you sometimes observe in game.
It all started with me seeing my 6'4 crazy fast guard deciding to try 2 post move per game for one layup attempt.
I then realized that his speed didn't help with layups (it should IMO), but was increasing the chances of post move. And then I saw that his 80 IQ was even reenforcing this behavior, while making him shot worse at 2pts....

Some side notes from my morning deep dive of the GameSim class, which I also found surprising:
- Blocking chance are the same at the rim and for 3pts.
- "probMake" is affected by the global defense value, for every type of shot: having a good rim protector will have the same defensive impact on post move and 3pts shots.
- Similarly, the chances of taking a shot at the rim or low post increase with offensive synergy and decrease with opponent global defense (not Di). 3pts is not affected by defense at all (and not by Dp).
- Steals are a ratio between Dp and B+Ps after synergies.
- Assists give +2.5% shot chance
- Something which could be a bug: 3pts tendancy uses "shootingThreePointerScaled2" which is lowered for bad 3pts shooters. But "probMake" the probability to make it uses "shootingThreePointerScaled" (no 2 here), which doesn't have the extra decrease for bad shooters. The result is that bad 3pts shooter take fewer 3pts, but shoot them at a higher rate than expected from the shot selection.

48 Upvotes

14 comments sorted by

23

u/guilhermessg 7h ago

Pretty interesting read, would love to read what dumbmatter has to say about it

3

u/Ohmka 4h ago

I would love him to share his thoughts on the matter as well!

7

u/dopestar667 6h ago

Re: blocking - this makes sense to me if the game respects matchups. A good blocker would block at the 3pt line or the rim, but only see block opportunities at the 3pt range if his man is out there tossing them too. Not sure if the game factors positional matchups though.

2

u/Ohmka 6h ago

As far as I understand the code, there is no individual match up.
The whole team "compositeRating.defense" applies as a direct negative modifier, added to the "probMake" value.

I think it's completely fine in general, since defense is really a team thing.
But it means that having a very bad defender is easily compensated by the rest of the team: there is no matchup hunting.

3

u/dopestar667 6h ago

Well, it affects the overall probability of a block happening, and the individual rating determines how gets credited, so overall it works in an abstract sim like this.

2

u/Ohmka 5h ago

Yeah I think it's completely fine.
I just found it interesting that a team that lives in the key will not get blocked more than one which is spamming 3s.

1

u/dopestar667 5h ago

Yeah, the game sim just works in the end, not necessarily how we’d expect it in real life but that’s how dumbmatter puts it together. It’s just a sim of a ton of probabilities, and as long as the box score generally reflects reality it’s good. It’s elegantly simple, could be deeper but it works so well for what it is.

1

u/Ohmka 4h ago

Fully agreed!
I was actually quite surprised to see that the play by play was what actually happens in the simulation… Because the result is extremely realistic!

These were just side notes that I though interesting. In my opinion, only the shot selection and IQ interaction is potential worth some changes.

6

u/Creepy_Action_8755 7h ago

Interesting observation, thanks for the work put in this

-24

u/dopestar667 6h ago

Quick way to get an answer would be to post your question and the relevant code into an AI and ask

7

u/Uebeltank 6h ago

It won't because you can't know for sure why the code was written in a specific way.

-15

u/dopestar667 5h ago

It can directly read the entire codebase and bring it all into context.

1

u/justadimestorepoet 0m ago

That doesn't tell us what dumbmatter himself was thinking, which is what we actually want to know.

Also, sounding like a prick is at least half the reason you're getting downvoted. If you were actually being helpful, the votes would be more forgiving.

-14

u/dopestar667 5h ago

So maybe luddites downvoting, I’ll do it myself and post the answers later today if I get time to do it.