Infinity on Trial wrote:
There seem to be two key points in this thread that have consensus agreement:
AI should retain its players.
AI should not go over projected salary cap.
What say you, JDB?
This is actually what has always been -attempted- with the AI logic. The problem comes as someone mentioned that I've not been able to come up with a set of rules that seems to work.
Players make requests based on other salaries in the league + a base distribution of salaries based on position. The AI will offer players the salary that they request, and should not make requests that take them over the cap. (If the AI is indeed signing to go over the cap then that's behavior that broke at some point, because that was always intended to be a requirement for AI signings). The AI will also try to retain all of its players unless they are asking more than the AI can fit under his cap. The problem that I've found is that all of this, when you are a human, has a great degree of intuition that I've not found a way to programmatically simulate.
In general, the FA algorithm is below. Note that this is different than the roster size check algorithm which will cut players to get the cap low enough to fill a minimum roster size, but as the players get cut we run the FA algorithm. This is also the FA algorithm, except for step #1, that will be run if a human controlled team is below the minimum roster count.
1. Check to see if any players are in their last year of a multi-year contract and have a future value of greater than 50, and if we have the cap room to make the offer, then offer them the contract.
2. Check how many more players we need to get to minimum roster size and set our max offer to be equal to the remaining cap room divided by that.
3. If our max offer is less than the minimum salary offer, we do nothing more.
4. Count the number of players in each position, and compare this against the recommended players at each position to assign each position a weight ("position" here is actually a position group, i.e. OL as opposed to C, G, T, etc)
5. Also as a weight is the importance of each player (i.e. we may not pursue a FB even if we have no FB unless there is a very good FB available).
6. Using #4 and #5, each position is given a weight, and that is applied to the available free agents by multiplying the position weight with the future value to determine who is priority to sign.
7. Whoever is at the top of this list gets an offer, and this is repeated until we run out of cap room or have the maximum roster size.
I find the biggest issue is #5 in this list, as the algorithm is very complicated already. Probably just needs to be rewritten and simplified. Some of the ability to simplify this calculation is riding on an update to the website itself that will make it easier to manage the calculations.