Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I (quickly) read through it and I noticed a couple of things:</p> <ul> <li><p>The percentage a red / yellow card is handed out is the same in all thirds of the field, is this intentional? I'm not a soccer guy, but I'd say that offences are more likely to happen on the last third of the field, than on the first. (Because if you're on the first, you're likely defending)</p></li> <li><p>The percentage to determine that a penalty is scored is the same for each team, however some teams, or rather players, are more likely to score a penalty than others.</p></li> <li><p>You're not taking into account corner kicks, possible injuries after a foul, or goals scored using the head (which might be worth mentioning in the report).</p></li> </ul> <p>Apart from that, you'll just need to run this simulation a <em>lot</em> of times and see if the values you chose are correct; tweak the algorithm. The best thing to do is hand tweak it (eg. read all the constants from a file and run a couple of hundred simulations with different values and different teams), the easiest thing to do is probably to implement a Genetic Algorithm to try and find better values.</p> <p>Basically what you have here is genuine gameplay / ai code, so you might want to read up on techniques used by game studios to manage this type of code. (One thing is to put the variables in a google spreadsheet which you can then share / tweak more easily, for example).</p> <p>Also, even though you're missing some things that a real soccer match has, there's no point trying to be as realistic as possible because generally in these cases it's more important to provide nice gameplay than it is to provide an accurate simulation.</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