Simulations of how a game behaves at a given time

Z Statistic··1 votes·596 views

This is far from a finished product, but I thought others would like to see my work. As a disclaimer, I'm not claiming to be some guru who understands the game or knows that my estimates are as perfect as possible (they aren't.) If you guys have some requests for more pictures of simulations, ask away! Variables are: game time, mmr difference, base snowball rate, impact of mid game, and point of behavior symmetry (where the impact of your next decision now isn't changing as drastically as your previous.) If you want to run the simulation yourself, the R code will be near the bottom.

Based on some assumptions:

  1. That there exists a random variable called "decision" that is a non-independent Bernoulli trial. Success is defined as Blue team (or purple if you love those guys) making the right action. A failure is the other team making the right action. There is no such thing as both teams making the right action in the same time frame. Philosophically, "right action" could be considered to be the action that causes the respective team to have some advantage, no matter how small, over the enemy team.
  2. Decision has two base values: -1 and 1 and has a value that scales exponentially with time.
  3. The probability of Decision being a success is dependent on the relative skill difference and remains constant throughout the game.
  4. The rate of change of Decision's value per step is an exponential function; early game decisions will impact later decisions, but ultimately, you are damned later on for making wrong decisions.
  5. I am assuming every player (10) is making a decision every single second. That means the step size is 0.1 seconds.
  6. Thus, 20 minutes is equivalent to n=12000
  7. I have estimated the R value of the exponential change to be 1/(20 minutes *10^3) through trial and error.
  8. The above estimate refers to the weight of time for a game. Smaller weights will make games determined slowly while larger ones more quickly. Think of getting kills as as giving 3000 gold versus 300 gold.
  9. (not needed any longer)
  10. The value "score" does NOT mean team KDA, gold, or whatever. It is a measure of an ambiguous performance statistic. If you make the decision to move forward correctly, you get +1 score scaled based on time in game.
  11. I assume that death, gold, exp, wards, etc. are the physical manifestations of a score accumulation. As an example, getting the last hit will increase your score, but it also assumes you made decisions that increased your score in order to be able to get that last hit in the first place. Same thing with death. This includes proper trading, warding, juking, mind games, etc.
  12. There is no explicit end to the game. I simply cut it off at the end of some amount of minutes. This means that I am considering a game of X minutes long, NOT a snap shot of a longer game.
  13. I assume the process works exactly the same for bronze and diamonds because I believe the same system is merely being manifested in different ways at different skill levels.
  14. I am also assuming that I can simply take the aggregate of the team's decisions and treat them as a singular variable.

Categories:

  1. Landside: |score|> 0 for all n > 6000 and the respective side wins
  2. Comeback: |Score|>100 for some n but the opposite side wins
  3. Rall: |score|>100 for some n0 and |score|<50 for some n1>n0, but the larger scored team wins
  4. Swing Game" score > 50 for some nA, and score < -50 for some nB where there are at least two pairs of A's and B's (i.e. favor falls from blue to purple to blue and then at least back to purple)
  5. Normal: all other games.

Alright, time for the actual code.

BOLD STATEMENTS ARE COMMENTS. Hashtags are interpreted as "bold" unfortunately. You will need to edit it from copy-paste. Sorry ;-;

#my custom distribution for a given game of League of Legends.

#Note: Evaluating the mean at each step can take a while even with only 50 20 minute games.

#p represents the probability of Blue winning #n represents the number of trials. Assume one trial occurs every 0.1 seconds #12k steps is roughly 20 minutes of game time. #pchange is the amount that p changes based on X's outcome for a given trial. #pchange is determined by a base value and n's current value. #score is the sum of X's at a given n. #weight is a modifier for pchange's base

elo.1=1200 elo.2=1300

#p=1/(1+10^((elo.1-elo.2)/400)) p=0.5 n=600*40 weight=1/100000 counter=1 high.point=1200 games.aggregate<- matrix(0, ncol = n, 0) final={}

#run a series of games games=1 game.number=0 #pchange<-function(n){0.0001/(1+exp(-weight*(n-high.point)))}

for (i in 1:games){

#single game score={} probability={} steps=0 game.number=game.number+1 counter=0

for (i in 1:n) { #p=1/(1+exp(-steps/(4060010^(3))(2counter-steps))) p=0.5 steps=steps+1

#pchange.v=pchange(steps) X<-rbinom(1,1,p)

if (X==1){ #p=p+pchange.v counter=counter+1exp(steps/(2060010^3))} if (X==0){ #p=p-pchange.v counter=counter-1exp(steps/(2060010^3)) }

score=c(score,counter) probability=c(probability,p) }

if (game.number==1){ final=rbind(games.aggregate, c(score))} if (game.number >1){ final=rbind(final, c(score))} #plot(score)

}

AverageScore<-colMeans(final)

#plot(AverageScore)

plot(score) #plot(probability)

#endcode

The pretty picture attachments were from yesterday's hypothesis. Ultimately, they behave not as realistic as the current hypothesis but remain for posterity since they look similar regardless.

1 Comments

Z Statistic1 votes

#my custom distribution for a given game of League of Legends.

#p represents the probability of Blue winning #n represents the number of trials. Assume one trial occurs every 0.1 seconds #12k steps is roughly 20 minutes of game time. #pchange is the amount that p changes based on X's outcome for a given trial. #pchange is determined by a base value and n's current value. #score is the sum of X's at a given n. #weight is a modifier for pchange's base

elo.1=1200 elo.2=1200

p=1/(1+10^((elo.1-elo.2)/400)) n=12000 weight=1/100000 score={0} counter=1 steps=0 high.point=12000 pchange<-function(n){0.0001/(1+exp(-weight*(n-high.point)))}

for (i in 1:n) { steps=steps+1

pchange.v=pchange(steps) X<-rbinom(1,1,p)

if (X==1){ p=p+pchange.v counter=counter+1} if (X==0){ p=p-pchange.v} score=c(score,counter-steps/2) }

plot(score)

More from Gameplay

More by Z Statistic