Machine Learning Dynamic Difficulty Adjustment for Hyper Casual Games

Premise

Including a wider spectrum of proficiency levels in the optimal flow state of hyper-casual games

Synopsis

Hyper casual games have flooded the mobile game market in the past years. Their relatively low entry skill level and short gameplay loop make them very accessible – as one might think – to anyone. In reality, both their simplicity and low difficulty are by design not optimal for the right flow state of every player. A data-driven solution might be in place. 

The topic

Because of the oversaturation of the market by hyper-casual games, new solutions have been created by the developers. The games created by them are usually copies of pre-existing ideas, reskinned to fit the liking of new players. Those games usually are made very easy as the lifespan of such games is relatively low due to low d7 retention in the hyper-casual games segment. One of the reasons can be a non-satisfying flow state that a given player has achieved. Recent statistics have revealed that the majority of gamers between 18-25 would consider themselves expert gamers (Limelight Networks, 2019). What is more, a difference in average playtime between novice players and casuals/advanced gamers is quite significant, as the first group plays around half of all the gamers population. That means that novices are probably far below the proficiency of other players. 

What is more, casual gamers are the biggest part of the gamers population, and novice gamers are second. Another survey conducted in the United Kingdom shows that the amount of digitally excluded people is getting lower, and the number of new technology users is growing each year (StackPath, 2020). That shows that there is still some target exploration potential for the hyper-casual games market. 

Research Insights 

To gain a better overlook of the situation I have investigated the statistics of digital exclusion and the numbers regarding the mobile games market. I have also read a lot of papers about setting a difficulty in games and reached out to people who work in the industry making hyper-casual games. 

In summary, it appears that automatic adjustments regarding the player in mobile games – if any – are mostly connected with monetization aspects. That infrastructure however might be useful for Dynamic Difficulty Adjustment (DDA), as most of those operations are conducted through cloud computing. I have also found out that DDA is not a very popular way of balancing games. And even if it’s performed it’s usually hard-coded and therefore will not be optimally adaptive to a given player’s learning curve.

Approach 

I decided on using Unity Engine, because of its popularity, meaning a bigger chance of finding solutions for problems that I would eventually encounter, and my relative experience with it. My plan was to create a hyper-casual game based on a flash game called Gold Minder. I planned to approach a number of people with various experiences in gaming and asked them to play the game 10 times. After each attempt, the number of approaches, their score, and their boredom/frustration state according to a given scale would be written down. 

The process 

I decided on designing a Difficulty System that would use Machine Learning and would be implemented in a 2d mobile game that I would make in Unity. 

The game I picked for this one is Gold Miner. The game has a very clear set of rules and elements that can be easily adjusted to manipulate the game’s difficulty. The huge advantage of this game is that it is also quite modifiable, allowing for adding additional elements to the gameplay.  The default game design of the game is as follows: The player has half a minute to collect or the gold on the map (yellow circles) while avoiding rocks (brown circles). Each gold regardless of size gives the player +10 points, and rocks, apart from slowing down the player, subtract the same amount.  The mining tool tilts itself left and right, and the player has to press the left mouse button at the right moment to make the tool reach out into the ground. The difficulty could be changed through the speed of the tool going left and right, the size and the number of gold and rocks, and/or through manipulating the time that the player has to accomplish the task. 

I started the game development by taking apart the most important elements of the game to know what I should prepare. With that, I started with creating some simple 2d placeholder assets in Figma. Afterward, I exported them into the game and started to organize my scene. At the same time, I started writing scripts in C# which I totally forgot after years of not using, but I finally got something working.

After a while of working on the project, I resigned from developing the game for mobile devices and focus on making it hyper-casual mostly in terms of gameplay and complexity. I decided upon that because of additional possible problems with working cross-platform and the vision of working with developer consoles, which are not really the core feature of the whole project. Additionally, having it just on a PC allows for easier creation of framework connected to Machine Learning.

 

Finally, I was able to ask people to play my game and gather some initial data. Each player had to determine the approximate amount of hours they spend on gaming each week and describe themselves with one of the following: novice, casual or advanced gamer.  Later after each playthrough, their score was written down, along with their description of frustration and boredom. The scale from 1 to 10 for that was developed according to Czikszentmihalyi’s Flow State (1990). 1 means that the player was bored as the game was too easy, 5 would mean an optimal flow state, and 10 would mean that the player is frustrated because the game is too hard. Additionally, if the player gathered all the points before the time ran out, also that was written down.

A total of 5 players took part in the initial approach. Despite it’s not quite enough for creating a solid data frame, I decided to go with that and create at least a framework with Machine Learning and see how it works. The assumption I made was to use classifiers to determine whether the difficulty is right, it’s too hard, or too easy. That’s why I created an additional column called  ‘adjustment’.

I tried out Logistic Regression, Random Forest Classifier, KNeighbors Classifier, Neural Classifier, and a Voting Classifier that is a combination of all of them.  As of yet, the results are obviously not anything yet to consider as final,

With each other player, I was noticing some specific behaviors regarding scoring their flow state. Advanced players who achieved the max amount of points were describing their flow state as 5, however later on even though they were failing to repeat what they have done they would say they were more bored than before. Additionally, of course, each player has their own way of approaching the scale, and some of them were staying closer to 5, while others could advance from 3 to 8 after a single attempt. That is why I think that using the scale to create 3 actions that should be undertaken is the best solution for this scenario.

Conclusion and Further Steps

As the group that was tested was very versatile in terms of the experience with gaming, the results given by classifiers are not showing how valid would be that approach. However, with such a framework, it is possible to focus on a given group and conduct a series of playthroughs that would allow for further data gathering. Afterward, either the classifier could be connected to the game itself, or the trained model could generate a config CSV file with every possible combination of scores to determine what kind of adjustment should be introduced to a player with a given score history. That’s how the game, looking just at the score of the player and the number of attempts, would be able to assume how to adjust the difficulty so the player could achieve the optimal flow state.

References

Bravo, I. (2020, November 5). Hyper-Casual Gaming: The Latest Stats and Trends You Need to Know. GameAnalytics. https://gameanalytics.com/blog/hyper-casual-gaming-stats/

Mihaly Csikszentmihályi  (1990). Flow: The Psychology of Optimal Experience. Harper & Row. 

Limelight Networks. (2019, March 15). The State of Online Gaming – 2019. Limelight Networks Inc. https://www.limelight.com/resources/white-paper/state-of-online-gaming-2019/

StackPath. (2020, March 8). Choose. https://www.choose.co.uk/guide/what-causes-digital-exclusion.html

Leave a Reply

Your email address will not be published. Required fields are marked *