Code: Select all
Select Case .PPOS
Case 0
ideal = 3
playerarray = GetPlayers2(dbhandle, dbhandle2, 0)
For i = 0 To UBound(playerarray)
ratingsum1 = ratingsum1 + playerarray(i).POVR
Next
If .TGID <> TGID_ Then
ratingsum1 = ratingsum1 + .POVR
End If
temprate = ideal * passpct_ * (.POVR / ratingsum1) * (OffenseCoaching / 100)
End Select
This is a small snippet of the code which is putting a trade value on the player. There are many other factors which go into the final figure....
First part, Case 0, refers to position 0, the QB, and therefore this formula will be applied to the player in question if he's a QB. "Ideal" represents the ideal number of players at this position. If you follow the math, you'll see that if there are fewer than 3 QBs on the team, this player will be valued slightly higher, if there are more, the value will be lower. (Think of a pie which represents the total rating of all the QBs; the QB being evaluated will be a slice of that pie.... and the slice will be bigger or smaller depending upon the # of players.)
The playerarray=GetPlayers2... line tells the program to get every player on the team in position 0.... a collection of all the team's QBs.
We then go thru each of these QBs and add his OVR to a running total.
The "if tgid<>...." line means, if we are evaluating a QB who is on a team other than our team, we're going to tally his OVR in anyway. In other words, we're looking at the QB's value if he were to become a part of this team.
It ends with the formula:
temprate = ideal * passpct_ * (.POVR / ratingsum1) * (OffenseCoaching / 100)
passpct_ = the percentage of pass which is in the coach's philosophy. Those of you who are familiar with the NZA Editor will recall that this is part of the pass/run set of inputs, of which one is read-only..... you type the value into one, hit save, and the other field is adjusted accordingly.
(.POVR / ratingsum1) means this player's OVR, divided by the sum of all the OVRs. In effect, this determines how big his "slice of the pie" is.
OffenseCoaching is meant to determine how offense-minded the team is. Some head coaches will be offense-oriented, others defense-oriented, and Madden has a rating for this. We pull this value for the head coach, but we also pull the value for the offensive coordinator and we give twice as much weight to that one. If the head coach has only a 40 but the offensive coordinator is an 85: (40 + 85 * 2) / 3 = 70 offense rating.
I plan to write one of these for each set of positions..... they will differ somewhat from each other. I'll have to come up with more complex equations for OLs, dealing not only with OVR but with pass and run blocking.