jleonard2099 / LHG_Football

Lance Haffner 3-in-1 Football
GNU Affero General Public License v3.0
2 stars 0 forks source link

QB rushing attempts are too frequent #10

Closed jleonard2099 closed 7 months ago

jleonard2099 commented 1 year ago

The AI favors QB runs more frequently than normal

Considerations

Plans to Fix

jleonard2099 commented 9 months ago

After closely evaluating code used to track QB rushes and determine when they scramble, I found the logic reasonable. I then simulated a wider variety of seasons than before logging this issue.

Once I evaluated the results of those various simulations, attempts are definitely higher than real-world, but not exactly by double. Instead, the increases are anywhere from 15 to 50% higher than actual.

My best theory at this point now, is that difference can be chalked up to the fact that QB rushes happen as part of the running back contribution, but IN ADDITION TO THAT are the QB rollouts and keepers. But in real life, this is part of those contributions.

The way that the game flows with rollouts and KB keepers seems fairly accurate, and is related to the QB mobility. So the best fix I can see is to artificially reduce contribution % of QB's for "run plays" (I believe skipping them altogether will result in too low a turnout).

One related thing to investigate is the use of QB mobility for autoplay. As I believe it gets assigned 0, I would expect it not to factor in to the rollout / keeper situations. However, I think it should...meaning I have to figure out the stats discrepancies.

jleonard2099 commented 9 months ago

The final results of all playbacks are in replays are coming in consistently higher than expected - by up to 20%

The working theory at this point is the one that seems most likely. The AI does a good job of recreating regular plays turning into QB keepers, but these plays are adding on top of the rusher contribution %.

In the game, all QB rush attempts are tallied properly, but we need to evaluate when and how they're recorded.

We need to do a few things to check the accuracy of this: 1) Be sure that stats are being tracked correctly per College / NFL methods

One way of artificially reducing runs by a QB is to simply have a different outcome in X% of Rush plays involving the QB.

jleonard2099 commented 7 months ago

After some further analysis of the code, I am confident that stats are being tracked correctly (as far as sacks are being treated as run plays for College)

This leaves me to evaluate the recording of stats for players from different team years / eras.

Of importance are to review teams from the 80's, early 90's (Haffner) Then review teams from the late 90's, 00's, etc. (Community)

Per the manual, QB rushing attempts for College should be 14% lower b/c of the inclusion of sneaks / rollouts as rushes.

If this has held consistent over the years, then the game is likely operating fine and the increased attempts may just be 'randomness'.

This has me thinking, should we not record stats as is and then, if it's NCAA rules, reduce QB contributions? But that's harder to do because 14% of 1 QB's attempts is x% of a team's contributions. ???

jleonard2099 commented 7 months ago

After the latest full blown review of some generated stats, this is inflated. Replay data actually seems most accurate for teams where the QB rushing attempts were not put in! This has me believing that certain years teams were entered in with an awareness of this mechanic.

Once we find the source of this issue for certain, we need to not only fix it but also correct the entry of teams that were not done correct. (The example in my case is 1993 teams)

At this rate, it seems most likely that the code is simply determining when to do a rollout way too often for computer play.

I think this has been hinted at before, but the frequency of it determining rollouts is likely very accurate for real play, but then those attempts get added into regular "rush" plays where the QB is considered.

A closer evaluation of the code for determine rollouts, or a modification of the PC routine for picking the QB as a rusher, needs to be the focus from here,

jleonard2099 commented 7 months ago

A tiny bug was found in the code for deciding when to do a rollout. "I" was the variable used to generate a random # in previous code, and at some point I replaced that with RN0 (for obvious reasons). Once instance apparently didn't get replaced.

Since updating that , generated schedules / stats are somewhat closer to a reasonable range for teams after 2000. It seems less accurate for teams prior. Contribution % seems okay overall but # of attempts is higher for some QB's and lower for others.

jleonard2099 commented 7 months ago

More quarterbacks have been analyzed from the generated stats and I'm now feeling more confident that these results are within reason of a realstic replay.

There are outliers so far, but it's not clear that is the impact of the code.

With that, I'm closing this issue. If I sense something off again, a new approach will be needed.