ho-dev / HattrickOrganizer

Assistant for Hattrick online football manager
https://ho-dev.github.io/HattrickOrganizer/
GNU Lesser General Public License v3.0
195 stars 79 forks source link

[FEATURE] Schum rating prediction #1782

Closed wsbrenk closed 11 months ago

wsbrenk commented 1 year ago

this is from Schum's thread

Midfield rating multipliers.

As usual, let's start with the coordinate system.

If you remove all players in the installer, then all ratings will be visually displayed as 0.75 In reality, it is 0, or "absent".

Next, I will give a table

Display Value
0.75 0.00
1.00 (0.00 ; 0.25)
1.25 [0.25 ; 0.50)
1.50 [0.50 ; 0.75)
1.75 [0.75 ; 1.00)
2.00 [1.00 ; 1.25)
2.25 [1.25 ; 1.50)
2.50 [1.50 ; 1.75)
2.75 [1.75 ; 2.00)
3.00 [2.00 ; 2.25)

and so on, ad infinitum...

And now the values of the PM multipliers:

Type Value
Away 1.00
Derby 1.10
Home 1.20
PIC 0.84
Normal 1.00
MOTS 1.10(6)*
CA 0.93
LS 0.96

*the exact value of the MOTS multiplier is 83/75=1.10(6) The values of the remaining multipliers do not contain more than 2 decimal places.

Away - away match Derby - derby away, national team at home Home - Home Match PIC - Half Strength Game MOTS - Match of the Season CA - Counter-Attack Tactics LS - Tactics "Long Strikes"

The unwritten manual has a similar table 17236276.15 Now the built-in rating calculator allows you to find refined values that are very close.

As a follow-up to the previous post, I'll quote downgrade defense and attack ratings for different tactics:

Protection ratings: 0.85 - The tactic "Attack on the flank" reduces the rating of the defense in the center by 15% 0.85 - "Attack in the center" tactic reduces the ratings of the defense on the flanks by 15% 0.93 - The "Play Creative" tactic reduces all protection ratings by 7%

Attack ratings: 0.96 - Long-Range Strike Tactics Reduce All Attack Ratings by 4%

The values are precise, not rounded. There are no decimal places below.

Retreat to the defense.

From the Rules: A team that has an advantage of 2 goals or more starts to slow down and focus more on defense. This effect increases if the team scores more: each goal reduces the attack by 9% and increases the defense by 7.5%. If the score difference is reduced, the previous attack and defense change is canceled. If the difference between goals scored and conceded reaches 8, the team's ratings cease to change. In some situations, teams are not affected by this effect. For example, if a team is given the "Match of the Season" directive, they will not step back even with a significant advantage. The same thing happens in the finals of the national cup, the World Cup and the Hatttrick Masters and in the last round of the season in league games.

Said quite clearly and accurately.

I will dwell only on a couple of nuances:

  1. It is important to understand that the percentage is taken not from the previous value, but from the original one.
  2. In practice, the above percentages are even higher by 0.5%. That is, with each subsequent goal, the defense increases by 8.0%, and the attack decreases by 9.5%

In total, the following coefficients are obtained from nominal ratings:

Difference Protection Attack
0-1 1.00 1.000
2 1.08 0.905
3 1.16 0.810
4 1.24 0.715
5 1.32 0.620
6 1.40 0.525
7 1.48 0.430
8+ 1.56 0.335

The impact of the form on the ratings:

Form K(F)
8.0 100.0%
7.5 96.4%
7.0 92.5%
6.5 88.5%
6.0 84.4%
5.5 80.0%
5.0 75.5%
4.5 70.7%
4.0 65.5%
3.5 59.8%
3.0 53.4%
2.5 46.2%
2.0 37.9%
1.5 28.2%

The impact of experience.

So, one of the toughest nuts in HT is experience.

To understand exactly how experience affects match ratings, first of all it is necessary to understand which variables affect BEFORE the experience (and do not affect the effect of experience), and which - AFTER.

In Hattric, the picture is as follows:

That is(S+Eff(L))K(F)C

And only then does experience have an impact.

Thus, all the indicators that we took into account above no longer affect the effect of experience in the future. How does the experience itself affect?

The experiment adds to the above value (S+Eff(L))K(F) C * K(P) the effect of the experience Eff(Exp), which depends on:

  1. Exp Player Experience Values.
  2. Rating lines
  3. The fact of whether the player's position affects the contribution to this rating line.

