Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a way I would do it.</p> <p><strong>Offensive/Defensive Quality</strong></p> <p>First lets work out the average strength of the entire team:</p> <pre><code>Team.Strength = SUM(Players.Strength) / 11 </code></pre> <p>Now we want to split out side in two, and work out the average for our defensive players, and our offensive players.]</p> <pre><code>Defense.Strength = SUM(Defensive_Players.Strength)/Defensive_Players.Count Offense.Strength = SUM(Offense_Players.Strength)/Offense_Players.Count </code></pre> <p>Now, we have three values. The first, out Team average, is going to be used to calculate our odds of winning. The other two, are going to calculate our odds of defending and our odds of scoring.</p> <p>A team with a high offensive average is going to have more chances, a team with a high defense is going to have more chance at saving.</p> <p>Now if we have to teams, lets call them A and B.</p> <p>Team A, have an average of 80, An offensive score of 85 and a defensive score of 60.</p> <p>Team B, have an average of 70, An offensive score of 50 and a defensive score of 80.</p> <p>Now, based on the average. Team A, should have a better chance at winning. But by how much?</p> <p><strong>Scoring and Saving</strong></p> <p>Lets work out how many times goals Team A should score:</p> <pre><code>A.Goals = (A.Offensive / B.Defensive) + RAND() = (85/80) + 0.8; = 1.666 </code></pre> <p>I have assumed the random value adds anything between -1 and +1, although you can adjust this.</p> <p>As we can see, the formula indicates team A should score 1.6 goals. we can either round this up/down. Or give team A 1, and calculate if the other one is allowed (random chance).</p> <p>Now for Team B</p> <pre><code>B.Goals = (B.Offensive / A.Defensive) + RAND() = (50/60) + 0.2; = 1.03 </code></pre> <p>So we have A scoring 1 and B scoring 1. But remember, we want to weight this in A's favour, because, overall, they are the better team. </p> <p>So what is the chance A will win?</p> <pre><code>Chance A Will Win = (A.Average / B.Average) = 80 / 70 = 1.14 </code></pre> <p>So we can see the odds are 14% (.14) in favor of A winning the match. We can use this value to see if there is any change in the final score:</p> <pre><code>if Rand() &lt;= 0.14 then Final Score = A 2 - 1 B Otherwise A 1 - 1 B </code></pre> <p>If our random number was 0.8, then the match is a draw.</p> <p><strong>Rounding Up and Further Thoughts</strong></p> <p>You will definitely want to play around with the values. Remember, game mechanics are very hard to get right. Talk to your players, ask them why they are dissatisfied. Are there teams always losing? Are the simulations always stagnant? etc.</p> <p>The above outline is deeply affected by the randomness of the selection. You will want to normalise it so the chances of a team scoring an extra 5 goals is very very rare. But a little randomness is a great way to add some variety to the game.</p> <p>There are ways to edit this method as well. For example instead of the number of goals, you could use the Goal figure as the number of scoring chances, and then have another function that worked out the number of goals based on other factors (i.e. choose a random striker, and use that players individual stats, and the goalies, to work out if there is a goal)</p> <p>I hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload