Page 1 of 2

Player attribute maths

Posted: Fri Sep 09, 2005 12:19 pm
by Steve Camber
I've converted this from 68000 to C. Hopefully it's clear enough..

This is applied to the Shooting, Passing, Defending, and Keeping player attributes.

Code: Select all

unsigned int uiKO2Attribute=ScaleByAgilityAndMorale(uiPMAttribute)/2;

int ScaleByAgilityAndMorale(int iVal)
{
   iVal*=iPlayerAgility;
   iVal=SquareRoot(iVal);
   
   int iMorale=iPlayerMorale/4; //Morale is signed so goes from -128 to 127 (-32 to 31 after divsion)
   
   if (TeamA) iMorale=iMorale+10;  //THE "10%" ADVANTAGE. WHY OH WHY OH WHY....
   
   iVal=iVal+iMorale;
   
   //clamp between range of 0 and 200
   if (iVal>200)
         iVal=200;
   if (iVal<0)
         iVal=0;
   
   return iVal;
}


An afterthought.. By using this forumla and checking the Team A/B/N statistics, I guess it would be possible to create a big table of who can successfully tackle who :shock:

Posted: Fri Sep 09, 2005 3:31 pm
by Steve Camber
TeamA

Code: Select all

Player #00 : Shirtnum  0 : Tackling Score =   74
Player #01 : Shirtnum  0 : Tackling Score =   55
Player #02 : Shirtnum  1 : Tackling Score =   78
Player #03 : Shirtnum  0 : Tackling Score =  100
Player #04 : Shirtnum  6 : Tackling Score =  100
Player #05 : Shirtnum  0 : Tackling Score =   84
Player #06 : Shirtnum  3 : Tackling Score =   88
Player #07 : Shirtnum  2 : Tackling Score =   77
Player #08 : Shirtnum  0 : Tackling Score =  100
Player #09 : Shirtnum  5 : Tackling Score =  100
Player #10 : Shirtnum  4 : Tackling Score =   93
Player #11 : Shirtnum  0 : Tackling Score =   74
Player #12 : Shirtnum  8 : Tackling Score =   96
Player #13 : Shirtnum  0 : Tackling Score =   69
Player #14 : Shirtnum  0 : Tackling Score =   76
Player #15 : Shirtnum  7 : Tackling Score =   82
Player #16 : Shirtnum  0 : Tackling Score =   77
Player #17 : Shirtnum 14 : Tackling Score =   65
Player #18 : Shirtnum 12 : Tackling Score =   77
Player #19 : Shirtnum 11 : Tackling Score =   78
Player #20 : Shirtnum 10 : Tackling Score =   95
Player #21 : Shirtnum  9 : Tackling Score =   96


TeamB

Code: Select all

Player #00 : Shirtnum  0 : Tackling Score =   69
Player #01 : Shirtnum  0 : Tackling Score =   50
Player #02 : Shirtnum  1 : Tackling Score =   73
Player #03 : Shirtnum  0 : Tackling Score =   97
Player #04 : Shirtnum  6 : Tackling Score =  100
Player #05 : Shirtnum  0 : Tackling Score =   79
Player #06 : Shirtnum  3 : Tackling Score =   83
Player #07 : Shirtnum  2 : Tackling Score =   72
Player #08 : Shirtnum  0 : Tackling Score =   98
Player #09 : Shirtnum  5 : Tackling Score =  100
Player #10 : Shirtnum  4 : Tackling Score =   88
Player #11 : Shirtnum  0 : Tackling Score =   69
Player #12 : Shirtnum  8 : Tackling Score =   91
Player #13 : Shirtnum  0 : Tackling Score =   64
Player #14 : Shirtnum  0 : Tackling Score =   71
Player #15 : Shirtnum  7 : Tackling Score =   77
Player #16 : Shirtnum  0 : Tackling Score =   72
Player #17 : Shirtnum 14 : Tackling Score =   60
Player #18 : Shirtnum 12 : Tackling Score =   72
Player #19 : Shirtnum 11 : Tackling Score =   73
Player #20 : Shirtnum 10 : Tackling Score =   90
Player #21 : Shirtnum  9 : Tackling Score =   91

Posted: Fri Sep 09, 2005 3:44 pm
by Semtex
What is frightening is when Cox is injured and you can only bring on tackling ability of low 70's at best...

