Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Football Match Simulation - How Would I Do It?
- FreddyBlue
-
31 posts
Football Match Simulation - How Would I Do It?
I am looking to make a football match simulation engine for my upcoming game “The Road to Russia - 2018 World Cup”.
This game will include all 54 teams from Europe taking part in World Cup Qualification and will eventually branch out to include every national team taking part in qualification.
I would like to know, how would I go about making a match simulation engine, taking into account the strengths of the teams (each team will have an attack rating, midfield rating and defence rating).
Also, I would like it to have a slight chance of an upset, for example, you would expect Germany to defeat Ireland but there could be a slight chance that Ireland beat Germany (upsets occur frequently in football, and I would like there to be a chance of an upset in this game).
If you have any knowledge on this topic, or have at least an idea of how I would go about making this, then please let me know.
Thank you in advance.
This game will include all 54 teams from Europe taking part in World Cup Qualification and will eventually branch out to include every national team taking part in qualification.
I would like to know, how would I go about making a match simulation engine, taking into account the strengths of the teams (each team will have an attack rating, midfield rating and defence rating).
Also, I would like it to have a slight chance of an upset, for example, you would expect Germany to defeat Ireland but there could be a slight chance that Ireland beat Germany (upsets occur frequently in football, and I would like there to be a chance of an upset in this game).
If you have any knowledge on this topic, or have at least an idea of how I would go about making this, then please let me know.
Thank you in advance.
- pong101
-
9 posts
Football Match Simulation - How Would I Do It?
I'm not sure if this helps but;
To begin you will need to record (probably through a list) all of the ‘Attack’ ‘Midfield’ and ‘Defence’ for all of the teams. When a match is played the code will add all of the ‘Attack’ ‘Midfield’ and ‘Defence’ values together to make a total. When I say ’total’ I mean this number. The team with the highest total wins (unless it is an upset). To calculate the score you can do it as the winners total minus the losers total divide by three (or any other number) this will have to be rounded of course as you can't have decimal scores. To calculate if a game is an upset you can have a ‘pick random’ block with the first number being the total of the first team and the second being the total of the second team. If this random number equals the highest possible number the match is an upset.
I hope that this can help you with your simulation. If you need any further help please let me know. This may seem complex but should make a quite accurate simulator. Good luck.
Thanks,
Pong101
To begin you will need to record (probably through a list) all of the ‘Attack’ ‘Midfield’ and ‘Defence’ for all of the teams. When a match is played the code will add all of the ‘Attack’ ‘Midfield’ and ‘Defence’ values together to make a total. When I say ’total’ I mean this number. The team with the highest total wins (unless it is an upset). To calculate the score you can do it as the winners total minus the losers total divide by three (or any other number) this will have to be rounded of course as you can't have decimal scores. To calculate if a game is an upset you can have a ‘pick random’ block with the first number being the total of the first team and the second being the total of the second team. If this random number equals the highest possible number the match is an upset.
I hope that this can help you with your simulation. If you need any further help please let me know. This may seem complex but should make a quite accurate simulator. Good luck.
Thanks,
Pong101
- FreddyBlue
-
31 posts
Football Match Simulation - How Would I Do It?
I'm not sure if this helps but;
To begin you will need to record (probably through a list) all of the ‘Attack’ ‘Midfield’ and ‘Defence’ for all of the teams. When a match is played the code will add all of the ‘Attack’ ‘Midfield’ and ‘Defence’ values together to make a total. When I say ’total’ I mean this number. The team with the highest total wins (unless it is an upset). To calculate the score you can do it as the winners total minus the losers total divide by three (or any other number) this will have to be rounded of course as you can't have decimal scores. To calculate if a game is an upset you can have a ‘pick random’ block with the first number being the total of the first team and the second being the total of the second team. If this random number equals the highest possible number the match is an upset.
I hope that this can help you with your simulation. If you need any further help please let me know. This may seem complex but should make a quite accurate simulator. Good luck.
Thanks,
Pong101
Thank You
- gtoal
-
1000+ posts
Football Match Simulation - How Would I Do It?
Look for projects that implement random numbers using a gaussian curve/normal distribution (eg I am looking to make a football match simulation engine for my upcoming game “The Road to Russia - 2018 World Cup”.https://scratch.mit.edu/projects/126302896/ ). That way, if team A is rated 10 and team B is rated 16, you can set the likelihood of team B winning to 15/12 *but* it's not a guaranteed win - the random numbers use the probability curve to bias the selection but keep a natural distribution of occurrences where the lower scoring teams will win.
This game will include all 54 teams from Europe taking part in World Cup Qualification and will eventually branch out to include every national team taking part in qualification.
I would like to know, how would I go about making a match simulation engine, taking into account the strengths of the teams (each team will have an attack rating, midfield rating and defence rating).
Also, I would like it to have a slight chance of an upset, for example, you would expect Germany to defeat Ireland but there could be a slight chance that Ireland beat Germany (upsets occur frequently in football, and I would like there to be a chance of an upset in this game).
If you have any knowledge on this topic, or have at least an idea of how I would go about making this, then please let me know.
Thank you in advance.
Last edited by gtoal (June 21, 2017 10:46:58)
- Discussion Forums
- » Help with Scripts
-
» Football Match Simulation - How Would I Do It?