It's not just the next generation of consoles on the horizon. Researchers are also working on making quantum computing a possibility, opening all sorts of doors not possible with today's silicon. But what does that mean for video games?
To understand the practical implications of quantum computing for video games better, and the current state of video game development for quantum games, I spoke to Dr James Wootton, a quantum computing researcher at IBM. Wootton has the honour of being the first person to ever make a game on a real quantum computer, and so far has wrangled with quantum circuits to recreate basic games like Battleship and Qiskit Blocks, a Minecraft-esque voxel game designed to teach kids the basics of quantum computing.
I spoke to Wootton about the parallels between quantum computing development now and where it's at, what publishers have begun dabbling in the space, and what practical applications quantum computers might have in modern video games. Below is the transcript of that interview.
Kotaku Australia: What are the basic differences between a game coded to run on a quantum computer, versus something coded to run on x64/ARM architecture today?
James Wootton, IBM: A very simple description of what our conventional digital computers do is that they take some information (encoded in binary), process it, and then spit out some other information as an output (also binary). This basic model is also true of quantum computers.
The difference is in how the processing is done, and the hardware used to do it. For conventional computers, everything compiles down to a set of very simple operations: copying bits, flipping bits (from 0 to 1 and vice versa) and comparing the values of pairs of bits. Every program turns into a huge number of these basic operations, which are known as gates. The size of the computer you need, and how long the program takes to run, are determined by how many of these gates need to be applied to turn your input into your output.
Quantum computers use a different set of basic operations. These include relatively direct analogues of the gates of conventional digital computers - so you could run conventional programs unchanged on quantum devices. But quantum computers also allow gates with a bit more finesse. For example, bits in conventional computers are either 0 or 1. The quantum bits, or qubits, in quantum computers are the same except that they act in a way described by quantum mechanics. This means that, though 0 and 1 are the only states they can have, they don’t always need to be entirely certain of which state they are in.
This allows us to do things that would be impossible on conventional computers, and find new paths that can be taken from input to the output. In some cases we know that much shorter paths can be taken, allowing us to solve problems that are effectively intractable for conventional computers.
Now I’ll move more towards an answer of the thing you actually asked. When someone programs for a conventional computer today, one does not usually think about how their program will compile down to gates. Programmers add numbers together like it’s the easiest thing in the world, without needing to worry about how the device actually implements this on the long strings of bits used to represent the numbers.
For quantum computers, however, an understanding of how things work at the gate level is much more important. When making quantum games, it is typical to focus on just one or a few quantum gates and think about how to make them into a game mechanic. In the Battleships games I made, for example, I used gates that flip a qubit from 0 to 1. For conventional computers, this is done by the NOT gate, which simply performs the flip. For quantum computers it is also possible to do partial flips: instead of going all the way from 0 to 1, they stop at one of the uncertain states in between. Then, if another such gate is applied, it takes them a little further. Once the right number of them are done, quantum interference effects kick in to bring the qubit back to a state of certainty, and the flip is complete.
With these gates I implemented a simple game mechanic: the qubit states 0 and 1 corresponded to a ship being intact or destroyed, and the partial flips implemented attacks. The number of attacks needed to destroy the ship depended on exactly how much of the flip was done by the gates I chose. This was a very simple example. And, like the early computer games of the ‘50s, it was more about showing people a tangible example of quantum programming than providing a game that people would want to play.
Other games, by myself and others, have followed a similar pattern: some gates are decided upon, an educational goal is chosen, and then the quantum part of the game is written explicitly in terms of quantum gates. The educational goal might be to give an example of programming, or to give people an intuition about quantum directly in the game, or to showcase the hardware in some way. Exactly the same as the ‘50s games on conventional computers.
How far away would it be before an engine like Unreal or Unity would be functional on quantum computing, or even lower level language codes like C or something like assembly/machine code that more closely replicates the codes people use today? Or is it more a case of learning what the equivalent languages are for quantum computing?
Wootton: We have Qiskit, a Python-based framework for quantum computing. So the way to use quantum computers is simply to use Python. You can use IBM tools to create quantum programs using Python scripts, and send the job to a real quantum computer over the cloud and process the results all using Python. Our tools allow people to do this at the level of the basic quantum gates, but we also have come pre-made components of standard quantum algorithms. This allows people to play around with quantum computing at whatever level of abstraction they are comfortable with, and do it using a familiar programming language.
Have any major publishers or developers started playing around, or asked for your assistance or advice, with quantum computing?
Wootton: Finland seems to be the main place embracing quantum computing in games. IBM co-organised a game jam there last year: the first one in which jammers could use real quantum computers. The university of Aalto is also planning a course that will have a combination of game design and quantum computing. IBM are also working with a game studio on including quantum effects in their game. You can expect more news on this in the coming months.
What do you think the first commercial quantum computing games would look like? What are some of the possibilities on quantum computing compared to a traditional game - what are some of the bottlenecks with games today, for example, that wouldn't pose a problem for quantum computing?
Wootton: In the history of computer games, it was 1962’s Spacewar! that offered the first unique play experience. The games of the ‘50s mostly offered Tic-Tac-Toe on a room-sized computer, so it clearly would have been easier to use pen and paper. But Spacewar! Allowed the player to control a space ship, without the need to build a space ship.
I don’t think that there will be such a huge jump in quantum-enabled games, because of how great people have become at making games. However, the fact that games require things to be done so fast means that shortcuts sometimes need to be found around potential bottlenecks. Once game designers have the ability to draw on quantum resources, they’ll have more possibilities for creating the best game experience.
The most concrete example of this, I think will be in procedural generation. This is the algorithmic generation of content, sometimes used in puzzles games to make new puzzles, in games like Civilization and Minecraft to generate terrain and also used in ‘Rogue-like’ games to generate new dungeons whenever you restart. In recent years, some quite prominent games have used this technique: No Man’s Sky, Cadence of Hyrule (a Zelda game) and the upcoming Pokémon Mystery Dungeon and Watch Dogs Legion.
There can be quite difficult computational problems involved in procedural generation, since the idea is to keep examples that are as different from each other as possible, while satisfying a set of constraints (such as that a puzzle should be solvable, and a level should be completable). It might also be necessary to find out the best possible solution to a procedurally generated task, in order to give the player feedback on what they have done. So complex optimisation problems can also be involved.
There are already some really great techniques for procedural generation, but most of the effort is always in hiding the underlying method. If the player sees that the same kind of content keeps emerging again and again, it no longer feels as fresh and engaging. Since fault-tolerant quantum computers will offer advantages in relevant problems like constraint satisfaction, optimisation, they should provide powerful new tools for new procedural methods.
The era of fault-tolerance is still some time away, though. I’m more interested in seeing what can be done now and in the near-future. During this time, the quantum devices will have constraints that prevent us from running the standard algorithms from textbooks. We instead need to design algorithms with these specific constraints in mind, to ensure that we can get an advantage over conventional computing. My first experiments were to simply use quantum devices as a way of producing quantum interference effects: something that is very easy for them but much harder for conventional computers. I then looked at how this can be used in procedural terrain generation, to create more interesting textures than those produced by standard techniques (such as the Oscar wing ‘Perlin Noise’ algorithm). The pixel art teleportation animations I mentioned earlier are based on the same basic idea.
Here's some examples of quantum interference effects and a quantum perturbation of Super Mario Bros. 1-1 level:
This is the final version. It incorporates the procedural generation methods I have designed for single qubits, few qubits and many qubits. The quantum interference patterns on the walls and bridge are seeded by the pseudo-runes of Ædwen's brooch. pic.twitter.com/0Kr4ui9wOw
— James Wootton (@decodoku) November 7, 2019
— James Wootton (@decodoku) December 30, 2019
Procedural generation is often classified as an AI problem, and I now hope to look more in this direction. Using game playing AIs to showcase new technology is something IBM has a long history of (a Checkers AI in the 50s, then Deep Blue for Chess and Watson for Jeopardy). It would be nice to add a quantum AI to this list.
You've mentioned that you're taking part in the Global Game Jam. How challenging is it to build the other elements of a game into a quantum computer - UI, artstyle, music, things developers take for granted today?
Because quantum computing will always be done in combination with conventional ones, we can still take these things for granted. Nevertheless, it is interesting to see how far we can push quantum into these areas. I’ve been looking into how to encode images and music in quantum states, so that the quantum computer can be used to process them.
One example is creating animations of a teleportation effect, based on a real quantum teleportation-like process. In these cases, we have to be careful to choose an encoding that is compatible with current hardware. That keeps us firmly in the pixel-art style.
I think the limited palette version, which will actually go on the PewPew, works even better. pic.twitter.com/99mFZpz7CO
— James Wootton (@decodoku) November 18, 2019
You can follow Wootton and more developments on quantum computing and games built with quantum computers through their Twitter.