Good work Steve, How does it decide that sometimes Barber will stand up to Cox?

Posted: Fri Sep 09, 2005 3:54 pm
by SimonB
Just to confirm - these are the stats from the default game - i.e. not with the A=B version?

Posted: Fri Sep 09, 2005 4:03 pm
by Steve Camber
Yep, this is with standard olde TeamA and TeamB, hence the differing values.

I'll keep looking into it, there may still be some more factors thrown into the mix at some point!

Posted: Fri Sep 09, 2005 4:24 pm
by Steve Camber
Tackling/Defending High Score Table

100 A R.Cox
100 A R.Simpson
100 B R.Cox
100 B R.Simpson

96 A G.Nicholls
96 A R.A.Scott

95 A R.Barber

93 A S.D.R.Wells

91 B R.A.Scott
91 B G.Nicholls

90 B R.Barber

88 A R.Curtis
88 B S.D.R.Wells

83 B R.Curtis

82 A M.M.Barratt

78 A E.Curtis
78 A S.M.Fisher

77 A A.Lindsey
77 B M.M.Barratt
77 A M.I.Barker

73 B S.M.Fisher
73 B E.Curtis

72 B A.Lindsey
72 B M.I.Barker

65 A R.A.Hunt

60 B R.A.Hunt

Posted: Fri Sep 09, 2005 4:30 pm
by jesper
Nice work Steve. Thanks :)

So morale is signed, hmm. Just had a look at the stats file. Fisher has (unsigned) morale 226 and signed morale -30. Hunt and Barker have negative morale as well which is understandable, but why is Fisher so unhappy?

Posted: Fri Sep 09, 2005 4:35 pm
by Steve Camber
A bad morale brings down the keeping attribute, so maybe he's not the best keeper in the squad!

I'll analyse keeping, passing and shooting next.

Side note.. After realising that morale is a signed value, I have changed the competition version super CPU teams to have maximum morale. I was previously giving them a high value which of course meant they were unhappy. So in theory they should be even more unstoppable now, unless they were already maxed out even when unhappy!

Posted: Fri Sep 09, 2005 4:47 pm
by jesper

Code: Select all

S.M.Fisher

Morale -30
Agility 195
Keeping 181
Effective keeping 95

M.Hopkins

Morale 35
Agility 143
Keeping 143
Effective keeping 80

A.Andrews

Morale -56
Agility  154
Keeping 87
Effective keeping 55


Fisher is still the best!

Posted: Fri Sep 09, 2005 5:16 pm
by manicx
I noticed that when you score too many goals against the computer, Fisher slows down considerably. It's like moving at 50% of the normal speed. Is this due to morale?

Posted: Fri Sep 09, 2005 5:37 pm
by Steve Camber
manicx wrote:I noticed that when you score too many goals against the computer, Fisher slows down considerably. It's like moving at 50% of the normal speed. Is this due to morale?


All player's running speed decreases gradually as the game progresses (possibly more so when in possession of the ball). There is a lower cap, so they dont come to a complete standstill. It's not related to morale at all.

There is also a function which makes the winning player slower by a multiple of the goal difference. However, this may only affect the goalie. There is also some code which appears to make the player speed up again in the last minute. Needs further research though...

Posted: Fri Sep 09, 2005 11:02 pm
by TheFoxSoft
Steve Camber wrote:There is also a function which makes the winning player slower by a multiple of the goal difference. However, this may only affect the goalie. There is also some code which appears to make the player speed up again in the last minute. Needs further research though...


:shock: :shock: this is interesting

Posted: Sat Sep 10, 2005 1:41 am
by Monty
Steve Camber wrote:All player's running speed decreases gradually as the game progresses (possibly more so when in possession of the ball). There is a lower cap, so they dont come to a complete standstill. It's not related to morale at all.

There is also a function which makes the winning player slower by a multiple of the goal difference. However, this may only affect the goalie. There is also some code which appears to make the player speed up again in the last minute. Needs further research though...


for i can only talk about the oracle-version, it seems that this lower cap is missing there. i had several games against the computer where i led 25:0 or something around that and i had to take care that my keeper hadn't to do a goal-kick. if that happened the game was practically over, because he moved either with a speed of one pixel per 10 seconds towards his goal-kick-position or he moved BACKWARDS of the pitch into nowhere (= negative speed).

but this is maybe just a bug of the oracle-version...