## The effect of trolls on Twitch Plays Pokémon

João V. Tomotani

Universidade de São Paulo; São Paulo, Brazil.

Email: t.jvitor (at) gmail (dot) com

In a previous paper, I presented a curious experiment of a fish playing Pokémon, made real and popular thanks to the wonders of the Internet (Tomotani, 2014). The Twitch Channel (Twitch, 2016), which sadly has been inactive for some time now, showed Grayson, the fish, playing Pokémon Red with the help of an image identification software, and was watched by millions of people (Johns, 2014). I showed that, when assuming that a fish player was the same as a random input of commands – a premise I do not find absurd – it would take quite a while to advance through a single route (although a very complex one) in the game (Fig. 1): circa 115,700 years.

Figure 1. Route 23; image taken from Tomotani (2014). The many ledges, which could make the path much more tortuous, made the Twitch Play community come up with the infamous name “Ledge Simulator”.

The peculiar premise of a fish playing Pokémon obviously derived from the original Twitch Plays Pokémon, a game of Pokémon Red where everyone watching the stream could type commands in the chat window. An IRC bot would read and execute the commands in the game. The available commands were the classic Gameboy keys: A, B, Up, Down, Left, Right, Start and Select.

Since the inputs came from rational human beings, with defined intentions and minimal coordination, supposedly the game should be less frustrating than watching a fish swimming and randomly inputting commands in the game – the key word in this phrase being “supposedly”.

The point is (besides, of course, the difficulty in coordinating thousands of people to avoid incorrect commands), not all of the people participating in the event wanted to complete the game. In fact, some of them wanted to make matters as difficult as possible for the other players, as their goal was solely to make the Twitch Plays Pokémon a frustrating experience for anyone wanting to be a crowdsourced Pokémon master. (In their “defense”, I find it hard to believe that this sort of behavior was not one of the intentions of the programmer of this game, described by him as a “social experiment”; Alcantara, 2014.) This group of people is given the name of trolls.

The impact of trolls on Twitch Plays Pokémon was so peculiar that it resulted in a curious work, where Machine Learning techniques were used to detect anomalous inputs in the game (from a base of 38 million data points), trying to identify potential trolls (Haque, 2014). The objective of the present study is to see exactly how the percentage of trolls inputting commands on Twitch Plays Pokémon affected the time for completing Route 23 in the game.

TROLLS

Trolls are creatures from Nordic and Scandinavian myths and folklore, made popular in the 20th century by pop culture, starting with J.R.R. Tolkien’s books, going through Dungeons & Dragons and Harry Potter to the thousands, possibly tens of thousands, of other novels, comics, games etc. which they inspired.

Troll is a term applied to the Giants of Norse Mythology (the Jötnar), a race that live in Jötunheimr, one of nine worlds in Norse cosmology. There is some confusion about the terms, though, as jötunn (the singular form of Jötnar), troll, þurs, and risi frequently overlap and are used to describe many beings in the legends. Some researchers point out that there are distinct classes of these creatures, but the terms are frequently considered synonyms in late medieval literature and all of them are frequently translated to English simply as “giant” (Jakobsson, 2005). In a late saga of the Icelanders (Bárðar saga Snæfellsáss; probably from the early 14th century), a passage at the very beginning claims that risi and troll not only are distinctive races, but are, respectively, at the opposite ends of the binary divide of good and evil (Jakobsson, 2005).

The Internet term “troll”, however, does not come from such creatures. The term “trolling” means luring others into pointless and time consuming discussions, deriving from the practice used in fishing where a baited line is dragged behind a boat (Herring et al., 2002).

Figure 2. Trollface, a popular internet meme based in “rage comics”. – Did you just read two paragraphs about creatures in Norse mythology that have absolutely nothing to do with this topic?

The idea of trolling always seems to be related to communication, mostly computer-mediated communication (CMC). Hardaker (2010) analyzed a 172-million-word corpus of unmoderated, asynchronous CMC to try to formulate an academic definition of trolling. After his analysis, he proposes that:

A troller is a CMC user who constructs the identity of sincerely wishing to be part of the group in question, including professing, or conveying pseudo-sincere intentions, but whose real intention(s) is/are to cause disruption and/or to trigger or exacerbate conflict for the purposes of their own amusement. Just like malicious impoliteness, trolling can (1) be frustrated if users correctly interpret an intent to troll, but are not provoked into responding, (2) be thwarted, if users correctly interpret an intent to troll, but counter in such a way as to curtail or neutralize the success of the troller, (3) fail, if users do not correctly interpret an intent to troll and are not provoked by the troller, or, (4) succeed, if users are deceived into believing the troller’s pseudo-intention(s), and are provoked into responding. Finally, users can mock troll. That is, they may undertake what appears to be trolling with the aim of enhancing or increasing affect, or group cohesion.

― Hardaker, 2010: p. 237.

The definition of “trolling” for the present study is not strictly the same, since the troll does not necessarily has the intention of portraying any good will toward the group’s goal of completing the Pokémon game. The intention of creating conflict and frustrating a group of people for personal amusement, though, is very similar. As such, we shall use a less strict definition of trolls, so that we may keep calling them such.

The percentage of people deliberately trolling on the Internet is never clear. Since trolls tend to draw too much attention, it is easy to believe they are more numerous. In the Twitch Plays Pokémon case, this was particularly true: a single input from a troll at the wrong time (or right time, from the troll’s point of view) and the avatar in the game would jump down a ledge, making many more inputs necessary for the avatar to go back to the same coordinate.

THE FIRST SIMULATION MODEL

For the present study, I wanted to know how trolls affected the time for completing Route 23 in Twitch Plays Pokémon. The first step was to develop a simulation model in VBA. A map for Route 23 composed of 305 different coordinates was generated (the same as seen in Tomotani, 2014) and the neighbors for each coordinate were defined. For each coordinate, I defined three different inputs: the “optimal route” (the command which a player wanting to finish the game would input) and two different “troll inputs”. The latter are commands that would make the route as long and frustrating as possible. I defined two different troll inputs because: (a) there were times when two commands could be equally bad; (b) trolls not always want to troll the same way; and (c) to add some variation to the routes’ heat maps presented in this analysis.

The premises to define the commands for the optimal route were:

• Always go through the shortest path towards the objective (the door at the end of Route 23);
• When two commands are equally good, stay away from ledges for as long as possible.

The premises to define the troll commands were as follows:

• If you are close to a ledge you normally would not want to jump over, jump;
• Go away from the direction you are supposed to go;
• Only input “movement” commands (to simplify the model by not having to create simulation models for the game’s menu screen).

Once the simulation model was complete, I defined a “troll factor”, that is, the number of trolls inputting commands. Thus, the troll factor represents the percentage of players that are, in fact, trolls trying to prevent the group from completing the route.

In the simulation, we randomly decided whether the next command would be an “optimal” command or a “troll” command. The chance of the command being a “troll input” was equal to the “troll factor”. Figure 3 shows a heat map of time spent in each coordinate when the troll factor was zero. Since there is no probabilistic factor (that is, all commands made are optimal), this route is always the same: it takes 70 steps to complete this path.

Figure 3. Optimal route, when the troll factor is zero, completed in 70 steps.

Figure 4 shows a heat map of time spent in each coordinate for a simulation run when the troll factor was 10%, that is, on average one out of every ten inputs was made by a troll. In this specific run, it took 285 steps to complete the route, more than four times longer than the optimal path. When tested with a troll factor of 20%, the number of steps necessary reaches the thousands. Figure 5 is an example, where 1,011 steps had to be taken to complete the route.

Figure 4. Simulation run with troll factor of 10%, completed in 285 steps.

Figure 5. Simulation run with Troll factor of 20%, completed in 1,011 steps.

THE SECOND SIMULATION MODEL

The VBA model, though, proved inefficient when dealing with higher troll factors, constantly crashing or giving inconsistent results. As such, I decided to use a more appropriate tool, and developed a simple Discrete Event Simulation Model on the Rockwell Arena software (ARENA, 2016). This model can be seen in Figure 6. (For more information on simulations with this software, see Altiok & Melamed, 2007; and for more on Discrete Event Simulation, see Banks et al., 2009).

On this simulation model, the coordinates were indexed in a “305 lines x 4 columns” matrix in the software, where each line was a coordinate, and each column contained the possible neighbors. With a “Create” module, 100 entities were inserted simultaneously in the model, each representing a different simulation run. Each entity had an attribute named “position”, where the current coordinate of the simulation was recorded, and a “total steps” attribute, where the number of steps necessary to finish the simulation run was recorded.

Figure 6. Simulation model on Rockwell Arena.

