jonesguy14 / footballcoach

Android App for playing/simulating/recruiting as a college football coach
Other
34 stars 8 forks source link

Teams Are Going For It On 4th Down When They Shouldn't #41

Closed destilla closed 8 years ago

destilla commented 8 years ago

For verification purposes, this one was a pain in the ass to track down buttttt --

I was building up an American Samoa dynasty when I lost a close game in OT to Los Angeles. I like to check out close game to see what went down and found this:

image

With a 3 point load on my own 18 yard line, with 17 seconds to play, they went for it on 4th and 7, failed, and gave up a tying FG.

Kinda butthurt, but really curious, I did some more investigation. I copy pasted an old version of the play by play debugger I made and set the OT news story to report any games with a turnover on downs by the leading team, and checked reported games between similarly ranked teams until I found this:

image

Red pen: 3rd and 9 from the 45, Seattle up 35, they gain 4 yards. 4th and 5, so they should be punting, as they aren't above the 65, 60, or 55 (so not going for it, not kicking a FG)

Blue Pen: 4th and 5...they got for it. Get 0 yards. Turn it over.

Black pen: The turnover on downs is logged.

I checked the logic and walked through it with a pen and a pad....everything seems normal. I can't figure out what's causing this one, and why it's so uncommon.

destilla commented 8 years ago

Another thought: The fact that the logger shows us that only 2 seconds were burned off means it had to be a passing play. So either somehow the evaluation of the first statement was true (the go for it on 4th down cause you need a TD) and selected a passing play, or, it got down far enough to choose a passing play like normal somehow.

destilla commented 8 years ago

Annnnnd figured it out; this is at the start of runPlay()'s play selection:

if ( gameTime <= 30 && !playingOT ) {
                if ( ((gamePoss && (awayScore - homeScore) <= 3) || (!gamePoss && (homeScore - awayScore) <= 3)) && gameYardLine > 60 ) {
                    //last second FGA
                    fieldGoalAtt( offense, defense );
                } else {
                    //hail mary
                    passingPlay( offense, defense );
                }
            }

So basically, if it's not OT, and there's less than 30 seconds to play, if you have the ball and you're not losing by 3 or less, you're going to throw up a hail mary. Which means, you may be ahead (because that's not losing by 3) with ball with under 30 to go, and you're going to throw until you turn it over or the clock runs out.

Pour one out for my shot at the conference title with Samoa :( but, MYSTERY SOLVED :D.

I'll fix and submit a pull req.

jonesguy14 commented 8 years ago

Fixed with commit fba0b9caa610ae8dde5185353c5c624862ea8099