Extra FG kicked in OT

User avatar
Admin
Site Admin
Posts: 4229
Joined: Sun Sep 24, 2017 11:05 pm

Re: Extra FG kicked in OT

Post by Admin »

OK, this turns out to be the result of a design flaw. I can fix it for now with an ugly hack but it's the last straw telling me it's time to pull this thing apart and redesign it.

Here's the meat of it:

The game engine has a series of "flags" to account for various events: Whether a penalty has occurred, whether a touchdown has occurred, whether a turnover has occurred, etc. After the ball is dead, the game takes actions based on these flags: applying penalties, changing possession, changing the direction of the offense, etc.

The skeleton of the game was built very quickly, using a routine that just randomly moved the ball so I could hammer out the basics of advancing downs, changing possession, going through quarters, etc. The rest of the game is bolted onto that framework. But some good design principles fell by the wayside in the process.

For example, the kicking routine was the very first part of the game designed, and it is the best and most robust part of the game. It was flowcharted, researched, designed carefully, tested as an independent unit until it worked perfectly. The ball is tracked in 3D space from the kicker's foot to the goalposts. It took 6 months.

If I took 6 months designing each aspect of the game, it would never have gotten finished. So the rest of the game got added on in fits and spurts, and is a bit disorganized now. Which is why it is now so hard to add what sounds like a simple thing, like a new formation: There are so many workarounds and special cases, and Java has a limit to how big any one module can get.

So back to the point.

In that early skeleton, I started calling the change possession routine directly. Once I added penalties on, though, things needed to be reversible. So they were rebuilt to use the flag system. Except that bit of code that was the middle of the skeleton, the advanceDown routine, still does things directly on a 4th down turnover from scrimmage. It never sets the doTurnover flag, and overtime is depending on that to detect the end of possession. (I probably didn't bother because the defense will always decline a 4th down penalty, so it didn't need to be flagged for reversibility.) And of course the offense will never punt in that situation. But I can't just set doTurnover now because it will undo what advanceDown does, and I can't just set doTurnover from advanceDown now because I need to trace through all the bolted on parts to make sure it won't muck anything else up. It's just bad code, and it needs to be redesigned so every module is an independent black box like the kicking routine is.

Anyway, I've put in an ugly hack (a special flag just for that situation) that should fix it. But I need to get in there and rebuild it.

(On the plus side, while I was in there I may have found and fixed the fumble in the end zone bug.)

Chris
To help us serve you better, please use the support system for all questions or problems. PMs should NEVER be used. The Support system is always read before PMs.
cjisboss
Posts: 51
Joined: Thu Oct 05, 2017 3:03 pm

Re: Extra FG kicked in OT

Post by cjisboss »

I know what your going through. I was a programmer/systems analyst/section supervisor for 35 years, doing programming that whole time. I once had a program I made a minor change to, recompiled it and then tested. It ended up doing the same thing before the the change. I looked at my code and didn't see why my change wouldn't work. So, I just recompiled it again (without doing anything else) and tested it. It then worked fine. I was on an IBM mainframe (called an enterprise server now) and writing in COBOL. As I found out through the years, you work with something that is supposed to be logical and sometimes it does the most illogical things.

cjisboss
User avatar
Admin
Site Admin
Posts: 4229
Joined: Sun Sep 24, 2017 11:05 pm

Re: Extra FG kicked in OT

Post by Admin »

cjisboss wrote: Wed Sep 19, 2018 3:45 pm I know what your going through. I was a programmer/systems analyst/section supervisor for 35 years, doing programming that whole time. I once had a program I made a minor change to, recompiled it and then tested. It ended up doing the same thing before the the change. I looked at my code and didn't see why my change wouldn't work. So, I just recompiled it again (without doing anything else) and tested it. It then worked fine. I was on an IBM mainframe (called an enterprise server now) and writing in COBOL. As I found out through the years, you work with something that is supposed to be logical and sometimes it does the most illogical things.

cjisboss
Yeah, I did some time on COBOL on a System/36 and an IBM 4341. That was just college work, though, never used COBOL in production. I wrote a couple of business apps in QuickBASIC before I switched over to network management (after a brief detour into PickBasic on a Burroughs system, and writing print routines directly in PostScript); by the time I was writing business code again it was Microsoft VBScript and T-SQL on the server and JavaScript (well, JScript, Microsoft's flavor) on the client, while my hobby programming (primarily DWJukebox and an RPG that was never released) was all done in C (not C++, old school procedural C). Prior to college, it was BASIC and 6510 Assembler on a Commodore 64.

Chris
To help us serve you better, please use the support system for all questions or problems. PMs should NEVER be used. The Support system is always read before PMs.
cjisboss
Posts: 51
Joined: Thu Oct 05, 2017 3:03 pm

Re: Extra FG kicked in OT

Post by cjisboss »

Aaahh, the good old days. In college I took a couple of coding classes in FORTRAN. No university that I know of even offered any kind of IT degree at that time. Anyway glad you came up with a solution. Also, been there done that with looking at one problem and finding another.

cjisboss
User avatar
Admin
Site Admin
Posts: 4229
Joined: Sun Sep 24, 2017 11:05 pm

Re: Extra FG kicked in OT

Post by Admin »

This bug changed the result of a game in the FHFL today.

Chris
To help us serve you better, please use the support system for all questions or problems. PMs should NEVER be used. The Support system is always read before PMs.
Post Reply

Return to “Football Beta Testing/Development”