A Next Level Playing Field - AI in Gaming

AI in Gaming by Lumenci

Gaming grew from a tiny industry that only mattered to a relatively small number of people to being played by an estimated 3.24 billion people yearly. Gaming can fill a need for competition and escape reality and is a significant source of socializing for many people. Different genres like Role Playing, Puzzlers, Shooters, Strategy, and Sports attract players from all over the planet and from almost all walks of life. Whatever the motivation behind playing all kinds of games, all of them are being impacted by the growth of Artificial Intelligence in the industry.

What is Artificial Intelligence?

As the name suggests, the ‘intelligence’ possessed by machines is called Artificial Intelligence. A field of study that aims to impart human-like knowledge and decision-making capabilities to computers. This term was coined in 1956 and has slowly become a wide-ranging discipline with far-reaching capabilities that are still being explored today.

History and Evolution of AI in Gaming

Although the term ‘AI’ came into existence a little later, the first known coexistence of AI and gaming was observed in 1951 as the custom-built Nimrod computer in an exhibition in Britain. Nim is a two-player game in which players are supposed to remove objects from a collection while ensuring that they do not pick the last object as it would result in a loss. The players were impressed with the computational capabilities of the machine.

Slowly programmers started realizing that AI and its sub-branches, such as Machine learning, can be utilized to fabricate more complex games. Arthur Samuel from IBM did precisely this. He came up with some key concepts of Machine Learning used in gaming while trying to create a Checkers game. They were Alpha-Beta pruning (searching optimization) and self-play with rote learning. Although the checkers game Arthur created was fundamental, the key concepts he utilized are still in practice today. IBM’s Deep Blue also showcased these concepts in 1996, the computer that emerged victorious against a World Champion chess player, Garry Kasparov.

In the 1970s, video games that included AI started showing up in arcades. Games like Karate Champ, Space Invaders, and new Role-Playing Games came out during the “Golden age of arcade video games.” Who can forget the countless hours spent on Pac-Man? The increasing difficulty and a more competitive CPU gave countless hours of fun to gamers, all thanks to the underlying Artificial Intelligence.

Much progress has been made since those days. From open-world games with almost realistic NPCs (Non-Playable Characters) to sports games that make us believe that we are participating. Below is a look at the technologies that brought about this change.

Timeline of evolution of Digital Twin (Source: Lumenci)

Underlying Technologies

Designing an incredible protagonist and a cool super-villain when creating a video game might not be enough to keep gamers hooked. Some of the most important aspects of video games are the Non-Playable Characters (NPCs). In most open-world games where players spend hours free-roaming and exploring the map, their interactions with NPCs are one of the critical aspects showcasing the finer details considered by the developers. Apart from the NPCs, the graphics must also feel hyper-realistic. When someone picks a sports-based video game, one of the most important factors of consideration is the graphics. The look of a favorite player, their movement on the field, and the attention to detail for beloved stadiums are some of the many factors that govern the success of a game—enters AI.

Some of the popular AI algorithms used in gaming are –  

  • Finite State Machine (FSM) Algorithm

 
Finite State Machine (FSM) Algorithm

Finite State Machine (FSM) Algorithm (Source: Lumenci)

 

This model of game development was introduced in the 1990s. Using this algorithm, the developers try and pre-program all the possible generic situations that the AI of the game may encounter based on the state the game is currently in. This enables the AI to react to any human interaction during a game. Although fan-favorite franchises such as Call of Duty or Assassins Creed utilize FSM models successfully, there is a major issue with this model, which is its high predictability.

  • Monte Carlo Search Tree (MCST) Algorithm

 
Monte Carlo Search Tree (MCST) Algorithm

Monte Carlo Search Tree (MCST) Algorithm (Source: Lumenci)

 

This enhanced algorithm is the one that powered IBM’s Deep Blue in its historic defeat of Gary Kasparov. While creating strategy-based games such as chess, AI can’t predict all the possible outcomes. In such a scenario, the algorithm takes a specific state of the game and then uses it to narrow the possible outcomes to a more manageable set.  Each turn causes a recalculation of the possible outcomes as the game progresses, and the next move is carefully chosen. This increases the unpredictability of the game and improves the overall experience.

  • Reinforcement Learning

