I was eleven when my cats had to be given away because my mother had discovered she was allergic to them. Of course, I was very sad about the departure of my cats, but not so much that I wouldn’t accept a Commodore 64 as a bribe to not protest too loudly. The Commodore 64 was already an obsolete computer in 1990; now, operational Commodore 64s are mostly owned by museums and hipsters.
I quickly became very engrossed in my Commodore 64, more than I had been in my cats, because the computer was more interactive and understandable. Or rather, there was the hint of a possibility to understand it. I played the various games that I had received with the computer on about a dozen cassette tapes—loading a game could take several minutes and frequently failed, testing the very limited patience of an eleven-year-old—and marveled at the depth of possibilities contained within those games. Although I had not yet learned how to program, I knew that the computer obeyed strict rules all the way and that there was really no magic to it, and I loved that. This also helped me see the limitations of these games. It was very easy to win some games by noticing that certain actions always evoked certain responses and certain things always happened in the same order. The fierce and enormous ant I battled at the end of the first level in Giana Sisters really had an extremely simple pattern of actions, limited by the hardware of the time. But that did not lessen my determination to get past it.
You could argue that the rich and complex world of these games existed as much in my imagination as in actual computer memory. I knew that the ant boss in Giana Sisters moved just two steps forward and one step backward regardless of what I did, or that the enemy spaceships in Defender simply moved in a straight line toward my position wherever I was on the screen. But I wanted there to be so much more. I wanted there to be secret, endless worlds to explore within these games, characters with lives of their own, a never-emptying treasure trove of secrets to discover. Above all, I wanted there to be things happening that I could not predict, but which still made sense for whoever inside the game made them happen.
In comparison, my cats were mostly unpredictable and gave every sign of living a life of their own that I knew very little about. But sometimes they were very predictable. Pull a string, and the cat would jump at it; open a can of cat food, and the cat would come running. After spending time among the rule-based inhabitants of computer games, I started wondering whether the cats’ behaviors could be explained the same way. Were their minds just sets of rules specifying computations? And if so, was the same thing true for humans?
Because I wanted to create games, I taught myself programming. I had bought a more capable computer with the proceeds from a summer job when I was thirteen and found a compiler for the now-antiquated programming language Turbo Pascal on that computer’s hard drive. I started by simply modifying other people’s code to see what happened until I knew enough to write my own games. I rapidly discovered that making good games was hard. Designing games was hard, and creating in-game agents that behaved in an even remotely intelligent manner was very hard.
After finishing high school I did not want to do anything mathematical (I was terrible at math and hated it).1 I wanted to understand the mind, so I started studying philosophy and psychology at Lund University. I gradually realized, however, that to really understand the mind, I needed to build one, so I drifted into computer science and studied artificial intelligence. For my PhD, I was, in a way, back to animals. I was interested in applying the kind of mechanisms we see in “simple” animals (the ones that literally don’t have that many brain cells) to controlling robots and also in using simulations of natural evolution to learn these mechanisms. The problem was that the experiments I wanted to do would require thousands or even tens of thousands of repetitions, which would take a lot of time. Also, real robots frequently break down and require service, so these experiments would need me to be on standby as a robot mechanic, something I was not interested in. Physical machines are boring and annoying; it’s the ideas behind them that are exciting.
Then it struck me: Why don’t I simply use games instead of robots? Games are cheaper and simpler to experiment with than robots, and the experiments can be run much faster. And there are so many challenges in playing games—challenges that must be worth caring about because humans care a lot about them. So while my friends worked with mobile robots that clumsily made their way around the lab and frequently needed their tires adjusted and batteries changed, I worked with racing games, StarCraft, and Super Mario Bros. I had a lot of fun. In the process, it became clear to me that not only could games be used to test and develop artificial intelligence (AI), but that AI could be used to make games better—AI for games as well as games for AI. For example, could we use AI methods to automatically design new game levels? Noting that there were ample possibilities for using modern AI methods to improve games, I started thinking about game design and how games could be designed with these modern methods, as well as human thinking in mind.
I had come full circle. I was once again thinking about intelligence and artificial intelligence through the lens of games, and about games through the lenses of intelligence and artificial intelligence, just like when I was eleven. It is fair to say that I have spent most of my life thinking about these interrelated topics in one way or another, and I’d like to think that I’ve learned a thing or two. I hope that I can intelligibly convey some of my enthusiasm as well as some of the substance of the research field I’m part of in this book.