toolie Posted December 8, 2013 Share Posted December 8, 2013 So I'm a math guy, and I was interested in the problem of what the distribution of conditions would approach as the season goes on. Currently, with two games to play in week 15 of WTF: 2.0 (which tracks conditions), the distribution of conditions is this... 600 total players (20 teams, 30 players per team). Bad ( : 123 (20.5%) Average (A): 215 (35.8%) Good (G): 184 (30.7%) Excellent (E): 68 (11.3%) Injured (I): 10 (1.7%) From the forums, I read (via bruddog) that the chances of changing conditions goes like this: B: 25% stay in bad, 75% move to average 0% move to good, 0% move to excellent A: 25% move to bad, 50% stay in average, 25% move to good, 0% move to excellent G: 0% move to bad, 25% move to average, 50% stay in good, 25% move to excellent E: 0% move to bad, 0% move to average, 75% move to good, 25% move to average To model the flow of conditions, I used a very simple model that neglects injuries. The flow can be modeled using a 4x4 matrix T and a 4x1 conditions vector v, where the columns of the matrix T contain numbers based on the above percentages that sum to one, and the conditions vector v holds the number of players in each condition. At the start of the season, the conditions vector v = [0, 600, 0, 0] since everyone is in A. I'm writing this as a row vector for convenience, but for the matrix multiplication it needs to be a column vector. After each quarter, we perform the multiplication T*v, which produces the theoretical distribution of players after conditions change. After one quarter, v = [150, 300, 150, 0]. After two quarters, v = [112.5, 300, 150, 37.5]. After three quarters (and hence the first game, since conditions don't change after the 4th quarter) v = [103.125, 271.875, 178.125, 46.875]. So we have fractions of players in each state, which seems silly, but that's just a slight downside of the modeling process. After six games of this iterative process (just taking the output vector and hitting it with the matrix T 18 times) the distribution has settled in to be roughly v = [75.09, 225.16, 224.84, 74.91]. So it looks like the steady-state distribution of players would be v = [75, 225, 225, 75]. This is the case for this model. If we hit that vector v with T the output will not change. We can also show this using some matrix algebra, but we'll skip that for now. So the steady-state percentages for the distribution in this model are 12.5%, 37.5%, 37.5%, and 12.5% (1/8, 3/8, 3/8, 1/8). Our actual percentages are currently 20.5%, 35.8%, 30.7%, 11.3% (with 1.7% injured). After 15 weeks the system has had a lot of time to approach a steady-state distribution, if there is one, so injuries seem to make a significant impact on the numbers, or the system is just currently in a state of bias towards bad conditions. Improving the model to incorporate injuries seems doable enough, but there will be MANY more states due to the fact that you can't return from injury after every quarter. There is probably a way to incorporate injuries in an average sense, which would reduce the number of states (and hence the size of the matrix and vector) but I'd have to think about how to do that a bit more. One way to eliminate injuries is by taking out the players that can get injured (QB,RB,WR,TE). That leaves 18 players per team (360 total). The current distributions there are B: 20.3% A: 35.3% G: 32.5% E: 12.0% Pretty similar to the numbers with everyone involved, but not too far from the steady-state values. This season it looks like these non-injury-prone players as a whole have had slightly bad luck. buck, kamphuna8, vikingmoe02 and 1 other 4 Quote Link to comment Share on other sites More sharing options...
bruddog Posted December 12, 2014 Share Posted December 12, 2014 So I'm a math guy, and I was interested in the problem of what the distribution of conditions would approach as the season goes on. Currently, with two games to play in week 15 of WTF: 2.0 (which tracks conditions), the distribution of conditions is this... 600 total players (20 teams, 30 players per team). Bad ( : 123 (20.5%) Average (A): 215 (35.8%) Good (G): 184 (30.7%) Excellent (E): 68 (11.3%) Injured (I): 10 (1.7%) From the forums, I read (via bruddog) that the chances of changing conditions goes like this: B: 25% stay in bad, 75% move to average 0% move to good, 0% move to excellent A: 25% move to bad, 50% stay in average, 25% move to good, 0% move to excellent G: 0% move to bad, 25% move to average, 50% stay in good, 25% move to excellent E: 0% move to bad, 0% move to average, 75% move to good, 25% move to average To model the flow of conditions, I used a very simple model that neglects injuries. The flow can be modeled using a 4x4 matrix T and a 4x1 conditions vector v, where the columns of the matrix T contain numbers based on the above percentages that sum to one, and the conditions vector v holds the number of players in each condition. At the start of the season, the conditions vector v = [0, 600, 0, 0] since everyone is in A. I'm writing this as a row vector for convenience, but for the matrix multiplication it needs to be a column vector. After each quarter, we perform the multiplication T*v, which produces the theoretical distribution of players after conditions change. After one quarter, v = [150, 300, 150, 0]. After two quarters, v = [112.5, 300, 150, 37.5]. After three quarters (and hence the first game, since conditions don't change after the 4th quarter) v = [103.125, 271.875, 178.125, 46.875]. So we have fractions of players in each state, which seems silly, but that's just a slight downside of the modeling process. After six games of this iterative process (just taking the output vector and hitting it with the matrix T 18 times) the distribution has settled in to be roughly v = [75.09, 225.16, 224.84, 74.91]. So it looks like the steady-state distribution of players would be v = [75, 225, 225, 75]. This is the case for this model. If we hit that vector v with T the output will not change. We can also show this using some matrix algebra, but we'll skip that for now. So the steady-state percentages for the distribution in this model are 12.5%, 37.5%, 37.5%, and 12.5% (1/8, 3/8, 3/8, 1/8). Our actual percentages are currently 20.5%, 35.8%, 30.7%, 11.3% (with 1.7% injured). After 15 weeks the system has had a lot of time to approach a steady-state distribution, if there is one, so injuries seem to make a significant impact on the numbers, or the system is just currently in a state of bias towards bad conditions. Improving the model to incorporate injuries seems doable enough, but there will be MANY more states due to the fact that you can't return from injury after every quarter. There is probably a way to incorporate injuries in an average sense, which would reduce the number of states (and hence the size of the matrix and vector) but I'd have to think about how to do that a bit more. One way to eliminate injuries is by taking out the players that can get injured (QB,RB,WR,TE). That leaves 18 players per team (360 total). The current distributions there are B: 20.3% A: 35.3% G: 32.5% E: 12.0% Pretty similar to the numbers with everyone involved, but not too far from the steady-state values. This season it looks like these non-injury-prone players as a whole have had slightly bad luck. I was wrong I finally figured out the condition code routine B: 75% stay in bad, 25% move to average 0% move to good, 0% move to excellent A: 12.5% move to bad, 75% stay in average, 12.5% move to good, 0% move to excellent G: 0% move to bad, 12.5% move to average, 75% stay in good, 12.5% move to excellent E: 0% move to bad, 0% move to average, 25% move to good, 75% stay in excellent kamphuna8, TimBone, vikingmoe02 and 2 others 5 Quote Link to comment Share on other sites More sharing options...
brookstonfowler Posted December 12, 2014 Share Posted December 12, 2014 wow. that makes more sense of why guys stay in Exc for a few games at a time. i'm sure you guessed my next question. is there a way to tweak the %'s? Quote Link to comment Share on other sites More sharing options...
bruddog Posted December 12, 2014 Share Posted December 12, 2014 Ya i made a simulation in excel and you can see guys stay in conditions for a long period of time. L_17_A395: ; UPDATE CONDITION ROUTINE LDA #$80 ; Allow SRAM write STA PRG_RAM_PROTECT ; LDA $70 ; save possesion byte in $42 STA $42 ; LDA #$00 ; SET TEAM to player 1 STA $70 ; @Loop1: ; CONDITION LOOP INIT LDA #$00 ; SET current player to first player STA $44 ; @Loop2: ; CONDITION LOOP WHILE LOOP LDA $44 ; LOAD current player to check JSR L_DE15 ; CHECK if player is injured(A=player) Carry set if injured LDA #$01 ; LOAD Average condition in case they are BCS @Loop6 ; Player injured? YES->BRANCH TO GET NEW CONDITION BACK TO APPROPRIATE NIBBLE JSR L_D8F7 ; LOAD more random rand number AND #$18 ; 25% chance of condition change (because 2 out of 8 bits being checked) BNE @Loop10 ; CONDITION CHANGE? NO-> BRANCH TO LDA $44 ; LOAD player JSR L_DE2F ; GET PLAYER CONDITION(A=Player) RET= A= nibble =Condition value STA $45 ; SAVE in $45= current condituib CMP #$00 ; PLAYER IN BAD? BEQ @Loop3 ; YES-> JUMP to LOAD 1 CMP #$03 ; PLAYER IN EXCELLENT? BEQ @Loop4 ; YES->PLAYER IN EXCELLENT LOAD -1 JSR update_random_3B ; ELSE IF PLAYER IN AVG/GOOD GENERATE -1 or 1 (even chance) AND #$02 ; SEC ; SBC #$01 ; JMP @Loop5 ; JUMP TO CURRENT CONDITION + VALUE @Loop3: ; LOAD 1 LDA #$01 JMP @Loop5 ;JUMP TO CURRENT CONDITION + VALUE @Loop4: ; LOAD -1 LDA #$FF @Loop5: ; CURRENT CONDITION + VALUE CLC ADC $45 @Loop6: ; GET NEW CONDITION BACK TO APPROPRIATE NIBBLE STA $45 ; LDA #$FC ; STA $43 ; LDA $44 ; EOR #$FF ; AND #$03 ; BEQ @Loop8 ; TAX ; @Loop7: ; ASL $45 ; ASL $45 ; SEC ; ROL $43 ; ROL $43 ; DEX ; BNE @Loop7 ; @Loop8: LDA $44 ; LSR ; LSR ; TAY ; BIT $70 ; PLAYER 1 or 2? BMI @Loop9 ; PLAYER 2-> BRANCH TO SAVE NEW CONDITION FOR AWAY PLAYER LDA $6503,Y ; SAVE NEW CONDITION FOR HOME PLAYER AND $43 ; ORA $45 ; STA $6503,Y ; JMP @Loop10 ; JUMP TO INCREMENT PLAYER AND CHECK IF DONE @Loop9: ; SAVE NEW CONDITION FOR AWAY PLAYER LDA $6608,Y ; AND $43 ; ORA $45 ; STA $6608,Y ; @Loop10: ; INCREMENT PLAYER AND CHECK IF DONE INC $44 ; increment to next player LDA $44 ; CMP #$1E ; All PLAYERS DONE? BCC @Loop2 ; NO->BRANCH to CONDITION WHILE LOOP LDA $70 ; Player 2 TEAM done? BMI @Loop11 ; YES->BRANCH to RESTORE POSSESSION BYTE, SET SRAM TO NO WRITE, AND RETURN LDA #$FF ; NO->SET Possession to player 2 STA $70 ; JMP @Loop1 ; JUMP TO CONDITION LOOP INIT @Loop11: ; RESTORE POSSESSION BYTE, SET SRAM TO NO WRITE AND RETURN LDA $42 ; STA $70 ; LDA #$C0 ; SET SRAM to NOT WRITEABLE STA PRG_RAM_PROTECT ; RTS ; RETURN Quote Link to comment Share on other sites More sharing options...
toolie Posted December 12, 2014 Author Share Posted December 12, 2014 (edited) So I redid the matrix with the new transition probabilities. After 6 games (3 condition changes per game) the actual conditions of non-injury prone players was B: 20.3%A: 35.3%G: 32.5%E: 12.0% And the computation (T^18)([0 1 0 0]') yields B: 18.2%A: 34.8%G: 31.8%E: 15.2% Pretty close to the actual distribution. Steady-state values for each condition (as t goes to infinity) given these probabilities are B: 16.7% (1/6)A: 33.3% (1/3)G: 33.3% (1/3)E: 16.7% (1/6) Edited December 12, 2014 by toolie bruddog 1 Quote Link to comment Share on other sites More sharing options...
bruddog Posted December 12, 2014 Share Posted December 12, 2014 Brookston, yes with the current model its possible for the conditions to stay at the same place for a very long time....Here is a spreadsheet tool to see the possibilities for players with a nifty graph included (kinda like the one for wtf except only one season long) Change C1 cell from 0(players never change) to (1) Players always change.. conditions_prob.XLS brookstonfowler 1 Quote Link to comment Share on other sites More sharing options...
joelcsuh Posted December 12, 2014 Share Posted December 12, 2014 Does this work the same in all versions? (I know it doesn't in the Genesis version of TSB III but I don't want to derail the thread.) I once had a season with the Chiefs in the NES version in which Stephone Paige was in Bad from week 2-17. Very frustrating. Never seen anything like it before or since. Quote Link to comment Share on other sites More sharing options...
bruddog Posted December 12, 2014 Share Posted December 12, 2014 This is only for the nes version. Quote Link to comment Share on other sites More sharing options...
segathonsov Posted December 23, 2014 Share Posted December 23, 2014 Kind of related question. Is there a "sweet spot" where a guy goes into Good/Excellent more? Example does QB1 and QB2 change conditions the same or does the computer favor one. From doing the conditions program sometimes it seems there is a pattern like RB1 and RB3 go into Bad at the same time. Quote Link to comment Share on other sites More sharing options...
bruddog Posted December 23, 2014 Share Posted December 23, 2014 There might be patterns because of the way the random number generation works but all of the positions have an equal chance. segathonsov 1 Quote Link to comment Share on other sites More sharing options...
BO FB Offtackle Left Posted January 8, 2015 Share Posted January 8, 2015 wow. that makes more sense of why guys stay in Exc for a few games at a time. i'm sure you guessed my next question. is there a way to tweak the %'s? Was it answered if there was a way to change the percentages? I might have missed it. If I could do whatever I wanted, I would do this: B: 25% stay in Bad, 75% move to Avg A: 12.5% move to Bad, 75% stay in Avg, 12.5% move to Good G: 75% move to Avg, 12.5% stay in Good, 12.5% move to Exc E: 75% move to Good, 25% stay in Exc Quote Link to comment Share on other sites More sharing options...
bruddog Posted January 8, 2015 Share Posted January 8, 2015 the way Conditions are done could be re-coded to just about anything. Quote Link to comment Share on other sites More sharing options...
toolie Posted January 8, 2015 Author Share Posted January 8, 2015 Was it answered if there was a way to change the percentages? I might have missed it. If I could do whatever I wanted, I would do this: B: 25% stay in Bad, 75% move to Avg A: 12.5% move to Bad, 75% stay in Avg, 12.5% move to Good G: 75% move to Avg, 12.5% stay in Good, 12.5% move to Exc E: 75% move to Good, 25% stay in Exc With these probabilities, the long-term distribution of conditions would be roughly Bad: 12% Average: 74% Good: 12% Excellent: 2% BO FB Offtackle Left 1 Quote Link to comment Share on other sites More sharing options...
bruddog Posted January 8, 2015 Share Posted January 8, 2015 I'd probably recode it to a normal distribution (13.5, 68, 13.5, 5 ) which is pretty close to what BO did. And also make it so that you can change into any condition at any time and have players start off with conditions in the first quarter. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.