Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How would I go about making a basic soccer match simulation engine?
- FreddyBlue
-
31 posts
How would I go about making a basic soccer match simulation engine?
I am currently making a soccer manager game, I need help making the match simulation engine.
In the game each team will choose a starting 11, each player on these teams will have one attribute, an overall attribute between 1-100 which tells us how good that player is in his current position.
Using this data, how would I make a match engine based on this.
In the game each team will choose a starting 11, each player on these teams will have one attribute, an overall attribute between 1-100 which tells us how good that player is in his current position.
Using this data, how would I make a match engine based on this.
- deck26
-
1000+ posts
How would I go about making a basic soccer match simulation engine?
Others may understand what you're asking but I have to say I don't. What does the match engine have to do?
- TheParadoxScratcher
-
75 posts
How would I go about making a basic soccer match simulation engine?
You'll have to tell us more about how you want the engine to be like.
- ECLIPSE-STUDIOS
-
100+ posts
How would I go about making a basic soccer match simulation engine?
Hi,
I've recently been working on an FM-style game engine (but commentary only), and what I did was compare a players attack score + or - 10 to the defenders score + or - 10 (to create a little randomization). Either the attack would continue until a goal is scored, or the defender scores higher than the attacker. If the scores were equal, I considered the defender to have win, and started a counter attack. The process continues until the match ends.
While this doesn't tell you the code, this should give you a general idea how to go about it.
I hope this helps!
I've recently been working on an FM-style game engine (but commentary only), and what I did was compare a players attack score + or - 10 to the defenders score + or - 10 (to create a little randomization). Either the attack would continue until a goal is scored, or the defender scores higher than the attacker. If the scores were equal, I considered the defender to have win, and started a counter attack. The process continues until the match ends.
While this doesn't tell you the code, this should give you a general idea how to go about it.
I hope this helps!
- FreddyBlue
-
31 posts
How would I go about making a basic soccer match simulation engine?
You'll have to tell us more about how you want the engine to be like.
Okay, looking back now, I realize I may have explained it very poorly.
Basically, I want to just press a button and get a result from the match. However, I don't want the result to be just random. I want it so that the game compares the overall rating (a number between 1-100 given to each individual player, which tells us how good that player is) of every player on both teams in order to give the most realistic result.
For example, if a team full of 100 rated players (team 1) played a team full of 90 rated players (team 2) then team 1 should be more likely to win then team 2, however, this shouldn't mean that team 1 should ALWAYS beat team 2.
The match engine should also be open to the event of a draw game. (Where the game ends and the scores are level)
Are you able to help me now?
- FreddyBlue
-
31 posts
How would I go about making a basic soccer match simulation engine?
Hi,
I've recently been working on an FM-style game engine (but commentary only), and what I did was compare a players attack score + or - 10 to the defenders score + or - 10 (to create a little randomization). Either the attack would continue until a goal is scored, or the defender scores higher than the attacker. If the scores were equal, I considered the defender to have win, and started a counter attack. The process continues until the match ends.
While this doesn't tell you the code, this should give you a general idea how to go about it.
I hope this helps!
That seems amazing! However, I only want it to give me the result of the match xD.
You seem to know what you are doing. Is there a way I can dumb the script down and still keep it realistic? (See my response to @TheParadoxScratcher above for more information on what I am hoping to achieve)
- asivi
-
1000+ posts
How would I go about making a basic soccer match simulation engine?
I really don't understand why you want a match 100 players' team vs. 90 players' team.
However,. you calculate the average of each team based in the rate of players(the current ones in the match), then you could try something similar to
https://scratch.mit.edu/projects/137733839/
However,. you calculate the average of each team based in the rate of players(the current ones in the match), then you could try something similar to
https://scratch.mit.edu/projects/137733839/
Last edited by asivi (March 31, 2018 21:17:19)
- ECLIPSE-STUDIOS
-
100+ posts
How would I go about making a basic soccer match simulation engine?
Hi,
I've recently been working on an FM-style game engine (but commentary only), and what I did was compare a players attack score + or - 10 to the defenders score + or - 10 (to create a little randomization). Either the attack would continue until a goal is scored, or the defender scores higher than the attacker. If the scores were equal, I considered the defender to have win, and started a counter attack. The process continues until the match ends.
While this doesn't tell you the code, this should give you a general idea how to go about it.
I hope this helps!
That seems amazing! However, I only want it to give me the result of the match xD.
You seem to know what you are doing. Is there a way I can dumb the script down and still keep it realistic? (See my response to @TheParadoxScratcher above for more information on what I am hoping to achieve)
Hi,
What you could do is use a randomiser like mine, however don't insert any wait-blocks. This means it should only take a few seconds to simulate the entire match. That way you only need to count the number of goals scored, and this way the result could be anything from a goalless draw to a really one-sided 8-0 thrashing. Of course, the team with the better players have the advantage, but the worse team could still win.
Alternatively, you could total the attack score of a team and compare it to the opposition's total defence, and vice versa to calculate how many goals each team will score. You'd need to use the pick random block to add a bit of randomisation too, though, and you'd need to figure out HOW to compare the two numbers to decide the number of goals scored (e.g. it could be the difference between a team's attack and the opposition's defence divided by ten and then rounded etc. - you'd need to use a little trial and error here!).
I hope this helps!
- Discussion Forums
- » Help with Scripts
-
» How would I go about making a basic soccer match simulation engine?