2 means that in the rankings of different lines, the same experience adds a different number of "conditional skills".

Contribution of the "Divine" experience to the ratings of different lines:

  Left Center Right
Att 0.375 0.450 0.375
PM   0.730  
Def 0.345 0.480 0.345

p.3 means that if a player's position affects a given rating line (for example, the winger's pass (Wg) affects the central attack), then the winger's experience is fully invested in the central attack. And if none of the winger's skills invest in the attack of the opposite flank, then the experience of the winger does NOT affect the rating of the attack of the opposite flank.

Accordingly, the instructions to the players do not affect the contribution of experience to the ratings of the lines. PS: but there is an exception: the experience of a left (right) central defender will give an increase in the rating of the attack on the left (right) only with the indication "to the flank".

wsbrenk commented 1 year ago

Table of the contribution of the experience of players in positions to the line ratings.



wsbrenk commented 1 year ago

*w - only with the indication "to the flank"

From the table it can be seen that the Midfielder in the central slot (C-IM) invests his experience in the ratings of all 7 lines. And, for example, the Goalkeeper invests his experience only in 3 lines of defense.

And vertically- all 10 field players are invested in the Midfield (PM) rating, regardless of the placement. And in the ratings of the flank attack invest the experience of players on 7 slots. With a specific arrangement, 3 slots may not be occupied. As a result, players in at least 4 slots invest experience in the rating of the line.

wsbrenk commented 1 year ago

Values of the contribution of experience to the ratings of different lines. Common scale.

Eff(Exp)

L-DefC-DefR-Def_PM_L-AttC-AttR-Att
R-Fw1111
C-Fw1111
L-Fw1111
R-Wg11111
L-Wg11111
R-IM11111
C-IM1111111
L-IM11111
R-Wb1111
L-Wb1111
R-CD111*w
C-CD1111
L-CD111*w
Gk111
Exp K L,R-Def C-Def PM L,R-Att C-Att
20 1.000 0.345 0.480 0.730 0.375 0.450
19 0.995 0.343 0.478 0.727 0.373 0.448
18 0.988 0.341 0.474 0.721 0.370 0.445
17 0.978 0.337 0.469 0.714 0.367 0.440
16 0.965 0.333 0.463 0.704 0.362 0.434
15 0.950 0.328 0.456 0.693 0.356 0.427
14 0.932 0.322 0.447 0.680 0.349 0.419
13 0.911 0.314 0.437 0.665 0.342 0.410
12 0.887 0.306 0.426 0.647 0.333 0.399
11 0.858 0.296 0.412 0.626 0.322 0.386
10 0.823 0.284 0.395 0.601 0.309 0.371
9 0.782 0.270 0.376 0.571 0.293 0.352
8 0.733 0.253 0.352 0.535 0.275 0.330
7 0.674 0.233 0.324 0.492 0.253 0.303
6 0.604 0.208 0.290 0.441 0.226 0.272
5 0.520 0.179 0.250 0.380 0.195 0.234
4 0.420 0.145 0.202 0.307 0.158 0.189
3 0.302 0.104 0.145 0.220 0.113 0.136
2 0.163 0.056 0.078 0.119 0.061 0.073
1 0.000 0.000 0.000 0.000 0.000 0.000

K is the contribution coefficient of experience to the level of experience.

Here we see that the experience "Colossal" (Titanic) gives the effect of 95% of the effect of the experience "Divine" (Divine).

Further, before calculating the ratings, the contributions of all players, taking into account the experience, are added up Σ [ (S+Eff(L)) K(F) C * K(P) + Eff(Exp) ]

And only then are multiplied by the effects of common modifiers: team spirit, coach mentality taking into account tactics, confidence, mood for the match, tactics odds.

As a result, it turns out that the maximum impact of experience has on the Midfield line. So, 10 field players with experience "Colossally" in total will give a contribution to the Midfield 10 x 0.693 = 6.93

that is, they will give an increase of almost 7 whole Semi-Protection skills. And given the "penalty for overcrowding" with 3 midfielders, the effect of experience will be equivalent. 6.93 / 0.825 = 8.4 PM skills.

wsbrenk commented 1 year ago

New!

The Influence of Team Spirit.