In each step of the simulation, a “Decide” module of the Arena decided whether the next command inserted for each run was a “normal” or a “troll” one, and the “position” attribute of each entity was updated. When the current position of an entity was the coordinate for the door at the end of Route 23, the simulation was terminated and the total number of steps to finish the route was registered. At the end of the simulation, a “Read and Write” module was used to record some additional information at an Excel worksheet, such as number of steps on each cell, and number of steps on each area (more of this below).

To see how the percentage of trolls (“troll factor”) affected the number of steps, I made various simulations. For each troll factor used, I ran 100 simulations and calculated the average number of steps to complete Route 23 (it took a while for the 50% troll factor!). The results can be seen on Table 1 and Figure 7.

Table 1. Average number of steps (out of 100 simulations) necessary to finish Route 23.

Figure 7. Well, that escalated quickly. (Keep in mind that the Y axis is in logarithmic scale.)

In other words, with a single troll command in every 20, it is already enough to make traversing this map twice as difficult, and when 50% of the inputs were made by trolls (well… in this case it is almost a philosophical question whether the trolls are the ones trying to prevent others from completing the game or the ones effectively trying to complete it), the number of steps necessary was more than 264,000 times greater than the optimal route.

Additionally, I divided Route 23’s map into five different areas (Fig. 8) to analyze how much time was spent in each area for each troll factor. The results can be seen on Table 2 and Figure 9. It is clear that, the greater the troll factor, the easier it is for the avatar of the game to jump over the lower ledge and into “Area 5”, where he spends most of the time. (See the Appendix for heat maps with average results.)

Figure 8. Division of Route 23 into five areas.

Table 2. Percentage of time spent on each of the five Areas for varying troll factors.

Figure 9. Percentage of time spent in each of the five Areas for varying troll factors.

With these results, it is clear that trolls can be a pain whenever you are trying to conduct some nice experiment online, or have a good argument. Herring et al. (2002) speculate about why trolls (or “trollers”, as he puts it) troll, suggesting that the actions may be a result of: hatred towards people who are perceived as different or threatening by the troller (e.g., women or homosexuals); sense of control and self-empowerment when groups are targeted for their vulnerability (such as disabled people or inexperienced users); or simply because trollers enjoy the attention they receive, even (and maybe especially) when it is negative. According to Herring et al. (2002), this suggests that ignoring the troller might truly be an effective way of thwarting him/her (a.k.a. “don’t feed the troll”). Sadly, this is much harder to do in Twitch Plays Pokémon.

Now consider again my previous work (Tomotani, 2014), where I discussed the fish Grayson and his journey to be a Pokémon master. When you think about it, the average number of steps necessary for a simulation with 50% of trolls seems a bit underwhelming. Considering that one command was inputted every 1.5 second, the 18.492.842 steps would be made in 321 days, less than one year, while random commands made by a fish would take more than 115 thousand years.

I tried to validate this number by using my model to simulate Grayson, but it would take way too long. I adapted the model so that, instead of deciding between a “troll” and “normal” input, it chose randomly between any of the four directions (Fig. 10). After ninety minutes and 5 billion steps, the model seemed no closer to concluding its task. A simple calculation showed me it would take close to 30 days to simulate the equivalent of 115 thousand years (not that long in comparison to the 10 million years it took Earth to calculate the question to the ultimate answer).

Figure 10. Adapted model for the “random” input. Here, the two “troll inputs” and the “optimal input” from the previous model are substituted by four different commands, one for each direction.

So, I aborted the idea of simulating the whole thing, and decided to limit my simulation. I made 10 simultaneous runs, each with a limit of 1 billion steps, 50 times more than the average it took for the troll factor of 50%. After this limit was reached, the simulation would stop and record the results to show how far the simulation managed to go. Spoiler alert: not a single one managed to finish the route. Figure 11 shows a heat map for this experiment, considering the sum of the 10 simulations, a total of 10 billion steps. Figure 12 gives a closer look at the hardest area to traverse (the narrow path on Area 3), where a single input “down” means lots of backtracking.

After 10 billion steps, only once the random simulation managed to get to the “signpost” coordinate, and never getting further than that (you can see the actual signpost in Fig. 12). Table 3 shows the distribution of steps in each Area (of those five defined above) by the random simulation. More than 95% of the time was spent in Area 5, the lower part of the map.

Figure 11. Heat map for the “random” simulation.

