I’ve finally finished debugging all the jobs I added. A few notes:
First, cornerback coverage is, in one sense perfect. The trick of course, is to have cornerbacks cover in believable imperfect ways. To that end, their logic will be changed from essentially a MoveToMan system, to a MoveToWhereYouThinkManWillBe system. That requires knowledge of reciever routes.
More broadly, I think I’m going to need to add 16 Boolean flags to get the job system working totally properly.
I also want to add a Boolean for each offensive player: isEligible, which allows the defense to only react to eligible recievers when in zone, instead of my ugly “just don’t respond to the first 7 players” system. Finally, I don’t want multiple players on defense covering the same player. I don’t think adding a Boolean for this is appropriate, since I’ve gone through the side effects and they aren’t easy to solve. I would need extra logic so that the player doesn’t look at the player he’s covering, see that he’s covered, and stop covering him, alternating this every frame. I would also need to make sure that players aren’t just switching off men because their zones overlap and the linebacker marks players first. I understand that last one is hard to understand, but I understand it just fine in my mind.
I also think that this may be a non-issue, since players zones rarely overlap in real life anyways. The current logic may be just fine for that then. There is only the slight problem that players who are closer to the QB (not in position, just in the class itself) are going to be switched off for preferentially. That is a very solvable problem, although not a pressing concern right now.
As for the changes, there isn’t that much to see, but the plays do actually work now. I still need to add a tonne of graphics, sound, different plays, collision detection, running defense, ball physics, player physics, lots more jobs, and many other things, but I’m happy of what I’ve accomplished so far and proud.
Pre Snap: Everyone is lined up correctly, same old
Post snap: Cornerbacks play tight man coverage, LB’s and S’s play zone. Defensive line move to the BGapLeft, which is enourmous since the center is moving forward. They will have their “desire” to be there diminish quickly with time when I add other things like ball carrier tackling to the game. Best of all, although not captured here, the recievers are now running slant routes, using a possible candidate for part of the pathfinding subsystem. The HB runs to the B gap where it was before the snap and stays there, which is a crude B gap run play but works for now. The QB drops 7 and stays there.
Edit: All the DLinemen have been assigned to the same gap, and there’s no collision detection, so they can all occupy the same space. Fixing this is just a matter of implementing more then the testing jobs that I implemented so far.