The Mathematics of Fair Play in Video Games

Video games generate worldwide annual sales of about $150 billion. With millions of people confined at home with time to spare, the current pandemic may benefit the industry. At the core of a video game is a computer program capable of simulating a range of phenomena in the real world or in a fantasy universe, of generating realistic imagery and of responding to the actions and reactions of the players. At every level, mathematics is crucial [TM184 or search for “thatsmaths” at irishtimes.com].

League-Of-Legends

League of Legends, from Riot Games.

Riot Games is a video game company with over 2,000 staff members and European headquarters in Dublin. Their flagship product, League of Legends, is a multi-player online battle arena game with about 8 million concurrent users each day. Eoin Murphy, an Insights Analyst at the company, spoke to me about the mathematics behind video games.

Fair Play

Players want to win, but there must be a challenge. There is a sense of achievement only if their competitors are hard to beat. To ensure fair matchmaking between teams, sophisticated statistical techniques are used. Players are given an initial rating and this is adjusted following each game to reflect performance. The average rating of a team is too simple to measure overall strength: a strong player can more than compensate for a weak player, and gamers who play regularly together develop skills that can outwit gamers unfamiliar with each other.

One way to gauge the relative skill of players is to use a rating system originally developed for chess. This system was invented by Arpad Elo, a Hungarian-American physics professor and a master-level chess player. The system is now used much more widely for matching players in multi-player competition in video games as well as in football, baseball, table-tennis and various board games.

The Elo scheme has a sound statistical basis, ensuring that players with equal skill have comparable ratings. With computing power now inexpensive and widely available, various simplifying assumptions made by Elo are no longer necessary. Thus, algorithms have become more complex and sophisticated so that the pairing of players is very accurate and mis-matches are rare.

Physics Engines

Actions during a game must be faithfully represented or rendered on-screen. Suppose a vase is knocked off a table: its tumbling motion as it falls can be simulated using the laws of physics. Havok, an Irish software company now owned by Microsoft, provides a physics engine for use in video games. Its dynamical simulation makes for realistic virtual worlds and has been used in more than 150 leading game titles.

The realistic representation of three-dimensional images in varying conditions of light and shade involves heavy computation. Light ray tracing is a method for generating images by tracking the path of light from an object in an image to the viewer’s eye, including effects like reflection, refraction and scattering. The method yields a high degree of visual realism but at a heavy cost in computation. As computer power increases, this technique, whose origins go back to Albrecht Dürer, is becoming feasible for real-time applications in video games.

When three-dimensional objects are rotated, the viewer’s perception of them changes. There are several ways to model rotations mathematically, but the use of quaternions has distinct advantages and is now popular in rendering software. Quaternions are those hyper-complex numbers invented – in a flash of insight – by Irish mathematician William Rowan Hamilton in 1843. His goal was to model the physical world but he would probably have delighted in the use of his numbers to model the fantasy worlds of video games.

Acknowledgement: Thanks to Eoin Murphy of Riot Games for information.


Last 50 Posts

Categories