Figure 12. Closer look at the most critical part of the map, a narrow path on Area 3. The number on each coordinate represents the number of steps taken on that coordinate (the “###” represents very large numbers).

Table 3. Steps taken in each area in “random” simulation.

As such, the conclusion of my previous work that a random input of commands to complete the game is not a productive approach seems valid. This might be a possible explanation to the deactivation of the Fish Plays Pokémon channel, so that Grayson could focus his energy in activities that make better use of his skills.

REFERENCES

Alcantara, A.M. (2014) Twitch Plays Pokémon: a social experiment from its creator. Mashable, available from: http://mashable.com/2014/02/ 28/twitch-plays-pokemon/#5nL.FQX07sq3 (Date of access: 11/Sep/2016).

Altiok, T. & Melamed, B. (2007) Simulation Modeling and Analysis with ARENA.  Academic Press, Waltham.

ARENA. (2016) Arena Simulation Software. Available from: https://www.arenasimulation. com/ (Date of access: 17/Sep/2016).

Banks, J.; Carson II, J.S.; Nelson, B.L.; Nicol, D.M. (2010) Discrete-Event System Simulation, 5th ed. Prentice Hall, Upper Saddle River.

Haque, A. (2014) Twitch Plays Pokemon, Machine Learns Twitch: unsupervised context-aware anomaly detection for identifying trolls in streaming data. Available from: https://www. albert.cm/dl/twitch_paper.pdf (Date of access: 19/Sep/2016).

Hardaker, C. (2010) Trolling in asynchronous computer-mediated communication: from user discussions to theoretical concepts. Journal of Politeness Research 6(2): 215–242.

Herring, S.; Job-Sluder, K.; Scheckler, R.; Barab, S. (2002) Searching for safety online: managing “trolling” in a feminist forum. Information Society 18(5): 371–384.

Jakobsson, A. (2005) The Good, the Bad, and the Ugly: Bárðar saga and its Giants. Medieval Scandinavia 15: 1–15.

Johns, S. (2014) 20,000 anxiously watch a fish play Pokemon on Twitch TV. Available from: https://www.neowin.net/news/20000-anxiousl y-watch-a-fish-play-pokemon-on-twitch-tv (Date of access: 17/Sep/2016).

Tomotani, J.V. (2014) The infinite fish playing Pokémon theorem. Journal of Geek Studies 1(1–2): 1–8.

Twitch. (2016) Fish Plays Pokemon. Available from: https://www.twitch.tv/fishplayspokemon (Date of access: 17/Sep/2016).

ACKNOWLEDGEMENTS

I am grateful to Henrique M. Soares for proposing this nice topic to study, as well as for suggestions and comments.

João Vitor Tomotani is an engineer who likes to make strange models. He refuses to acknowledge any Pokémon game after the Gold/Silver generation.

APPENDIX

Figure A1. Heat map for the average of 100 simulation runs with a troll factor of 5%.

Figure A2. Heat map for the average of 100 simulation runs with a troll factor of 10%.

Figure A3. Heat map for the average of 100 simulation runs with a troll factor of 20%.

Figure A4. Heat map for the average of 100 simulation runs with a troll factor of 30%.

Figure A5. Heat map for the average of 100 simulation runs with a troll factor of 40%.

Figure A6. Heat map for the average of 100 simulation runs with a troll factor of 50%.

Table A1. Number of total steps on each coordinate for the 100 simulations for varying troll factors (since the table is quite large, please click on the image to see a better resolution).

## Modeling and analysis of a Zombie Apocalypse: zombie infestation and combat strategies

João V. Tomotani

Universidade de São Paulo; São Paulo, Brazil.

Email: t.jvitor (at) gmail (dot) com

Humanity can be quite creative when it comes to thinking up of interesting and fictional ways of being completely annihilated by (and also of ways of romancing) fantastical monsters. Though most people tend to believe that humanity’s intelligence and sense of self-preservation will make us find creative ways to overcome nature’s challenges, it is also believed that man will inevitably be creative in eventually deploying its own demise. In the present work, I will focus on one of the most popular apocalyptic themes of modern pop culture, the zombies.

Ogg (2011) comments how, in modern times, the zombie genre has evolved from a cult to a highly popular theme, estimating its monetary worth as over 5 billion dollars. Zombies are present in movies, books, comics, video games, television series, various toys and products, and even have their own parades.

The zombie apocalypse, though, should not be treated so lightly. After the initial hype, a zombie infestation is likely to bring some problems to civilization as we know it. As such, I believe that there is not sufficient work focusing on zombies and/or how to survive their potential threat. (Though most people tend to believe that a zombie attack is unlikely, the effects of such attack would be relevant; thus, it should be better understood.) Here is presented a discrete-time model of a zombie apocalypse where some parameters are used to control the combat strategies deployed against the infestation.

LITERATURE REVIEW

According to Brooks (2003), a zombie is a reanimated human corpse that feeds on living human flesh (or just brains, depending on the reference). Through a list of recorded attacks, Brooks suggest that zombies might have been in existence since 60.000 BCE (though such record is doubtful to say the least).

The stories about zombies probably originated in the Afro-Caribbean system of Vodou (or voodoo), where people were described as being controlled by a powerful sorcerer. The movie White Zombie, from 1932, is widely considered the first zombie movie, but it was the 1968 movie Night of the Living Dead that made the walking dead theme truly popular, giving birth to the zombie genre. Contemporary zombies are depicted as mindless monsters that do not feel pain and have nothing but appetite for human flesh, wandering aimlessly intending to kill/eat (and, consequently, infect) people. For more information, interesting references are Brooks (2003), Munz et al. (2009) and Fobiya et al. (2013).

Some works were recently published focusing on zombie outbreaks. These books focus on self-defense and organization of the population against zombies, or against other humans after the zombie outbreak inevitably happens (Brooks, 2003; Fobiya et al., 2013).

A seminal work by Munz et al. (2009) proposed a mathematical model of a zombie outbreak. The authors used a structure known as an “Epidemic Model” for their work. Epidemic models are simplified means of describing the transmission of communicable disease through individuals, the earliest mathematical modeling of the spreading of diseases being carried out in 1766 by Daniel Bernoulli (for more info, see http://en.wikipedia.org/wiki/Epidemic_model).

After the work of Munz et al. (2009), many others developed their own models: Calderhead et al. (2010), Idu & Oladele (2010), Flanagan (2012), Blais & Witkowski (2013). These models differ from each other on some of their premises. Munz et al. (2009), for instance, considered four different scenarios: (1) the SZR scenario, where the population consisted of susceptible (or “normal”) humans (S), zombies (Z), and removed individuals (R; humans that died naturally or zombies that were destroyed); (2) the SIZR scenario, where a “latent infection” stage was added (I), where the individual took time before becoming a zombie; (3) the SIZRQ scenario, where a quarantined area (Q) was created to contain both infected individuals and zombies (the flowchart of this last model can be seen on Figure 1); (4) the model with treatment, where a cure for the infection could be developed quickly, in a way that a treatment would be able to revert a zombie to its normal human self. The models of Munz et al. (2009) are similar to the well-known SI / SIS / SIR epidemic models (for more information, see Allen, 1994), where the population may consist of susceptible, infected and removed individuals (the removed are those that cannot be infected again).

Both Calderhead (2010) and Idu & Oladele (2010) reproduced the SZR model. The former shows the difficulties in estimating parameters for predicting the outcome of a zombie outbreak, while the latter presents a hypothetical scenario where the dead could resurrect as normal humans in order to offer analogies with different kinds of studies (such as allegiance to political parties).

One of the biggest limitations of the model presented by Munz et al. (2009) was the fact that the destroyed zombie could always be “resurrected”. Both Flanagan (2012) and Blais & Witkowski (2013) thus proposed a model where the zombie could be permanently removed. The model with permanent removal presented by Blais & Witkowski can be seen in Figure 2.

All the previous works showed that the zombie outbreak would have quite bad consequences for the human species, resulting on the extinction of the susceptible population. Most works also showed that the infection would act so fast that the natural birth and death rates would be pretty much irrelevant for the purposes of the simulation. Finally, the previous authors worked with the simulation paradigm of System Dynamics (SD), one of the earliest paradigms that works with “rates”, “levels” and “feedback loops” (for more information, see Pruyt, 2006).

I believe that a scenario where the human population becomes extinct is quite bad, and that simulation models should be less fatalist when treating such themes, proposing combat strategies instead of only showing the results of an outbreak. As such, I will present a simulation model based on the Discrete-Event Simulation (DES) paradigm where some combat strategies will be explored, with the intention of developing the best course of action.

THE SIMULATION MODEL

First, a “map” where the infection takes place is defined (Figure 3). The map is a square with side length m. Inside the map, a square area with side length c is defined as the human colony. Inside the human colony, another square with side length $\mu*$c  is defined as the “safety” area, where $\mu$ is a “safety factor” between 0 and 1. Finally, the size of an “event cell” is defined as e. The event cell is where the events (encounters) of the simulation take place.

Inside the map, a number  of humans and  of zombies are randomly placed. The humans are distributed inside the colony while the zombies are distributed outside of it.

The simulation model is based on the Discrete-Event Simulation (DES) Paradigm. In the System Dynamics (SD) Paradigm mentioned above (used by all the previously cited authors), the infestation is modeled as a system of nonlinear equations, which causes a complex behavior of feedbacks that are continuous in time. The DES, in turn, focuses on the discrete events that cause changes on the states of the system, considering that no changes occur between events. One of the advantages of the DES is that, since no change occurs in the system outside of the events, the simulation can directly jump in time from one event to the next, usually running faster than the corresponding continuous simulation.

A great advantage of adopting the DES instead of the SD Paradigm for this simulation is that it is easier to insert and analyze nondeterministic factors on the equations, such as the chances of a susceptible human being infected by a zombie on an encounter. It also becomes possible to simulate phenomena that follow probabilistic distributions, making them more realistic (and susceptible to chance).

On this model, I considered that the events happen in “turns”. On each turn, the following sequence of events happens:

1. Humans move on the map;
2. Zombies move on the map;
3. The event cells that have individuals inside them are defined;
4. The encounter inside each event cell is simulated;
5. The status of each individual is updated;
6. Turn restarts.

On this model, zombie infection was treated as a disease that only affects living beings, not as an act of necromancy. The disease is transmitted through contact with an infected individual. Six different categories of individuals were defined for my simulation: susceptible humans (S), active zombies (Z), inactive zombies (I), destroyed corpses (X), trained humans with weapons ( W ), and trained humans with vaccines (V). All humans start as susceptible humans. The difference between inactive zombies (I) and destroyed corpses (X) is that the latter are permanently removed from the simulation (killed), while the former can be cured back to human form, or reanimated as active zombies.

The movements of humans and zombies have the following rules:

1. If the human is inside the safety area of the map, he/she moves randomly in any direction;
2. If the human is outside of the safety area, he/she moves randomly with a slightly higher probability of returning to the safety area;
3. Zombies always move randomly in any direction;
4. Inactive zombies and destroyed corpses do not move.

After all the individuals have moved, the event cells that will be simulated are defined. Each cell that has at least one individual inside will simulate the following events.

(1) All humans have a chance of becoming a zombie, where the chance of this happening is:

$P_{Z} =i *((1-( \frac{1}{1+5*n_{Z} } ))-(1- \frac{2}{1+ n_{S}+2*n_{V}+3*n_{W} } ))$

Where:  i = infection rate; $n_{Z}$ = number of zombies inside the same event cell as the human;  $n_{S}$ = number of susceptible humans inside the same event cell as the human;  $n_{V}$ = number of trained humans with vaccine inside the same event cell as the human;  $n_{W}$ = number of trained humans with weapons inside the same event cell as the human.

With this equation, it is possible to see that the higher the number of zombies in the same event cell as the human, the higher the probability of him/her being contaminated. Likewise, the higher the number of humans in the same event cell, the lower the probability of him/her being contaminated. It is also possible to see that trained humans with vaccines and weapons have a greater influence in the probability than simple susceptible humans.

As an example, the chance of a human being contaminated if he is alone with one zombie on the same cell is 83.3%. If there are two zombies, the probability goes to 90.9%. If there is only one zombie and one trained human with a weapon, the probability is only 33.3%.

(2) All zombies have a chance of being “cured”, “defeated” (become inactive) or completely destroyed:

The probability of a zombie being cured is calculated as:

$P_{C1} =h*(1- \frac{1.5}{1+ n_{V} } )$

Where:  h = cure rate.

The probability of a zombie being completely destroyed is calculated as:

$P_{X1} = \frac{(1- \frac{1.9}{1+ n_{S} + n_{V} + 2.8*n_{W} } )}{2*n_{Z}^{2}}$

And the probability of a zombie being “defeated” (becoming inactive) is calculated as:

$P_{I} = \frac{(1- \frac{1.9}{1+ n_{S} + n_{V} + 2.8*n_{W} } )}{n_{Z}^{2}}$

(3) All inactive zombies have a chance of being reanimated as zombies, cured, or being completely destroyed:

All inactive zombies have a probability r of being reanimated if they are on the same event cell as another active zombie, where r is defined as a reanimation rate.

The probability of an inactive zombie being cured is calculated as:

$P_{C2} = \frac{(1- \frac{1}{1+ 3*n_{V} } )}{1+2*n_{Z}^{2}}$

The probability of an inactive zombie being completely destroyed is calculated as:

$P_{X2} = \frac{(1- \frac{1}{1+ 0.3*n_{S} + 6*n_{W} } )}{1+2*n_{Z}^{2}}$

Four other important parameters for the simulation are: the time necessary for training and equipping humans to fight zombies and the percentage of the population that will be trained and equipped (respectively, $T_{W}$ and $\alpha_{W}$); and the time necessary for developing a cure and the percentage of the population that will be trained to administrate it (respectively  $T_{V}$ and $\alpha_{V}$). After the first case of contamination (first susceptible human becomes a zombie), it takes a time $T_{W}$ for the authorities to train and equip the population with weapons, and a time $T_{V}$ to do the same with the vaccines.

One important point is that every zombie that is cured comes back as a susceptible human. It is considered that all equipment he had before being infected is lost, and he is no longer capable of fighting with the same efficiency after the contamination.

The objective of the simulation is to define the best strategy to contain a zombie infestation, considering:

1. Which is the ideal size of a human colony;
2. Once the first case of contamination is discovered, how quickly must the population be trained and equipped with weapons;
3. Which is the best setup of weapons / vaccines to ensure the survival of as many humans as possible.

SCENARIOS AND RESULTS

Once the model was finished, some scenarios were defined to test it.

I conducted many simulations, trying to understand how each parameter affects the results. One limitation found in the model is its high instability due to the stochastic events (more about this limitation is discussed on the next section). Because of this problem, the conclusions that can be drawn from the model are limited. I present here only the most relevant simulations conducted, and will further discuss their implications on the next section.

Firstly, some parameters were stipulated at the beginning of the tests and were not changed in any scenario. The infection, cure and reanimation rate were fixed respectively as 1.0, 1.0 and 0.8. The map and cell size were fixed respectively as 100 and 4, the number of individuals was stipulated as 8,000 and the initial number of zombies was defined as 12. Finally, the “safety factor” was defined as 0.9.

It is interesting to note that in no scenario zombies stayed inactive for long, being either reanimated, destroyed or cured very quickly.

On the first scenario (Figure 4), the time necessary to train and arm 20% of the population was defined as 500 turns after the first infection. The time necessary to develop the vaccine and train 30% of the population on how to use it was stipulated as 2,000 turns after the first infection. The colony side length was defined as 40 (40% of the map size).

As a result, humans were extinct after around 20,000 turns, with close to 6,500 individuals being destroyed and 1,500 zombies remaining at the end. After the zombies “invaded” the human colony, the infection began to spread quickly. Once the population was trained and armed, the rate of infection got slower and the rate of zombie destruction got higher. Once the population was equipped with vaccines, the number of susceptible humans slowly rose for a while. Humanity’s demise was that the zombie infestation had already gotten out of control, with way too many zombies. Since a cured zombie comes back as a simple susceptible human, the number of humans that were equipped with weapons or vaccines slowly went down and humanity was overrun by zombies.

On the second scenario (Figure 5), the colony side length was reduced to 24. As a result, humans became extinct sooner, after around 10,000 turns, with close to 3,500 individuals being destroyed and 4,500 zombies remaining. Since humans were restricted to a smaller area, it is reasonable to assume that the infection spread more quickly after the zombies invaded the colony.

On the third scenario (Figure 6), the colony side length remained 24, and the time necessary to arm the population increased to 1,000 turns. As a result, humans became extinct very quickly. Once the population was trained and armed, the number of zombies was already overwhelming and there was nothing to be done. Humans became extinct after close to 1,000 turns and more than 7,500 zombies were left at the end.

On the fourth scenario (Figure 7), the percentage of the population trained and equipped with weapons went up from 20% to 25%, and the time necessary to do so returned to 500 turns after the first infection. As a result, the initial surge of contamination was partially contained, with a peak of close to 2,000 zombies at the time the vaccine was distributed (lower than in the previous scenarios). Similarly to the first scenario, though, the zombies slowly managed to contaminate humans equipped with weapons and vaccines, resulting, once again, on the extermination of humanity after close to 20,000 turns.

At this point, I was starting to get worried that humanity might not manage to survive a zombie apocalypse. As such, I started developing scenarios with more aggressive anti-zombie policies, where vaccines would be distributed more than once among the population. Also, I returned the colony size to 40.

On the fifth scenario (Figure 8), the percentage of the population trained and equipped with weapons went back to 20%, and the time necessary for this was kept at 500 turns after the first infection. After an initial time necessary to develop the vaccine and train 30% of the population on how to use it stipulated as Tv1 = 2,000 turns after the first infection, a second time of distributing vaccines was stipulated as Tv2 = 6,000 turns. For my despair, though, humanity was once again exterminated after a long battle. The zombies were close to be eradicated after 18,000 turns, but slowly regained the upper hand.

Finally, a sixth and last scenario (Figure 9) was created. Deciding to defeat the zombies at all costs, four moments of vaccine distribution were stipulated at turns 2,000; 6,000; 10,000; and 15,000. Finally, humanity managed to eradicate the zombies, but with the loss of 3,000 lives.

CONCLUSION

Herein, a mathematical model of a zombie outbreak was successfully developed and tested. With the results of the simulation, it is possible to draw the following conclusions (Table 1 summarizes the main results).

The size of the human colony impacts significantly the results of the outbreak, which varies according to the colony’s organization. Unless the human settlement is capable of organizing itself quickly and efficiently to combat a zombie attack, the model recommends that you run away from highly populated areas if you want to survive. This conclusion is compatible with the study made by Alemi et al. (2015). Similarly, Brooks (2003) identify urban centers as one of the most dangerous places to be when zombie outbreaks start. Since the objective of the present study is to preserve humanity, not individual survival, I believe it is important that urban centers be better prepared for outbreaks, to respond accordingly when they happen.

The model also suggests that it is important to react to a zombie infestation as quickly as possible to contain the initial outbreak, avoiding a “point of no return”, when the zombies slowly gain ground over the remaining humans. Initially, I believed that the model would be interesting to show the tradeoff between weapons (killing the zombies) and vaccines (avoid killing zombies while trying to cure them). It became evident, however, that zombies are quite dangerous when not quickly taken care of, since their numbers can grow exponentially. If humans want to survive, containing the initial wave of zombies with weapons is unavoidable (interestingly, this topic was never touched upon in previous works).

In addition, I believe that the model has room for many improvements and is far from ideal if we want to actually develop anti-zombies combat strategies. One idea is to use yet another simulation paradigm, namely the “Agent Based Modeling” (ABM), which is much more recent than the SD and DES. The ABM is useful to simulate interactions of autonomous individuals acting according to simple rules. With such model, it would be possible to further develop human actions and strategies, for example: making humans walk in groups (preferably with one armed individual) and having a better logic in the direction of their movements.

Another problem with the model is that it is highly unstable and sensitive to modifications on its parameters, since most events are stochastic (from movement of the individuals on a big map, to the outcome of the encounters) and a different result of each event has a great and chaotic impact on the rest of the simulation (for instance, having two armed humans become zombies instead of none on an encounter). As such, most of the conclusions presented here should be approached carefully and, for that reason, I did not dare to present a curve of the impact of each parameter.

Most importantly, further work must be conducted to better define the parameters of the simulation. I do not have sufficient data to estimate the chances of a human being infected by a zombie upon an encounter, nor do I know how long it would take to develop a cure for the zombification. It is also quite possible that the impact of being trained and having a weapon in a zombie apocalypse is being overestimated on my model, since I probably would be quite unsettled if an undead was trying to eat my flesh.

REFERENCES

Alemi, A.A.; Bierbaum, M.; Myers, C.R.; Sethna, J.P. (2015) You Can Run, You Can Hide: The Epidemiology and Statistical Mechanics of Zombies. Quantitative Biology. Cornell University Library. Available from: http://arxiv.org/abs/1503.01104 (Date of access: 15/May/2015).

Allen, L.J.S. (1994) Some Discrete-Time SI, SIR, and SIS Epidemic Models. Mathematical Biosciences 124: 83–105.

Blais, B. & Witkowski, C. (2013) Zombie Apocalipse: An Epidemic Model. Available from: http://terpconnect.umd.edu/~jzsimon/hlsc374/ref/Blais+Witkowski-handout-2013.pdf (Date of access: 06/May/2015).

Brooks, M. (2003) The Zombie Survival Guide: Complete Protection from the Living Dead. Three Rivers Press, New York.

Calderhead, B.; Girolami, M.; Higham, D.J. (2010) Is it safe to go out yet? Statistical Inference in a Zombie Outbreak Model. Available from: http://www.strath.ac.uk/media/departments/mathematics/researchreports/2010/6zombierep.pdf (Date of access: 06/May/2015).

Flanagan, K.M. (2012) Zombie Attack! An Introduction to Quantitative Modeling. National Center for Case Study Teaching in Science. University of Calgary, Alberta, Canada. Available from: http://sciencecases.lib.buffalo.edu/cs/files/zombie.pdf (Date of access: 06/May/2015).

Fobiya, A.; Ottoni, A.; Pazos, D. (2012) Protocolo Bluehand: Zumbis: Seu guia definitivo contra os mortos e os vivos. Nerdbooks, Curitiba.

Idu, E.I. & Oladele, R.O (2010) An Epidemic of Zombie Infection: A mathematical Model. Available from: https://www.unilorin.edu.ng/publications/oladelero/Zombie_paper.pdf (Date of access 27/Mar/2015).

Levin, S.A.; Greenfell, B.; Hastings, A.; Perelson, A.S. (1997) Mathematical and Computational Challenges in Population Biology and Ecosystems Science. Science, Vol. 275(5298): 334–343.

Munz, P.; Hudea, I.; Imad, J.; Smith, R.J. (2009) When zombies attack! Mathematical modelling of an outbreak of zombie infection. In: Tchuenche, J.M. & Chiyaka, C. (Eds.) Infectious Disease Modelling Research Progress. Nova Science Publishers, Hauppauge. Pp. 133–150.

Ogg, J.C. (2011) Zombies worth over \$5 billion to economy. Available from: http://www.nbcnews.com/id/45079546/ns/business#.VRW2gvnF8pk (Date of access: 06/May/2015).

Pruyt, E. (2006) What is System Dynamics? A Paradigmatic Inquiry. In: Größler, A.; Rouwette, E.A.J.A.; Langer, R.S.; Rowe, J.I.; Yanni, J.M. (Eds.) Proceedings of the 24th International Conference of the System Dynamics Society. System Dynamics Society, Nijmegen. Pp. 102.

## The munchkin dilemma

João V. Tomotani

Universidade de São Paulo; São Paulo, Brazil.

Email: t.jvitor (at) gmail (dot) com

As most of you might have already guessed by the title, I am a nerd. As such, a relatively large part of my life was invested in hours of playing video games, reading nerdish stuff and playing tabletop role-playing games (RPGs).

RPGs should not be confused with board games, card games or board wargames. RPGs require players to “create fictional personas (…) within the rules and genre specified by the game, and then collectively engage in protracted storytelling” (Williams et al., 2006). As such, though the dungeon master might give some rules, background information and create a whole world for the players to explore, playing RPGs and creating your character is quite an open experience, where the player can and should use his/her creativity to have as much fun as possible together with the other players.

My experience with RPGs is mostly restricted to the Dungeons & Dragons system (D&D), which is probably the most famous tabletop RPG in the world. It was created in 1974 by Gary Gygax and Dave Arneson and, through the years, had many revisions of the rules, with new editions being published. Literally hundreds of books (Wikipedia, 2014) with new rules and classes were written to expand the ever-growing options for the players and dungeon masters. Also, D&D is remarkably less controversial than Storytelling RPG systems, with fewer parents blaming D&D for some sort of small disorder their children have, like a tendency to murder goats, summon cosmic horrors or whatever.

On a D&D game, players form a group of adventurers (or party) and embark on a journey for wealth and glory. Inside a world created by the dungeon master, the players are free to explore dungeons, destroy castles, build cities, save princesses and be awesome. Obviously, this never happens, as players inevitably ends up doing stupid actions which usually gets them (and everyone near them) killed; but this is the fun of RPG, probably.

One can divide a typical D&D game in different stages. There are moments when the party is exploring a forest, gathering information in the middle of a big city, furtively invading a well-guarded castle or fighting a horde of beasts. The party, thus, usually have different characters with different roles to fulfill each task (or not, since teamwork usually is not part of the average D&D party). Battles are inevitable and an important mechanics of the game, with whole chapters of the rule books devoted to it. Because of all the above, some players end up reading lots of books to find nice abilities and build a good and useful character. Being a hopeless nerd, of course I’ve done that.

THE MUNCHKIN DILEMMA

Today, I will present what I like to call the “Munchkin Dilemma”.

The word munchkin originated with the famous “The Wonderful Wizard of Oz” novel (often called simply “The Wizard of Oz” on the numerous reprints and the 1939 movie, which, by the way, recently made 75 years), written by Lyman Frank Baum in 1900. Munchkins are the natives of the Munchkin Country, and were originally said to be about Dorothy’s height. On the famous movie adaptation, though, the Munchkin Country was called “Munchkinland”, and the munchkins were depicted as being much shorter than the other Oz residents, being played by either children or adults with dwarfism. The word munchkin ended up entering the English language due to the popularity of the movie, as a reference to small children, dwarfs and anything of small stature, much like the Oompa Loompas.

In RPG jargon, however, munchkin is a pejorative term used to depict the “power player”, meaning the player who tries to make optimized characters, using the many different books to conceive the most efficient, overpowered killing machine instead of a character fun to play with. I guess the reason they are called munchkins is because they play like children, though it would make a lot more sense if it was because they like to play with dwarves. They are despised by the other serious and mature adults who play RPG.

There is a lot of prejudice associated with this term, of course. I expect no one likes making an useless character, but I guess that players that for some reason want to play with monks or bards tend to feel bad when a wizard does their job (much) better, and then they start complaining about not wanting to make a “power” character because they prioritize the roleplaying part of the game (they should be happy, though, since they are true to the uselessness of their characters). A card game created in 2001, where the player’s objective is to get to a high level while preventing the opposing characters of doing the same, was named Munchkin with the intent of making fun of such playing style (it is a great card game, by the way).

Though there are many ways one player can be a munchkin, most of the times the munchkin’s objective is simple: to be a damage dealing, powerhouse chucknorresque machine. And to do so, he wants to have the strongest class, with the best configuration of feats and the strongest weapon.

Usually, the best way to do so is with a complex combination of many classes, or with a cleric or wizard. An optimized fighter, for example, might fight with a spiked chain and use the Improved Trip and Improved Disarm feats to become a very strong, overpowered and forever alone hated fighter.

With all that in mind, I decided to create my own version of the Munchkin Dilemma D&D 3.5 edition, which I will try to answer here. The dilemma is stated as: “Which of the basic classes from the D&D Player’s Handbook v.3.5 (Cook et al., 2003a) is the best melee class when it comes ONLY to one-on-one combat? No multiclassing, no dips, no fancy stuff, just blood, death and violence.”

The dilemma may be rewritten as: “Which class should I take if I want to kick some monster ass?”

SIMULATION PROCESS

In an attempt to answer one of humanity’s most pressing questions, I decided to create characters with the melee classes from the Player’s Handbook, at different levels, with normal progressions (focusing on being strong at 1×1 combat) and equipment that corresponds to their expected treasure. The characters would then be tested against each other to see which one would have the best victory/defeat rate.

The first classes chosen were: Fighter, Barbarian and Ranger. Though the morphed Druid is said to be the strongest melee, it is also: (1) not a usual munchkin class; (2) difficult to simulate because of the many resources (wild shape strategies, such as grappler, trampler and defender; animal companion; spells). So I decided to leave druids for later. At first, I wanted to add the Rogue just to see how well it would fare, but at lower levels he wouldn’t be able to use the keen rapier + telling blow combo and at higher levels he would likely face fortified armors, so it wouldn’t make sense. I added the Monk just for the fun. The Paladin and the Cleric were not chosen at first because they were either too specific against some enemies or way too complicated to simulate. The levels chosen were: 1, 6, 12, 20. Though it makes absolutely no sense to have a level 20 pure melee Fighter with a two-handed sword, I stipulated that there would be no multiclassing for the first experiment. The race for all characters was decided as human, so no one would have any obvious advantage.

The fights are 1×1, with each character starting close to each other (avoiding charges and strategies of allowing the opponent to attack first and later using full attacks).

The ability scores for each character were decided by using the “Elite Array” distribution suggested on the Dungeon Master’s Guide (Cook et al., 2003b: p. 169). The distribution of the scores is 15, 14, 13, 12, 10, 8 among the abilities, whichever way the player wishes. The abilities and the extra ability points gained on levels 4, 8, 12, 16 and 20 were chosen according to the classes’ strengths. Similarly, the feats were chosen in accordance to the classes’ characteristics. The money for each level was also taken from the Dungeon Master´s Guide (Cook et al., 2003b: p. 135), with the exception of the 20th level, where a random large amount of money was chosen (usually, a lot of the money at this stage goes to other random stuff not really necessary for battle).

Also, there are different strategies the fighter might have. He can be the typical sword & board user, the two-handed weapon user, or the two weapons user. All three were considered in this study. The stats of each characters, as well as the feats chosen, are displayed on Table 1.

Some considerations and strategies were assumed for the character building (the characters’ detailed information, relevant for combat, can be seen on Table 2–7):

• The sword & board fighter is mainly a defensive character. His strategy consists of not being hit (with the Combat Expertise feat) and using his superior BAB to get some attacks each turn. He will use his money on good shield and armor, decent weapon and rings of protection and/or amulets of natural armors. Each turn, if no attacks connect, he will slowly reduce the BAB penalty spent on Combat Expertise;
• The two-handed sword fighter uses power attacks with his great sword, trying to do the most damage possible each turn. His money will be heavily invested on a powerful weapon and strength boosters. If some money remains, he might get a decent full-plate and a flying shield. Each turn, if no attacks connect, he will slowly reduce the BAB penalty spent on the Power Attack feat;
• The two-weapon fighter uses the “two-weapon fighting” feat tree, and tries to hit as many attacks as possible each turn. Pretty much all his money will go to his expensive weaponry;
• The barbarian rages as soon as he can and uses the same strategy as the two-handed sword fighter. The Leap Attack feat is pretty much default for the barbarian, so I felt like he needed to have it even though there are no charges in the simulation. His money is better spent on weapons and damage / HP boosters, since there is no point in getting a good light/medium armor for a raging barbarian. He always use maximum points for the full attack no matter what;
• The ranger was a big question mark. I decided right away to ignore the animal companion and go for the Distracting Attack variant or something, but had some doubts as for the favored enemy, which could turn out to be a bit overpowering for this simulation. I decided that he should have the favored enemy “humanoid (human)” since this is a common choice among players and is an important characteristic of the ranger (not having it would make this class way inferior on this competition). The favored enemies were chosen in order of my preference: arcanist (1st), undead (2nd), human (3rd), construct (4th), elemental (5th). The ranger spells were replaced by the Champion of the Wild variant from Complete Champion (Stark et al., 2007: p. 50). His money will be spent similarly to the two-weapon fighter;
• Though the monk was included just for fun, I had some problems on creating the character. Since this is an all-out damage battle, I excluded feats of disarming and tripping, which are great (though the monk is never great, thanks to his horrible BAB). So, to make things fair, I used some feats from the Tome of Battle book, which we usually don’t use because of the overpower stuff in there. Since the monk suffers from MAD (Multiple Ability score Dependency; damn, the monk is horrible), his money is spent on items for pretty much all abilities. One good equipment for the monk would be the Monk’s Belt, but it takes away the monstrous Belt of Battle. Damn monk, I hate thee.

SIMULATION VS. ANALYTICAL ANALYSIS

I decided to use a simulation method instead of analytically solving probability equations, because doing it analytically takes an absurd amount of time, since the number of combinations are enormous. To exemplify, I tried to make the Barbarian vs. Fighter (two swords) level 1 fight analytically. The terrible result is shown on Tables 8–11. The problem is that each attack has three possible outcomes (hit, miss or critical), the two-swords fighter, for instance, generate 2 to the third power possible outcomes with each attack. When considering more attacks and more health points, the number of combinations grow considerably. Imagine a fight of a level 20 monk against a level 20 ranger: the monk’s 7 attacks and the ranger’s 8 all have three possible outcomes. Considering the total HP, it is possible for the ranger to hit the monk 11 times without defeating him, while the monk can hit the ranger 14 times without defeating him. After the fighter’s second attack, I decided to extrapolate the results previously found to the remaining rounds. I believe I got close enough to the answer, but it took some effort. Thus, the barbarian defeats the two-swords fighter more than 4 out of 5 times.

RESULTS

In this section, I will present the results of the simulation (which was made in VBA), as well as some considerations regarding critical aspects of D&D combat. For each fight, I will present what was the winning percentage of each build, the average percentage of remaining Health Points of the winner, the average number of rounds it took for the winner to defeat the opponent, and how many times the winning party had the initiative of the fight. Each table shows the result of a build against each of the other builds. The information shown are:

• Number of victories and percentage of victories: out of 1000 fights, how many were won by each build;
• Remaining HP and percentage of remaining HP: on average, how much HP this class had left in the fights it won;
• Average number of rounds: on average, how many rounds it took for this class to win the fights it won;
• Initiatives won and percentage of initiatives: out of 1000 fights, how many had this build winning the initiative roll;
• Winning with initiative: how many fights this build won AND had the initiative.

Also, henceforth, the sword & board Fighter, the two-handed sword Fighter and the two-weapons Fighter shall be called, respectively, S&B Fighter, THS Fighter and TW Fighter.

LEVEL 1

On level 1, it is possible to see that the Barbarian had little trouble dominating all the other builds, with winning percentages higher than 70% against any opponent and an average of less than two rounds to finish a combat. This result is not unexpected, since the Barbarian acquires the very strong Rage ability on level 1. The Ranger and the Monk, on the other hand, performed poorly against all the opponents, and had a technical draw when faced against each other. This result also is not unexpected, since both classes have low hitting rates at the first level – the Monk’s flurry of blows is still underdeveloped and the Ranger does not yet acquired his first Combat Style class ability (two-weapon fighting).

In the middle of the pack are the three fighter builds. The S&B Fighter, with his high armor class, managed to defeat the TW Fighter and the THS Fighter, while the TW Fighter defeated the THS Fighter. The three fights were relatively close. Table 12 shows the detailed results of the fights.

Also, it is interesting to compare the results of the simulation with the ones calculated analytically on the first part. It was calculated that the Barbarian would defeat the TW Fighter more than 80% of the time, while in the simulation, it is seen that the Barbarian would win around 70% of the time. This difference shows that some of the simplifications adopted in the first part were probably incorrect.

Table 13 shows some averages and consolidated results. It is interesting to see how having the initiative impacts the outcome of the fights. The Ranger and the Monk had most of their wins when they had the initiative, while the Barbarian had a very low number of defeats when having the initiative.

LEVEL 6

On level 6, once again the Barbarian defeated all the opponents. This time, though, he had a much harder time against all the Fighters, and the THS Fighter in particular. By level 6, the Fighter builds gained a lot of feats, mainly the Weapon Specialization, Power Attack, Power Critical and Improved Initiative ones, which made them considerably stronger. The S&B Fighter and the THS Fighter did very well against the other classes, and had a technical draw when they fought against each other.

The Ranger and the Monk, on the other hand, dragged terribly behind the other classes. The Ranger’s strongest resource in a fight lies with her Favored Enemy ability and, for this simulation, this ability is only acquired against humanoid (humans) on level 12. The Monk suffers because of his lower Base Attack Bonus; by level 6, all the other classes have acquired their second attack, while the monk still has only one (without considering the flurry of blows). The detailed results can be seen on Table 14.

Table 15 shows again some averages and consolidated results. Compared to the level 1 combats, the ones on level 6 took much longer due to the increase in Health Points, without much damage dealing improvement (which usually comes with stronger equipment at higher levels). The builds that did better at level 6 were the ones that were capable of consistently dealing high damage with few attacks (THS Fighter and Barbarian), instead of many, easier-to-miss attacks and low damage.

Once again, the initiative had a lot of impact on the results of the fights. The only outlier would be the Ranger who won most of her fights without the initiative (though most of them were against the monk).

LEVEL 12

On level 12, once more the Barbarian defeated all opponents without much trouble. Most of the merit can be given to a much higher number of Health Points, and mainly to the much higher damage output per round of the build (Greater Rage, Gloves of Strenght +4, Collision Weapon, Boots of Speed), which reduced his average number of rounds to finish a combat to less than two. In fact, at this stage the equipment starts playing a much larger role on the combats, allowing all classes to finish their fights in a much shorter time.

The Ranger, once again, struggles to win even a small number of fights. The favored enemy ability is still underdeveloped and the two weapons are very expensive to upgrade. For this reason, the TW Fighter also does very poorly on this scenario where equipment is so relevant.

The Monk, on the other hand, performs surprisingly well (I definitely did not expect the Monk to win a single fight!). Thanks to a fully developed Flurry of Blows and the Monk’s Belt, he is capable of dealing a lot of damage to builds with low Armor Class, losing badly only to the S&B Fighter and the Barbarian.

Finally, the S&B Fighter convincingly defeats the THS Fighter and all the other opponents but the Barbarian. Thanks to stronger equipment, the S&B Fighter is capable of defeating the opponent quickly, while keeping a very high Armor Class. The detailed results can be seen on Table 16.

Table 17 shows again the averages and consolidated results. The fights are much shorter thanks to the increase on damage output with the better equipment. It is clear that the initiative factor becomes even more impacting than in the two previous scenarios. A high percentage of the fights won by the Ranger and the Monk are when they have the initiative. This effect is also a consequence of the higher damage output.

LEVEL 20

Finally, on level 20, the Barbarian is once more completely dominant. With a monstrous amount of Health Points and damage output, he easily defeats all other classes and completely destroys the S&B Fighter, who is incapable of dealing enough damage.

The S&B Fighter, though completely defeated by the Barbarian, overpowers all the other classes through consistent damage and very high Armor Class. The TW Fighter and the Ranger, with enough money to equip themselves, perform very similarly, defeating both the Monk and the THS Fighter.

The Monk, once again, is crushed by the other classes. The Monk’s interesting feats and abilities are not enough to deal with increasingly powerful weapons and armors. The detailed results can be seen on Table 18.

Table 19 shows the averages and consolidated results. The fights are still short, with high damage output by all classes. The information of the consolidated results were used to generate the three graphics presented on Figures 1–3.

Once again, the initiative factor is more important than in the previous three scenarios. Most of the fights won by the Ranger, Monk and TW Fighter happened when they had the initiative, while the Barbarian almost did not lose when she had the initiative.

CONCLUSION

First and foremost, I find it important to state clearly that the combat is but a small part of the D&D game. Though it might be tempting to create an efficient character for battles, there are many different ways a character can be truly powerful, useful and, most important of all, fun to play with. Secondly, 1×1 melee combats are (thankfully) rare in D&D games. Most battles involve many characters and enemies, making them much more fun and challenging, requiring some amount of team work, planning and creativity. Thirdly, even on 1×1 melee combats, only going for full attacks is not that common. Characters can (and should) have different tactics that involve disarming, tripping, sundering or any other resource that allow them to overpower the opponent. Having said that, this small simulation shows some interesting points.

The Barbarian is clearly the strongest build of the ones simulated when considering raw power. The high attack bonus and damage output surpass the most solid defenses, while the enormous amount of Health Points protects against the fiercest attacks. The Barbarian is clearly superior to the THS Fighter, when it comes solely to melee fights.

Monks, Rangers and TW Fighters, builds that use a large number of attacks, have trouble against defensive characters, since many of the attacks do not connect. On the other hand, they can consistently defeat characters with low Armor Class, making them interesting choices against Wizards and other spellcasters.

The most interesting finding of this simulation, though, is the increasing impact of the initiative on the melee combats, when considering the possibility of a “full attack”, as the characters grow stronger.

Due to powerful items such as Boots of Haste and Belt of Battle (or, even better, spells such as Haste or Righteous Wrath of the Faithfull), winning or losing the initiative can be more important than a careful planning of the attack or the careful creation of a character. This might not be relevant in situations where, as stated above, many characters are fighting at the same time, but it can be a problem when 1×1 melee fights affect the whole outcome of the adventure.

As such, some adaptations of the initiative rule may be interesting when such fights are necessary (gladiator fights, generals meeting in the battlefield, among others). One interesting alternative is the one presented by the Shadowrun system (Hardy et al., 2013) where, instead of rolling initiative once for all your actions of the round, you roll initiative to define an “initiative gauge”. The character to act is the one with the highest “initiative gauge” and each action taken depletes this gauge by some amount.

With the release of D&D 5th edition, many changes were made, including combat rules. Soon enough, I shall play it to give my take on it!

REFERENCES

Cook, M.; Tweet, J.; Williams, S. (2003a) Dungeons & Dragons Player’s Handbook: Core Rulebook 1 v3.5. Wizards of the Coast, Renton.

Cook, M.; Tweet, J.; Williams, S. (2003b) Dungeons & Dragons Dungeon Master’s Guide: Core Rulebook 2 v3.5. Wizards of the Coast, Renton.

Hite, K. (2009) Rough Magicks. Pelgrane Press, London.

Hardy, J.M.; Brozek, J.; Croteau, R.; Dynna, M.; Goodman, P.; King, R.; Large, A.; Oratz, D.; Pavao, A.; Ratkovich, S. (2013) Shadowrun, 5th ed. Catalyst Game Labs, Lake Stevens.

Stark, E.; Thomasson, C.; Louve, R.; Marmell, A.; Astleford, G. (2007) Complete Champion. Wizards of the Coast, Renton.

Wikipedia. (2014) List of Dungeons & Dragons rulebooks. Available from: http://en.wikipedia.org/wiki/List_of_Dungeons_%26_Dragons_rulebooks (Date of access: 01/Sep/2014).

Williams, J.P.; Hendricks, S.Q.; Winkler, W.K. (2006) Gaming as Culture – Essays on Reality, Identity and Experience in Fantasy Games. Oxford University Press, Oxford.

## The Infinite Fish Playing Pokémon Theorem

João V. Tomotani

Universidade de São Paulo; São Paulo, Brazil.

Email: t.jvitor (at) gmail (dot) com

THE INFINITE MONKEY THEOREM

I will start by presenting this little famous theorem. The Infinite Monkey Theorem states that if you have a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time, eventually it will end up reproducing some famous text, like the complete works of William Shakespeare, The Lord of the Rings, or the very article you are currently reading (the process used to write this article is not that far from it, actually).

This is the sort of theorem that clearly became famous because of its funny name. And, while I do find the name amusing, the theorem itself is also quite interesting; well, at least more interesting than the real-life experiment that the University of Plymouth decided to do, which remarkably showed that a monkey with infinite time would probably be able to defecate infinitely and destroy an infinite amount of typewriters (BBC News, 2003). Also, for some reason, friends of mine tend to state the Infinite Monkey Theorem as having an infinite amount of monkeys with an infinite amount of typewriters, instead of the infinite time stuff. Though this would solve the small problem of having to find an immortal monkey, maybe an infinite amount of monkeys would also pose a problem (for more information, you can read “what would happen if you were to gather a mole (6×1023) of moles” from Randall Munroe, 2014) – let me simply say that this would make Planet of the Apes a lot more literal.

In any case, recently a small event reminded me of the Infinite Monkey Theorem. I am talking, of course, about Grayson Hopper, and his quest to become a pokémon master. Grayson is a fish who rose to absolute stardom after his owners decided to make him play Pokémon. By swimming in his aquarium, Grayson’s position is detected by a camera and a command is sent to the game. You can follow his play on Twitch. Not much is going on right now (or ever).

Grayson is trying to prove by himself that, through a generator of random movements and a lot of time, one should be able to finish a game like Pokémon, which you can play by pressing only one button at a time and not having to rely on timing or stuff like that. I mean, if a ten year old boy can do it, why can’t a fish?

And what the Infinite Monkey Theorem states is that he can do it, right? The fish might very well be able to beat the game in his lifetime, since a really large number of combinations of buttons will be generated, and one of them MUST be the correct one. Well, meet Route 22 (Fig. 1).

From now on, I will consider that all of you had a childhood and are thus capable of following the game mechanics.

Route 22 could be called the nightmare of random walking (for more information on random walking, or “why a drunk always come back home while a drunk bird may be lost forever because of extra dimensions and stuff”, see Math Explorer´s Club, 2009). The game mechanics of one-side-crossing-only ledges clearly makes this route goddamn awful. Also, Grayson tends to stay still for some seconds on the same area of the aquarium, thus repeating the same command a lot (a “down” command one time more than necessary can be fatal here). So, is it impossible?

Only one way to find out…

THE INFINITE FISH PLAYING POKÉMON SIMULATION MODEL

To simplify, let’s say that the movement of the fish in the aquarium is a random process that can be categorized as a Markov chain. A Markov chain is one of the simplest stochastic processes, where the next entry in the chain depends only on the current position (or state), and not on the history of entries (this lack of history is called the Markov property). The random walk is an example of a Markov chain. Though the movement of the fish depends on the history (usually he will keep swimming on the same direction), let’s not waste time trying to model this further, because time is precious and we wouldn’t like to waste it on useless stuff like a useless model.

Grayson’s aquarium is divided into nine squares (Fig. 2). Each square has a specific command, with one exception, the “randomize!” command, which randomly chooses one of the other eight. Let’s consider that one command is chosen after every second.

Thus, the Markov chain describes a process where the random walker is on a position among nine, and has a random probability of going to any of the nine positions (including staying on the same one) after one second.

The matrix that gives the probability of transition to each of the states in a Markov chain is called the transition matrix. The transition matrix can be dynamic or stationary in time. For example, giving the fish more food would make it dynamic, with a higher probability of him going to the surface of the aquarium. But let’s consider a stationary matrix for simplicity.

After watching Grayson playing Pokémon for 2 minutes (boy, that was fun!), I generated some numbers for the transition matrix (Table 1). I decided that the probability of him staying still in the same position for one second would be 80% in any of the positions (though I must say that it is probably much higher). Also, I considered that the probability of him going to an adjacent area was higher than crossing the aquarium from one instant to the other. Since the position of the commands changes over time on the twitch play, I decided to generate them randomly and leave them as such. Admittedly, the fish spends a lot of time near the surface, but let’s not focus on the details since the randomization of the commands also contributes to the randomization of the process.

By multiplying the transition matrix by itself a number “n” of times, you can find the accumulated transition probabilities after n events. For instance, if I multiply the matrix by itself twice, I will have the probabilities of Grayson transiting between two states after two seconds.

Since the transition matrix is stationary, aperiodic (no time limitations from transiting from one state to the other) and has no recurrent state (states with probability of 0, transition state, or 1, absorbing state), it is also said to be ergodic, that is, the system has the same average behavior over a long period of time. Multiplying the matrix by itself 128 times, I get to the following matrix (Table 3).

That is, the probability of Grayson being in one of the states after a long period of time is not dependent on his initial state, only on the transition matrix. Looking at this matrix, I can see that the probability of the fish spending some time on the center of the aquarium is slightly higher than on the edges, given the numbers I decided for the transition matrix. Since the distribution among the states is quite similar, I am happy with the transition matrix chosen. After modeling the fish movement, it was time to model the map of Route 22 (Fig. 3).

As can be seen on Figure 3, for each coordinate on the map, a number was attributed. This number states movement restrictions or other characteristics. Coordinates with the number “1” have no movement restriction, while coordinates with the number “3” has restrictions with the “up” direction, and coordinates with the number “2” have no restrictions, but the “down” direction skips a square. Once again, to simplify the model I considered that Grayson cannot go to the right of the map, leaving the area of Route 22.

The green area is the “wild grass” area. I decided to count the steps taken on “wild grass” areas to estimate how many pokémon battles Grayson would face in his epic quest. The probability encounter formula, according to Bulbapedia (2014) is defined as P = x / 187.5, where x is the encounter rarity variable. Considering a common encounter rate (x = 8.5), Grayson should face S*0.05 battles, where S is the number of steps taken on wild grass.

The desired results are the number of total commands necessary for Grayson to arrive at his destination. Other interesting results are the number of battles and the number of commands given while in “paused” state.

As a limit of commands (thus, time), at first I thought that the simulation should go no longer than the average life span of a goldfish. Considering a life span of 25 years, this would be the same as 788,400,000 seconds/commands (if he keeps pressing the A or select button, or moving while on paused state, it still counts as a command for the simulation).

This number of commands, though, is unreasonably high and would probably only increase the entropy of the universe. So, I decided to just let it run for a couple of minutes and see what would happen after the equivalent of one day for the fish.

The model was written in VBA and the program ran on my personal computer.

RESULTS AND DISCUSSION

The results are as follows:

• Number of steps to complete: 86400 (1 full day, didn’t complete, ended in coordinate 14 x 18);
• Number of steps on “wild grass” areas: 351;
• Estimated number of battles: approximately 18;
• Number of steps taken on paused state: 47796.

Thought I only simulated the equivalent of one “fish day”, whenever I stopped to watch the simulation, it was clear that the character in-game was struggling to get out of the lower part of the map. It was expected, almost inevitable, for Grayson to spend most of his time randomly walking around the 76 coordinates that composed this artificial cage (with only one way out, coordinate 13 x 34, and many ways in); more than 99% of the time was spent there. Positioning the character right in front of the exit and moving “up” twice was a very specific command that happened only twice during the simulation, with the character going back right after. Also, more than half of the commands were given while on paused state.

A DIFFERENT APPROACH

The greatest limitations of the study above are the short simulation time and the fact that the simulation was run only once. Considering how the stochastic process of the fish swimming impacted the results, it would be necessary to run the simulation dozens of times to achieve better and more valid results.

With that in mind, I now propose a different take on The Infinite Fish Playing Pokémon experiment. Instead of simulating the random process of a fish swimming, I will propose some simplifications in the previous model, so that the problem can be solved on a deterministic way. Though the simplification will reduce considerably how well the model represents reality, the results presented will offer valuable information on the magnitude of the problem.

EXPLANATION OF THE NEW APPROACH

On my first attempt to model the Fish Playing Pokémon, I considered that the movement of the fish in the aquarium was a random process which could be represented as a Markov chain. Since the position of the fish in the aquarium was considered a Markov process, this stochastic process was what defined which command was sent to the Pokémon game.

Since the probability of each command being chosen depended on the position of the fish in the aquarium, the modeling of the Pokémon game was a complex process that needed simulation.

This time, I will simply ignore the position of the fish and consider that the command sent to the game is a completely random process, with each of the directional commands having the same probability of being chosen. This way, the movement made on the game depends only on the current position of the character in the map, that is, the game itself can now be modeled as a Markov chain. With this simplification, the probability of the character being in each position can be defined on a deterministic way.

IMPLEMENTATION

Once again, the first step is to attribute a number to each coordinate in the map, and define which the possible movements for them are. There are 305 different possible coordinates in Route 22 (Fig. 4). Considering four possible commands, each command has a 25% chance of being chosen.

If the chosen command is impossible to be made, the character stays on the same coordinate. For example, if the character is on square 305, there is a 25% chance of him going to coordinate 267, 25% of going to 304, and 50% chance of staying in the same place. These probabilities, as stated, do not vary.

Having defined the coordinates and the possible movements, I can define the transition matrix. Since I have 305 possible positions, the transition matrix will be a 305 x 305 matrix (Figure 5). From each position, the character can do, at most, 4 different movements. That way, at least 301 movements will have a zero (for instance, the probability of going from position 127 to 29 in a single step is zero).

By multiplying the transition matrix by itself a number “n” of times, you can find the accumulated transition probabilities after n events.

Another simplification adopted is that the end of route 23 is not an absorbing coordinate, that is, if the character arrives at the end, it is possible for him to go back. This simplification is necessary for the transition matrix to be ergodic, and thus stabilize after a long period of time.

Multiplying the matrix by itself 64000 times (since there were many coordinates, it took a while for the probabilities to stabilize), I get to the matrix shown in Figure 6. This stabilized matrix shows that, after a long time, the probability of the character being in each coordinate does not depend on the starting point. This is true because of the ergodic property of the system. When stabilized, it is said that the system achieved stationary regime.

RESULTS OF THE DIFFERENT APPROACH

Another way of interpreting the stationary regime matrix is that, instead of the probability of the character being in each state, it represents the percentage of time the character will spend in each of the 305 coordinates. That way, it is possible to calculate how many iterations are necessary, on average (after achieving stationary regime), for the character to pass through a defined coordinate.

The probability of the character being in coordinate 29, thus, is 4.11*10-13, that is, a little more than 0.000000000041%. If we divide 1 by this probability, we see that, on average, we would need 2.43*1012 iterative steps to pass through coordinate 29.

Since each command (or step) is made every 1.5 seconds, this number of steps would take around 115.700 years to be made. This time should be at least doubled, if we considered the possibility of the commands that are not movement commands (the “A”, “B” and “Pause” commands).

Interestingly, the percentage of time spent in the lower part of the map (coordinates 230 to 305) is 96.36%, and the time spent in the initial part of the map (up to coordinate 92) is 99.42%.

CONCLUSION

What are the odds of the universe taking form as it did? What are the odds of you being conceived? These questions were made many times by many different scientists from different areas. Binazir (2011) shows through an interesting chart, which went viral on the internet, that the odds of you existing are the same as two million people throwing a trillion-sided dice and all of them getting the same result. As usual, the best answers are from Douglas Adams (1979), who shows that the whale and the bowl of petunias are not impossible as you initially thought, just as impossible as anything else.

The more specific the event, the more impossibly low are the odds of it happening.

This study only started as a joke, but the more I thought about it, more it made sense in this world of impossible improbabilities happening.

Grayson will clearly never finish this game, not before the heat death of the universe. He probably won’t even get close to the Safari Zone, from where he would never come out as well anyway. But maybe, only maybe, something impossible might happen, and the fish might be able to achieve his impossible dream of becoming a Pokémon master.

For more information on Markov chains, queue theory and lots of Operations Research concepts, read: Winston, W.L. (2003) Operations Research: Applications and Algorithms, 4th ed. Cengage Learning, Boston.

Adams, D. (1979) The Hitchhiker’s Guide to the Galaxy. Pan Books, London.

BBC News. (2003) No words to describe monkeys’ play. Available from: http://news.bbc.co.uk/2/hi/3013959.stm   (Date of access: 14/Aug/2014).

Binazir, A. (2011)  What are the chances of your coming into being? Available from: http://blogs.law.harvard.edu/abinazir/2011/06/15/what-are-chances-you-would-be-born/ (Date of access: 14/Aug/2014).

Bulbapedia. (2014) Tall Grass. Available from: http://bulbapedia.bulbagarden.net/wiki/Tall_grass (Date of access: 14/Aug/2014).

Math Explorer’s Club. (2009) Random walks. Available from: http://www.math.cornell.edu/~mec/Winter2009/Thompson/randomwalks.html (Date of access: 14/Aug/2014).

Munroe, R. (2014) What If?: Serious Scientific Answers to Absurd Hypothetical Questions. Houghton Mifflin Harcourt, Boston.

Twitch. (2014) Fish Plays Pokémon. Available from:  www.twitch.tv/fishplayspokemon (Date of access: 14/Aug/2014).