Skip to content

Commit

Permalink
Fix AV for kickers and punters in very long/short seasons
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Oct 22, 2024
1 parent 295d6ab commit 15b2d25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
14 changes: 11 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
add option to make rookie contracts not signed, even if there is no hard cap https://discord.com/channels/@me/1256311871980441670/1297925653685080136

get rid of checks for raw state/province names https://old.reddit.com/r/ZenGMHockey/comments/1g57hg5/if_you_make_a_real_state_a_new_country_you_cant/
- still need to check for 2 letter abbrevs, cause that's what alexnoob uses. make sure about that though
- maybe only do this if it's in playerBioInfo, like if there is a country called Maryland

Don't allow play if versions in tabs don't match
- close worker?
- newPhasePreseason being called twice in two different tabs and somehow updating the database twice?

on trade graphs, don't use 0% and 100% as limits for wins graph https://discord.com/channels/290013534023057409/331882115119448065/1295991083637149829

wOBA, wrc, wrc+
Expand Down Expand Up @@ -1419,6 +1429,7 @@ add some more built-in teams
- Jerusalem or Tel Aviv, Israel
- Taipei, Taiwan
- Antarctica Penguins
- Maybe redo the LA Earthquakes and Philly Cheesesteaks. Maybe with new team names too?
- ZenGM
- suggestions: https://mail.google.com/mail/u/0/#inbox/FMfcgzQVwnbtxLFxRJvngPQlqJdrWdWN

Expand Down Expand Up @@ -2175,9 +2186,6 @@ https://developers.google.com/web/fundamentals/app-install-banners/
after preseason, after player development, recalculate player value
- use ovr vs PER formula, but with offset based on prior value

Don't allow play if versions in tabs don't match
- close worker?

---

React.StrictMode
Expand Down
11 changes: 4 additions & 7 deletions src/worker/util/advStats.football.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ const calculateAV = (players: any[], teamsInput: Team[], league: any) => {

// Kicking
{
// Ignore schedule length normalization

const kPlayingTime =
p.stats.xpa +
3 *
Expand All @@ -235,15 +233,14 @@ const calculateAV = (players: any[], teamsInput: Team[], league: any) => {
paaTotal += 3 * (p.stats.fg50 - p.stats.fga50 * league.fgp50);

const pctTeamPlayingTime = kPlayingTime / t.stats.kPlayingTime;
const avgAV = 3.125 * pctTeamPlayingTime;
const avgAV = (3.125 / 16) * t.stats.gp * pctTeamPlayingTime;
const rawAV = avgAV + paaTotal / 5;
score += rawAV;
score += (16 * rawAV) / t.stats.gp;
}
}

// Punting
{
// Ignore schedule length normalization
if (
p.stats.pnt + p.stats.pntBlk > 0 &&
t.stats.pnt + t.stats.pntBlk > 0
Expand All @@ -255,9 +252,9 @@ const calculateAV = (players: any[], teamsInput: Team[], league: any) => {
(p.stats.pnt + p.stats.pntBlk) * (adjPntYPA - league.adjPntYPA);
const pctTeamPlayingTime =
(p.stats.pnt + p.stats.pntBlk) / (t.stats.pnt + t.stats.pntBlk);
const avgAV = 2.1875 * pctTeamPlayingTime;
const avgAV = (2.1875 / 16) * t.stats.gp * pctTeamPlayingTime;
const rawAV = avgAV + adjPuntYdsAboveAvg / 200;
score += rawAV;
score += (16 * rawAV) / t.stats.gp;
}
}

Expand Down

0 comments on commit 15b2d25

Please sign in to comment.