[AI researcher Luke Dicken looks at Portal 2 and examines how to best manage scaling difficulty to suit player skill, in this #altdevblogaday-reprinted opinion piece.
Difficulty is a subject that is on my mind quite a bit, mostly because it’s something I take a lot of abuse over. I tend to play games on "Easy" setting, except when it is made explicitly clear that this won’t be any challenge if you have played a game in the genre before, then I might turn it up as far as "Medium."
For some people, the choice of difficulty is seen as reflective of their skill as a player, so by picking easy, I am proclaiming my "noobsauce" to the world, as evidenced by the achievements I collect along the way. On the contrary though, I reckon I can hold my own well enough in most games, finishing at least mid-table in a lot of games I play online.
For me, difficulty is a reflection of how frustrated I’m prepared to feel during my entertainment. I find the world I live in pretty frustrating at the best of times, the cacophony of noise and nonsense in the media and politics drives me up the wall. People tell me that this is because I’m angry and bitter and single, but I really think that those guys are just another part of the problem!
In any case, I spend more than enough time swearing at computer screens that I don’t really want to add to it by playing games at a high difficulty setting and watching my character get spread across a level as a fine mist by enemies I didn’t even see, let alone get chance to attack.
Difficulty in Portal 2
This post started life as a short chat about Valve’s Portal 2
on Twitter, and whether any of the puzzles had multiple solutions, which got me thinking about the way in which you could implement a sliding scale difficulty in this kind of game. I started out by considering if it would be possible to have for example three solutions to a puzzle at the "Easy" difficulty, cut down to two for "Medium" and then just a single solution for "Hard."
It seems like it would add significant complexity to level design to allow these extra solutions to inhabit the same basic room shapes in a meaningful way, but it would probably be possible. The more that I thought about it though, the more I realized that this sort of approach (particularly in Portal
games) wouldn’t be appropriate. One of the true strengths of Portal
lies in that the tools you are presented with are exactly those that you will need to solve the puzzle.
If there is a switch, you will need to press it and if there is a goo tube, that will be needed for something too. If there were multiple paths to the destination, this wouldn’t be the case anymore and it would massively complicate the player’s search for a solution as extra equipment was played around with in non-constructive ways -- effectively it would introduce red herrings and likely cause even more frustration than having no difficulty option would.
Another approach might be to alter the timing mechanisms on countdowns and tweak the length of jumps, forcing harder difficulty settings to be more precise, and giving slightly more leeway to those choosing to play on "Easy," but would these changes make sufficient difference to the game to be meaningful? Most often, jumps and such are not derived from "twitch" reflexes, but from solving a component of the puzzle, so this probably isn’t appropriate either.
As an additional factor, consider that in co-op mode, both players would have to agree on a difficulty level if it affected the design of the level, and for a "twitch" style approach, often the person starting the timer isn’t the one who will be timed performing some task. All of this adds layers and layers of complexity to the problems the designers and developers face, so although it makes for an interesting thought experiment to see how it could be done, I think its fair to say that removing the option altogether and spending time on getting the pitch of the puzzle right was probably a really good choice by Valve.
Dynamic Difficulty -- Better, Stronger, Faster
In a similar vein, "dynamic difficulty" systems are somewhat interesting to me, both from an AI point of view and from a consumer point of view. A really good introduction to the basic concept of dynamic difficulty is Hagelback and Johansson’s "Measuring player experience on runtime dynamic difficulty scaling in an RTS game
" presented at the 2009 Symposium on Computational Intelligence in Games.
In this research, a simple RTS game was set up with two players, each with five bases and 50 tanks. One player was controlled by a human, the other by a simple AI, and difficulty was implemented by selecting a value between zero and one, and every tick through the execution each unit would generate a random number. If it was lower than this difficulty threshold, the unit could move otherwise it could not. In their study, Hagelback and Johansson used two bots with a fixed difficulty threshold representing a medium and easy opponent as a baseline.
They also created an adaptive system that varied the difficulty threshold dependent on the difference in relative strength between the human and AI opponent. Three bots were used in the study based on this, one that updated its threshold value frequently to better keep pace with the human, one that updated more slowly such that it lagged behind the human’s skill a little and finally a variant of this second, slower learning bot that during the endgame would drop its difficulty to incredibly easy, thus throwing the game. The two bots with static thresholds were seen to be relatively enjoyable but not sufficiently varied in terms of their strategy, the bot that deliberately lost was felt to be not enjoyable, not varied and not a strong player (despite in the early to mid game mirroring the player’s own skill).
The runaway success in terms of both enjoyment and varied strategies were the bots that used the dynamic difficulty algorithm without losing on purpose. It is however worth noting that the study wasn’t conducted as rigorously as it might be, as it was undertaken at the Dreamhack LAN party – which is not necessarily the best environment in which to perform science
I hope that this post has given you a brief insight into a different way that players might perceive difficulty, and steps you could take to factor them in. I also hope you found something useful in my rambling analysis of difficulty in Portal 2
, if only that variable difficulty can be much more subtle than slapping more health and DPS on enemies (and sometimes, it can’t).
Finally, I think that the user study suggests dynamic difficulty is something we should be taking a much closer look at, but potentially a player’s own skill is only one part of what the traditional difficulty settings capture -- I wonder if a better approach would be to allow them to chose how hard they want to work, and then adapt to an offset of their perceived skill.
[This piece was reprinted from #AltDevBlogADay, a shared blog initiative started by @mike_acton devoted to giving game developers of all disciplines a place to motivate each other to write regularly about their personal game development passions.