Reinforcement learning is another innovative approach to enhance the decision-making ability of an AI agent in gaming. It is a reward-based learning technique. Imagine you're trying to automate a game such as Pac-Man; it becomes essential that your character moves in a way that maximizes the consumption of pills, fruits, and edible ghosts while ensuring that you stay clear of the ghosts. This algorithm rewards the agent whenever a correct decision is made (consumption of a pill) and ignores the agent when a wrong decision is made (encountering an obstacle or a ghost). After repeated iterations, the agent becomes more intelligent and adapts to more challenging environments.

  • Generative Adversarial Network (GAN)

Apart from the NPCs and gaming environment, AI also finds a way to enhance the graphics of video games. Generative Adversarial Networks form a class of Machine Learning frameworks wherein a couple of neural networks compete with one another in the form of a zero-sum game (when one of them loses, the other one gains). This technique is utilized to fabricate remastered versions of classic video games. Developers [CH(1] upscale low-resolution 2D textures and recreate them in higher resolutions with the help of image training. Resident Evil, Max Payne and Final Fantasy are some popular franchises that utilize GANs for this purpose. In this, the first network is called a generator. It creates upscaled versions of graphics which are then tested by the second network, the discriminator. The discriminator determines if they are the same image by measuring the fidelity of the new image against the lower-resolution version.  When the discriminator is not convinced, the generator learns that it failed and uses it to alter its generation. If the discriminator is convinced, it learns that it failed to find image noise or artifacts and can alter its algorithm.

 A Few Examples

Let’s look at some popular games that have gained much attention due to their usage of Artificial Intelligence.

  •  Red Dead Redemption 2

 

Glimpse of Red Dead Redemption 2 (Source)

 

If it is an open-world game developed by Rockstar Games, one thing guaranteed is a truly intelligent environment. The graphics, storyline, and character development are all impressive, but the NPCs catch the eye. They’re not just there to talk about the missions or to get vaporized during massive explosions. Each seems to follow its storyline and their behavior depends on how the player might have interacted with them in the past.  Even the wildlife seems incredibly natural. Such a dynamic AI system provides an engaging gaming experience.

  • F.E.A.R.

First Encounter Assault Recon (F.E.A.R.) (Source)

First Encounter Assault Recon[CH(1]  (F.E.A.R.) is a first-person shooter survival horror game released in 2005.  It became a popular video game thanks to its AI. F.E.A.R. became the ( first game to use a Goal Oriented Action Planning technique to create dynamic NPCs. This technique allows the underlying AI agents to make sophisticated decisions without requiring a complex FSM. The primary target for the agents is to perform some actions to complete a set goal. The actions are not hard-coded, so there is a chance for two different agents to have the same goals, and they may perform different actions to achieve the target. This increases the unpredictability of the NPCs and provides amazing gameplay.

  • FIFA

FIFA (Source)

Finding a soccer fan who has never played this game is hard. As much as they criticize the bugs and glitches, the pay-to-win nature of its most popular mode (Ultimate team), and the weird-looking animations, they'll never shy away from a session filled with lots of goals and trash talk. Since FIFA has been out there for almost two decades now, its developers know how to keep fans hooked. With the release of their latest game, FIFA 22, Electronic Arts brought a technology called HyperMotion. This involves advanced 11v11 match capture with players from each side donning Xsens suits while playing to enable the motion capture of every player throughout the match. Pair that with proprietary Machine Learning algorithms and a tactical AI, and you'll have the best soccer simulator.

  • Cyberpunk 2077

Cyberpunk 2077 (Source)

An open-world game with beautiful graphics and a fan-favorite actor seems like a match made in heaven. Sadly, this was not the case with this game. The hype Cyberpunk 2077 created was unreal, and the fact that Keanu Reeves was a part of it piqued the attention of gamers from everywhere around the globe. But when it was officially released, fans were anything but satisfied. The poor performance on previous-generation gaming platforms was highly unexpected. Even the movements and reactions of the NPCs were unrealistic, raising many questions about the underlying AI of the video game.

Testing Video Games

Development is one of many areas in which AI is used to improve gaming. Companies need to ensure that the enormous, artificial world they have created is free of bugs and glitches; this is where video game testing comes in.

The two most common methods of handling testing are human game testers and scripted bots. Both methods have some pros and cons. Human testing seems like the most straightforward approach: let someone play the game and record the issues found. If all video games were as simple as Tic-tac-toe, there would be no need for another approach. As the environments of video games become extensive and more complex, it becomes difficult to interact with every minute detail of the game. It might sound like a dream job to some, but playing video games daily to find the errors can be tiring and boring. To solve this issue, scripted bots can be deployed to handle repetitive tasks. Unfortunately, bot interaction with the virtual environment will not be as complex as when a human tests the game. Scripted bots solved one problem but created a new one.

Reinforcement learning improves game testing (Source: Lumenci)

Researchers at EA have developed a novel approach to combining complex human intelligence and the perseverance of scripted bots with the help of Adversarial Reinforcement Learning. Like GANs, this method involves a pair of agents named the Generator and the Solver. The Generator utilizes Procedural Content Generation to generate game data algorithmically.  This can create puzzles, levels, and other game elements that the Solver will solve. The Generator must create levels that are possible to finish so that the Solver can eventually pass them. Both are rewarded when they complete the designated task. The researchers introduced an auxiliary input that rewards the Generator for complex content, increasing its accuracy for more difficult levels.

The Patent Landscape

With technological advancements, implementing new and exciting ideas has become more accessible. When it comes to video gaming, complex algorithms, new gaming engines, hyper-realistic graphics, etc., are no longer just found in science fiction but have become a part of reality. The issue of safeguarding these unique ideas is a serious consideration for companies pushing the boundaries. No innovator wants their creations stolen or misused. This is where intellectual property comes in.

Large organizations spend a lot of time, money, and effort in Research and Development to ensure their innovations are patented. This gives them an edge in the market as their technology is secure and cannot be copied elsewhere. Some of the big players that have focused their patent activities on AI technology in the video gaming field are listed below.

 

Top Patent around AI Gaming (Source: Lumenci)

 

With the biggest number of active grants, IBM sits comfortably at the top. Microsoft, the organization that created one of this generation's most popular gaming consoles, takes the second position. Given that Microsoft’s biggest competitor in this industry, Sony, has so less patent activity in this domain comparatively that it is a bit surprising.

Some video gaming organizations don’t file many patents, but their contribution to this industry cannot be overlooked. For instance, Take Two Interactive Software, Inc., the owner of Rockstar Games, did not make a list above, but their AI in the video gaming world is unparalleled. Some of the most popular open-world video games in history, such as GTA San Andreas, GTA Vice City, GTA IV, GTA V, and the Red Dead Redemption series, were all published by Rockstar games. The underlying NPC, AI, in these games has gathered worldwide attention. Even though the count of patents filed by them is low, whenever there are any leaks or rumors regarding their licensed technologies, fans come up with theories or wait for the arrival of the next installments of their beloved Video Games.

 

Patent Publishing Trends over the past 6 years (Source: Lumenci)

 

If we observe the patent publishing trends in this domain for the past five years, we can see a consistent rise till 2021. Followed by a steep drop, possibly indicating the wait times. It takes about 18 months to publish most applications successfully. As people explore AI and understand its use in the field of Video Gaming, new innovations arise. 

Conclusion

As overwhelming as this information may seem, it is safe to say that whenever you play your favorite game now, you'll try and think about the intelligence behind it. Although movies like The Terminator try their best to prove that AI will bring about the eventual downfall of humanity, nobody can deny that this technology is revolutionary and slowly becoming an essential part of our life. Although fabricating a fan-favorite NPC like Free Guy might seem like a bit of a stretch, a few years ago, verbally requesting a machine to toggle light switches were only something seen in a sci-fi film. As impressive as the progress in AI has been, we have barely scraped the surface, and the capabilities of AI seem endless. Here's to winning more races, scoring more goals, slaying more superhero bosses, having a tinge of respect for AI, and no fear of it taking over the world.


Editorial Team at Lumenci

Through Lumenci blogs and reports, we share important highlights from the latest technological advancements and provide an in-depth understanding of their Intellectual Property (IP). Our goal is to showcase the significance of IP in the ever-evolving world of technology.

Lumenci Team