|
Basic Averages Game Simulation
|
There are many game simulation algorithms that expose the basic user to an advanced output of simulations. These simulations are advanced and uses a rather different approach than the concept of this Algorithm. They use player stances and brings player attributes to a more direct effect in the simulation and outcome of a game. This example uses the basic principle of average team outcome and how to add an extra unknown factor. This algorithm calculates and emulates an game engine using averages in large. This is an rather easy and simpler way to simulate and game and gives the same output that a rather more complex simulation would have had. The basic game engine calculates an output for the user using multiple variables. Basketball Example Imagine a basketball game where players move/act based on stats. A defender may have his STEAL rating at 94, and the offensive player has a BALL HANDLING rating of 98. How would a user then be able to implement the simulation of the above variables. The following algorithms would be used: (1) CHANCE = STEAL - BALL_HANDLING/2 If STEAL BALL_HANDLING 0 then CHANCE = 0 else if min(STEAL, BALL_HANDLING) == STEAL then CHANCE = 100 * STEAL / BALL_HANDLING else CHANCE = 100 * (1 - BALL_HANDLING/STEAL) Now lets have a look at the system on a rather larger scale than just small attributes of each player competing. This is a basketball team, going to compete against each other, but the teams only have 2 players each in this example. Team 1: Player 1: Speed: 98% Handling: 45% Agility: 78% Player 2: Speed: 78% Handling: 85% Agility: 71% Team 2: Player 1: Speed: 50% Handling: 88% Agility: 66% Player 2: Speed: 90% Handling: 90% Agility: 20% You want to calculate witch team is going to win. You calculate the average for a team and we will call it the winning percentage: Team 1 : Speed: (98+78)\2 = 88% Handling: (45+85)\2= 65% Agility: (78+71)\2 = 75% Team 2 : Speed: (50+90)\2 = 70% Handling: (88+90)\2= 89% Agility: (66+20)\2= 43% Now if player from Team 1 goes head on head with player from Team 2: There is a 24% change that player 2 is going to win the ball. That you have to add to your system. Use the 24% ball winning change to add a extra bonus to the chance of Team 2 winning the game. Calculate the Team That Wins: Team 1: (88+65+75)\3 = 76% Team 2: (70+ 89+43)\3 = 67% [ add a bonus for better handling 24/10 = +2.4%] Now you see that even thou Team 2 has better change of stealing the ball it is clear would lose the game, that is why you can implement the bonus. Let the scoring system work as follow: Example1: 76/2 = 38 dunks 69/2 = 35 dunks Giving the factor that fitness and fatigue plays a role implementing it as an extra bonus attributes, would give an team with lower rating an really good chance of winning. Also factors like morale could also play a role. But be aware that having to much factors in the equation would be making it complex. Example 2: Using a random number to generate the dunks could also give the weaker team a better chance. Let the scoring system work as follow: 76/2 = 38 dunks 69/2 = 35 dunks You could let the number that divides 2 be a random generated number. Lets say that the game generates a number between 2 and 5. This number would replace /2 to divide. But let your weaker team generate his own number could be the unknown factor. But i don't like this method for it is unstable and the weaker team could end up winning all the games. As you could see, this is a rather simple simulation process for basic game simulation put into an example for users.
|
|
|