-
Notifications
You must be signed in to change notification settings - Fork 150
Issue #431 Add force retire season #455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
const age = g.get("season") -p.born.year; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about it for this PR, but it's weird to see formatting like this because Prettier should be running every commit...
if (forceRetireAge >= g.get("draftAges")[1] && age >= forceRetireAge) { | ||
return true; | ||
} | ||
|
||
if (p.stats.length >= forceRetireSeason) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work correctly.
p.stats
is not 1-to-1 with seasons. You get an extra entry if you're traded mid season, and you get an extra entry if you make the playoffs. Easy fix to that would be to count the unique seasons in p.stats
Also, in a new league p.stats
is empty. So like for a league in 2023, it generates players from draft classes back to 2019... but then this condition won't trigger for any of them until possibly 4 years in the future. That's probably not what anyone wants.
We could make it based on draft year (assume rookie season is 1 year after draft), which would mostly work. But if people use this to simulate college, they would ideally want the ability to have a red shirt year. So if there is at least one year with 0 games played, it could give that player one extra year before retiring. I think that's probably what most people would want, because IIRC you get only one red shirt year in college, but I could be wrong.
This would also need a special case to handle new leagues, where p.stats
is empty. You wouldn't want to assume that every single player had a red shirt year. So you'd probably only want to grant the red shirt year if a season is greater than or equal to g.get("startingSeason")
.
Does that make sense? It does get a little complicated, I could be missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally did it based on draft year but it absolutely massacred the real rosters, which maybe is ok just kind of up to you I guess. I did some manual testing with p.stats and trading mid season and it seemed as though it didn't count it twice but I guess it was some sort of other weird thing. I kind of erred on the side of retiring them after X years of actual playing in the simulation vs X years of theoretical years in the game world but maybe its better to do it that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill do it based on draft year with the red shirt clause for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think doing it on draft year makes the most sense. It will result in real players leagues seeing a ton of retirements, but I'm not sure anyone would actually want to use this with real players. But people would want to simulate a high school or college league.
new logic to retire after seasons
Ok it has been updated to use draft year and give a redshirt based on the number of unique seasons. I tried to come up with a clever way to count unique seasons to avoid iterating through them all but wasn't able to find one. |
ok should hopefully meet all requirements now |
I realized that in my code I forgot to do what I mentioned previously about startingSeason (don't count seasons before startingSeason as potential redshirt seasons, otherwise everyone would get a redshirt season in a new league). So I added that and renamed the variable to I will merge it soon, and then it'll be in the next update - not sure exactly when, but pretty soon. If you'd like to test the final version, please do, and please let me know if you notice any problems! And thank you! If you're interested in doing other stuff, feel free to talk to me about ideas. |
wowee when you think updates coming out |
#431