Team Spirit Level PIC Normal MOTS
Paradise on Earth! 10.5 1.244 1.481 1.639
walking on clouds 9.5 1.189 1.415 1.566
delirious 8.5 1.126 1.340 1.483
satisfied 7.5 1.061 1.263 1.398
content 6.5 0.991 1.180 1.306
calm 5.5 0.919 1.094 1.211
composed 4.5 0.840 1.0 1.107
irritated 3.5 0.752 0.895 0.990
furious 2.5 0.649 0.773 0.855
murderous 1.5 0.528 0.628 0.695
cold war 0.5 0.375 0.447 0.495

The value of the team spirit "Paradise on Earth!" can be from 10.0 to 12.05

But at the first update, as well as when the CD falls due to the transfer, the KD value becomes 9.5, regardless of the leadership of the coach and the presence / level of the psychologist.

A drop in Team Spirit when buying players.

  Probability, % Drop, %
(Nasty) 67% 9.5%
Unpleasant (Controv.) 50% 7.0%
Pleasant) 25% 5.0%

The influence of confidence. Confidence sublevel 0.5

Team Confidence Attack
completely exaggerated 1.25
exaggerated 1.20
slightly exaggerated 1.15
wonderful 1.10
strong 1.05
decent 1.00
poor 0.95
wretched 0.90
disastrous 0.85
non-existent 0.80

On Saturday's update, if the confidence was maximum (excessive), with a psych of level 5, confidence takes a value of 8.6 (excessive +0.6) with an efficiency of 1.205

roky0786 commented 1 year ago

How to prediction in any online color game with phone

wsbrenk commented 1 year ago

image

wsbrenk commented 1 year ago

team spirit influence differs a lot between the different concepts

looks like a too low team spirit factor in HO calculation. i will check if this will solve users complaints

wsbrenk commented 1 year ago

in HO 8 i want to refactor the rating prediction feature.

masterpatje commented 1 year ago

Great!

Hartelijke groet,

Patrick

Op 19 mrt. 2023 om 10:41 heeft wsbrenk @.***> het volgende geschreven:



in HO 8 i want to refactor the rating prediction feature.

(to be continued)

— Reply to this email directly, view it on GitHubhttps://github.com/akasolace/HO/issues/1782#issuecomment-1475180309, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYKSKGS6H4KBUG6IICFVDHTW43IC7ANCNFSM6AAAAAATSOVJZM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

wsbrenk commented 1 year ago

Stamina formula:

again from Schum' thread: https://www89.hattrick.org/Forum/Read.aspx?t=17404127&n=38&v=4

Dynamics of the influence of stamina on the player's contribution to the match ratings

The match in Hettrick consists of 5-minute segments, within each of which the player's contribution to the ratings does not change.

The 1st and 2nd halves consist of 9 segments, extra time consists of 6. We all know that a player "rests" between halves, and at the beginning of the 2nd half, his contribution to the ratings is usually higher than at the end of the 1st half. Also, the player rests a little before extra-time.



Time | T | Kt -- | -- | -- 00:01 - 05:00 | 0 | 102 05:01 - 10:00 | 1 | 102 10:01 - 15:00 | 2 | 102 15:01 - 20:00 | 3 | 102 20:01 - 25:00 | 4 | 102 25:01 - 30:00 | 5 | 102 30:01 - 35:00 | 6 | 102 35:01 - 40:00 | 7 | 102 40:01 - 45:00 | 8 | 102 45:01 - 50:00 | 9 | 120.75 50:01 - 55:00 | 10 | 120.75 55:01 - 60:00 | 11 | 120.75 60:01 - 65:00 | 12 | 120.75 65:01 - 70:00 | 13 | 120.75 70:01 - 75:00 | 14 | 120.75 75:01 - 80:00 | 15 | 120.75 80:01 - 85:00 | 16 | 120.75 85:01 - 94:59 | 17 | 120.75 90:01 - 95:00 | 19 | 127 95:01 - 100:00 | 20 | 127 100:01 - 105:00 | 21 | 127 105:01 - 110:00 | 22 | 127 110:01 - 115:00 | 23 | 127 115:01 - 120:00 | 24 | 127

Time - time interval T is the number of the time interval Kt - Time Ratio

The formula for changing the player's contribution to the ratings

  1. The player's stamina is below "excellent". St<7

