Have you ever heard the word “MMORPG“? Probably yes, but you don’t know its meaning, isn’t it? Well, then I’m going to tell you, it means Massive Multiplayer Online Role Play Games. They are that kind of videogames where each user controls a digital avatar and interacts with other online users in a digital world. You probably have already heard of many of them such as Final Fantasy XIV, The Elder Scrolls Online, DC Universe Online, and World of Warcraft.
The player’s main task is one of growing his own avatar by raising his level, enhancing his skills, improving his equipment, completing quests, and so on. On the other side, also the social part of the game plays a fundamental role. Often, players are given the chance to form teams or alliances, talk, discuss, exchange items, cooperating to complete some quests, or even competing in some kind of arenas (PvP maps) in both one vs one and team vs team matches.
IA applied to MMORPGs
But there is something you must know, MMORPGs not only entertain gamers but recently, they also began attracting machine learning developers. It is well known that where there is the data there are also computer scientists and, online games, with their huge amount of users, are the perfect playground for data scientists to test and develop their new machine learning models. Some common applications of AI applied to the game industry range from predicting players’ unsubscription, behavior, actions and location. Instead, some crazy applications of AI applied in the context of online games consist of machine learning models able to independently learn how to play the game until being able to compete and even beat humans on it!
World of warcraft dataset
In this post, we are going to explore the behavior prediction task by analyzing the data of the game World of Warcraft which has been one of the most popular MMORPG with over 8.3 million active players since its release in 2004 by Blizzard. The game is divided into two factions, the Horde and the Alliance. Each faction is divided into 5 races and 10 general classes, plus 229 zones or regions. However, the data collected for this study comprise only Horde players.
The task of behavior prediction is useful to help the game developers or designers to create experiences with appeals speciﬁcally devoted to each behavior. The dataset (wowah dataset) includes the records of 37,354 avatars sampled every 10 minutes during the year 2008. The data includes the avatars’ game playtime and a number of attributes, such as their race, class, guild, current level, and in-game visited locations. During the monitored period, 10,826,734 sessions associated with the avatars were observed. Moreover, to protect players’ privacy, the avatars’ name and guild have been randomly mapped as positive integers with a consistent mapping (the same names were always mapped to the same integers).
We are going to handle this problem in a friendly way by calling our inseparable friends: Alice and Bob. Since they are feeling a little lonely, other two friends are going to join them: Carol and Dave. Before we start, let’s briefly introduce our team members.
The four nerds
Bob is a young university student and, like many other students of his age, he enjoys spending his thoughtless nights between pubs and bars, drinking all kinds of cocktails such as Mojito and Daiquiri. He likes socializing, meeting new friends, and have a lot of fun with them.
Alice is both a beautiful and mysterious girl. She often considers herself as being superior to normal people, competition is part of her daily routine and never retreats when facing new challenges, on the contrary, she always seeks for them.
Carol is someone who enjoys all the aspects of life, she likes spending her time traveling, exploring the world, and getting in touch with different cultures. Curiosity is more important than success in her life.
Dave likes perfection even though he is aware that it doesn’t exist. What counts in life is an achievement and he is disposed to give everything out in order to realize its goals. Time is very precious for him since its dream is very ambitious.
It is important to say that our four protagonists don’t know each other (maybe). They live in different cities, attend different schools, and study different subjects. Anyway, there is a common passion that is shared among them and many other students as well: gaming. They are so addicted to the game of World of Warcraft that they can’t even spend a single day of their life without playing it. When they are playing, they are so immersed in the virtual world that even their avatar resembles their real personality.
Different behaviors in MMORPGs
In MMORPGs are globally recognized 4 different types of behaviors. In our case, each character has been modeled to belong to one of each different behaviors.
Bob is a socializer, he prefers to play online just for social pleasure, to interact with other players, and to naturally evolve its character. He often crowds the game chat by talking about his personal life and use many emoticons. Finding a lot of friends is more important than complete hordes of missions for him, hence, he spends most of his time in neutral maps like the various cities located around the map and rarely deeps into the wildlands.
Alice is a killer, she prefers to develop her character, but not with the intention of obtaining merits. In contrast, she is interested in competing against other players or against NPC enemies that are more powerful and complex. She almost never talks and when she does she only writes a bunch of specific words. Her natural habitat is the PvP arenas and loves using her powerful avatar to smash whoever has the misfortune of walking on her way.
Carol is an explorer, she prefers to know the whole game environment, to discover secret areas, to ﬁnd out 3D modeling errors or programming errors, easter eggs, and knows all the possible items, such as monsters and maps. She is not eager of evolving her avatar as fast as possible but she is willing to just acquiring experience by exploring the world following the natural process of her character’s evolution. She is the one who spends most of her time playing this game.
Dave is an achiever, he prefers to earn points, to evolve its character, to acquire equipment and other concrete measures of success in the game. Every action he performs is focused to improve his character’s skills and for no reason, in the world, he would spend his time in tasks that may not make his avatar more powerful. He aims to become the strongest player ever.
Following, we are going to describe a method to analyze the World of Warcraft dataset and predict the behavior of each player classifying it into one of the four above mentioned classes: killer, socializer, achiever, and explorer. This method can also be extended to other games, not necessarily MMORPG ones, simply by processing the data in the appropriate way.
Important: the code can be found on the following repository: https://github.com/davide97l/WoW-dataset-analysis
Before processing the data, are required some pre-processing steps in order to prepare it and fitting it for our goals. First of all, our new dataset will have only one entry for each different player. This reduces the size of the new dataset down to 37,354 rows. Furthermore, the players whose total playing time was less than 2 hours have been filtered since they would probably consist of new players who just tried the game for a couple of hours before realizing the game itself wasn’t suitable for them and then they quit from it. This process further reduced the numbers of total rows down to 15,740.
Of the original dataset, have been kept only the attributes
char in wowah dataset),
charclass in wowah dataset),
guild. Other attributes have been removed or combined to form new useful ones. In particular, the
level attribute has been replaced with
lvl_end which represents the initial and final level of the player respectively in the considered time frame. These two attributes have then been used to calculate the
evolution, that is the number of levels a character grew during the analyzed window of time, and the
lvl_speed which is gives an idea of the speed of the increase of a player’s level. The different timestamps have been used to calculate the player’s playing time in hours,
time_hours, and have been also counted the number of guilds a player joined (
n_guilds) and the number of visited maps (
n_maps). Moreover, have also been added a few attributes about players’ location such as
n_pvp which is the number of hours spent in the zone of type city (neutral) and PvP such as arenas. Lastly, have been added the numbers four more features relative to the of hours spent in different areas divided by difficulty (
map_advanced) based on the recommended required level to enter in a specific zone.
The next step consists of automatically labeling some players’ behaviors based on some fixed conditions:
For example, we label the behavior of a player as killer if the associated avatar has a level higher than 60, has spent at least 40 hours in a PVP competitive maps and didn’t visit many maps but just focused on a few of them (
n_maps<50). This is reasonable since that kind of players own high-level avatars and play the game with the purpose of competing with other players. On the other hand, socializers are not too much interested in evolving their avatar too much (
lvl_speed<1) but they are rather focused on making new friends and interact with other avatars. They are usually low-level players (
lvl_end<15) and spend most of their time in maps where they can avoid dangers and where they easily find new players (
Tuning the above parameters, thus fixing the right criteria to decide the player’s behavior, is the most crucial part of this project, in fact, setting different conditions can lead to different outcomes in the next phase. Given the nature of the problem, it can be very hard to test the correctness of the obtained results, thus, there is no evidence that our conditions are the perfect ones but they have been fixed experimentally.
This process should also label a small fraction of the dataset’s entries. In fact, we are going to use this automatically labeled entries to predict the behaviors of the other players.
In this phase, we are first going to train a random forest classifier on the portion of data with the labeled behaviors. Next, we are going to use this model to predict and fill the missing values. It is important to say that we don’t have a test set to check the accuracy of the result but most of the results depend on the previously annotated labels. In future work, we may replace the random forest with a semi-supervised algorithm such as a semi-supervised version of K-neighbors to spread the annotated labels across the whole dataset.
In the above pie chart, we note that the socializer is the most frequent behavior in World of Warcraft (at least during the year 2008) accounting for half of the total players. Killers are usually high level and expert players, hence, they are the less frequent behavior since it is not easy finding many of them in the game. Finally, achievers and explorers almost equally divide the behavior of the remaining players accounting for about 40%. An interesting observation is that many players end up changing behavior when they reach certain characteristics. An achiever, for example, can become a killer or an explorer when it reaches the highest levels or the quests become scarce. Therefore, one possibility is that some explorers and killers can be classes as arising from achievers.
We can observe from this chart that the explorers and the killers are the players visiting more maps while the achievers traveling on a fewer number of zones since they are more focused on playing on that maps which can guarantee a faster growth of their avatar. Despite both visiting many maps, killers and explorer won’t meet very often. In fact, the first spend more time competing with other players in PvP zones while the latter focuses mainly on exploring world map areas. Conversely, the socializers can’t afford to visit high-level maps. Firstly, they are not enough skilled to face strong hostile NPCs. Secondly, both killers and achievers won’t show a friendly attitude toward them. Thus, socializers prefer staying in beginner or neutral maps such as cities where they can meet other socializers and make new friends while avoiding the wild and PvP maps.
As expected, killers are amassed around the 70-80 level ranged and only a few lower level players play the game showing this kind of behavior. Socializers, although they are gathered around low levels, there are still some higher level players assuming this kind of behavior. Instead, Achievers spreads along with a wide range of levels where explorers are more concentrated toward higher levels than achievers but lower than killers. We can observe that a natural way of behavior-changing is that a new player, once creates a new avatar and starts playing, at the beginning may act like a socializer in order to get familiar with the game mechanisms and design. Later, he discovers he really likes this game so he turns into an achiever in order to enhance his character, complete as many quests and possible, and rush toward the end-game. Finally, he can decide whether to become a killer or an explorer based on his own intentions and personality. Of course, it is also possible that a player never changes his behavior or changes it by following a different way.
From the above chart, we can observe that the explorers tend to have a medium to slow progress, but we have already seen that their level is above the average, therefore, they may walk freely in the world without being killed by monsters considered aggressive. The achievers, in turn, have rapid development, as they try to develop their character doing quests and using the appropriate maps for training. Their speed of evolution is given by a large amount of experience won through quests in the game and also the efficient management of resources by the player, and the correct use of the world (to know where to play to evolve faster) to obtain quick experience. The socializers usually have subdued to a certain level and when they reach a comfortable level, where they can use all the items considered fashions offered by the game. As the socializers, killers and explorers are not interested in growing their level since they already have high-level avatars.
In this last chart, we can note how the PvP maps are dominated by the killers with most of them spending more than 100 hours in a year playing on them with only a few players belonging to the other three classes daring face them.
Which kind of player are you? Will you behave like Bob, Alice, Carol or Dave? You can find the code to reproduce this experiment in the Github repository linked in the next section.