R = Kt + 23/7 St + P T (27/70St - 5.95)

  1. The player's stamina is higher than "excellent". St>=7

R = Kt + 23 - 3.25 P T + (St -7) * 100/7

R is the percentage of the player's contribution to the ratings, visually rounded to the nearest integer. It can take values from 10% to 100%. Kt - time coefficient (see table above) St - Stamina skill level T is the number of the time interval (see table above) P is the coefficient of Pressing tactics. P = 1 if NOT pressing, P = 1.1 if the tactic is Pressing.

The accuracy of this formula is the sixth decimal place.

wsbrenk commented 1 year ago

Today, a colleague of mine gives me the idea of using Groovy as an alternative scripting language for this use case.

wsbrenk commented 1 year ago

@tychobrailleur there is now a merge request implementing the schum formula.

TODOs:

wsbrenk commented 1 year ago

Found in Schum's thread:

Retreat to the defensive.

From the rules: A team that has an advantage of 2 goals or more begins to slow down and pay more attention to defense. This effect increases if the team scores more: each goal reduces the attack by 9% and increases the defense by 7.5%. If the difference in the score decreases, the previous attack and defense change is canceled. If the difference between goals scored and conceded reaches 8, the team's ratings stop changing.

In some situations, teams are not affected by this effect. For example, if a team is given the instruction "Match of the season", then they will not move back even with a significant advantage. The same thing happens in the finals of the National Cup, World Cup and Hatttrick Masters and in the last round of the season in league games.

It is said quite clearly and accurately.

I will focus only on a couple of nuances:

  1. It is important to understand that the percentage is taken not from the previous value, but from the original.
  2. In practice, the above percentages are even higher by 0.5%. That is, with each subsequent goal, the defense increases by 8.0%, and the attack decreases by 9.5%

In total, the following coefficients are obtained from nominal ratings:

Difference of Defense Attack
0-1 1.00 1.000
2 1.08 0.905
3 1.16 0.810
4 1.24 0.715
5 1.32 0.620
6 1.40 0.525
7 1.48 0.430
8+ 1.56 0.335
wsbrenk commented 1 year ago

image

wsbrenk commented 1 year ago

Conditional training. Schum-rank

As a possible alternative to HTMS, I will give an assessment of the player's level in conditional training.

Conditional training is a full training of a 17-year-old player by a good coach with 2 level 5 assistants and 10% stamina.

DropLvl is taken into account in the skill leveling schedule from the age of 17 + 0. Skill levels are given according to the generally accepted scheme: 7 is "good".

For myself, I consider the basic 100% level - 50 conditional training sessions at the 17 + 0 uspool. This corresponds to all skills except Gk level 5.6

The age of 28+0 corresponds to receiving 161.55 conditional training, starting from the age of 17+0.

Skill Gk Df PM Wg Ps Sc SP
20 93.31 206.57 156.70 100.12 142.69 165.67 32.85
19 77.85 147.30 123.26 83.13 114.04 128.49 28.80
18 66.18 121.08 102.67 70.52 95.45 106.75 25.34
17 56.66 102.28 87.17 60.32 81.19 90.52 22.31
16 48.57 87.14 74.42 51.69 69.38 77.28 19.64
15 41.49 74.22 63.49 44.14 59.18 65.88 17.28
14 35.37 63.33 54.15 37.62 50.48 56.18 15.17
13 29.91 53.63 45.84 31.84 42.73 47.59 13.33
12 25.11 45.06 38.51 26.71 35.90 39.97 11.70
11 20.89 37.54 32.08 22.23 29.87 33.29 10.29
10 17.22 30.97 26.45 18.33 24.65 27.46 9.06
9 14.02 25.28 21.59 14.92 20.11 22.41 8.00
8 11.27 20.35 17.37 11.99 16.18 18.03 7.00
7 8.88 16.07 13.70 9.46 12.75 14.22 6.00
6 6.82 12.34 10.53 7.26 9.80 10.92 5.00
5 5.03 9.12 7.78 5.36 7.24 8.07 4.00
4 3.50 6.33 5.40 3.71 5.01 5.60 3.00
3 2.16 3.91 3.33 2.29 3.10 3.46 2.00
2 1.00 1.82 1.55 1.06 1.45 1.61 1.00
1 0 0 0 0 0 0 0
wsbrenk commented 1 year ago

image

wsbrenk commented 1 year ago

image