🎉 AI Engineers: Aporia's 2024 Benchmark Report and mutiSLM has been released. View the report here>>

Back to Blog
Machine Learning

The Future of machine learning in video games

The Future of machine learning in video games
Or Jacobi Or Jacobi 10 min read Jun 18, 2023

This article is co-authored by Or Jacobi, Software Engineer and gaming fanatic at Aporia, and Joseph Sibony, Tech Trends Observer at Incredibuild. 

Game development has long been at the forefront of AI technology, and more recently it has started using machine learning (ML) to create more immersive and responsive experiences for gamers. Let’s explore how the game development industry is already using AI in video games, and discuss where it’s headed.  

What are ML and AI in video games?  

In 2014, the video game Middle-Earth: Shadow of War was praised for what was considered a revolutionary system. NPC enemies that players fought remembered them, and depending on the fight’s outcome, they might be promoted in their army or demoted. Either way, their interactions with the player each time they met – completely organically.  

This use of AI was hailed as innovative and revolutionary, but it was also a major success of ML in gaming. Machine learning in video games takes a lot of different shapes, and it’s used in several specific ways that can enhance experiences for gamers.  

Even so, it’s only relatively recently that machine learning has become a mainstay in the game development sector. There are several reasons for this. First, the hardware had to catch up to software developments to make it feasible at a large enough scale. The introduction of modern processor architectures and much more powerful GPUs have made it easier to embed ML and AI tools in games without impacting performance. 

Additionally, the amount of data that games produce today is much higher than even just a decade or two ago. This means that ML models are much easier to train and perfect, leading to smoother experiences and better results. 

For instance, older video games had to be completely scripted beforehand. Even games like the Fallout series – which were praised for their expansive dialogue trees and variability – were fully written ahead of time, since there was no way to capture user data mid-game. Today, though, those are problems of the past.  

How are machine learning and AI used in video games?  

Most generally, ML and AI are used to improve the overall performance of a game, whether that’s in back-end operations such as rendering and player interactions, or even front-end functions directly related to the game experience.  Let’s dive into some of the ways these technologies are used – and will be used – to make video games better.  

Procedural content generation  

One of the most popular uses of AI and ML in gaming today is in procedural content generation (PCG) – whether that’s reactive audio, new story and plot lines for players, or even the generation of entire game levels. 

Several game genres today rely on procedural content generation, from open sandbox survival and exploration games to “roguelites” that rely on constant gameplay loops focused on replaying similar but unique levels multiple times.  

These methods use AI systems to generate frameworks and base models that would otherwise have to be programmed manually. Instead of being limited to how much content a team (even the ones with the most resources) can create, players can explore nearly infinite universes that are unique.  

More importantly, procedural content generation isn’t just about the big picture. PCG can be used to create anything from textures to natural effects (think the fauna that appears on a new planet or the walls and bricks in a dungeon you just arrived at).  

Visuals  

This is closely related to procedural generation, but it’s focused on making games look better and more realistic when you zoom in. In many cases, games feature pre-rendered backdrops and environments as you move through them or stand far away. But as you get closer, it becomes harder to render them accurately and more effectively.  

For example, Microsoft and Nvidia teamed up to provide a solution using Microsoft’s Windows ML API. The tool connects to the users’ GPU to provide acceleration and lets games process data much faster, as well as use deep neural networks to upscale graphics, images, renders, and more. 

This process happens dynamically, so instead of having lag time between players approaching an object and it finishing rendering, graphics are immediately upscaled to look seamless.  

Non-player characters 

Today’s massive games require a lot of non-player characters (NPCs) to feel lived-in and realistic. Games like the Grand Theft Auto series, Horizon Zero Dawn, and even MMORPGs like Final Fantasy XIV and World of Warcraft — which are centered around player-to-player interactions – require hundreds of NPCs. 

The issue is that if these are too “artificial” — their dialogue is too repetitive, or their movement is too predictable – it can break immersion. Developers can use ML to feed data about players’ interactions with the game (just as in the example of Shadow of Mordor) to make NPCs “intelligent”. 

Instead of simply going through a script, they can evolve, respond, and react. If a player is becoming too predictable, NPCs can adapt their behavior to up the challenge in a game. Games like Red Dead Redemption 2 also use this technology to offer more realistic interactions.  

Personalized content for users 

This largely applies to the current trend in the industry of releasing live-service games – games that are constantly updated with new content, like Fortnite. To help keep things fresh and users engaged, developers and studios can use data on player interactions within the game to provide specific experiences, offers, messages, and recommendations that are more relevant.  

So instead of cookie-cutter content and offers, users can engage in games that are tailored to their specific preferences and likes. It also keeps games novel for users, who can play different ways and find more enjoyment than if they had to play experiences that were only tangentially related to them.  

Examples of machine learning in video games 

We’ve hinted at some examples of machine learning and artificial intelligence in gaming, but it’s worth looking at each a little more closely. These games are making full use of this technology to provide immersive, engaging, and realistic experiences for users.  

No Man’s Sky created a procedurally generated universe 

One of the biggest indie success stories of the past decade, No Man’s Sky promised gamers a completely procedurally generated universe – trillions of planets to explore with unique flora and fauna, weather, elements to mine, and landmarks to explore. 

Sean Murray, a lead programmer on No Man Sky and managing director of Hello Games, talks about the process.

Despite a few early troubles, the game has delivered on its promise. Using AI and procedural content generation, No Man’s Sky offers players a completely unique experience each time they boot up.  

Shadow of Mordor creates nemeses for players  

It’s worth bringing up Shadow of Mordor’s Nemesis system one more time. In the game, the player will constantly face hordes of Orcs and other soldiers in the enemy’s armies. If they defeat the player, these NPCs will rise through the ranks of the army, gain notoriety, become stronger, and remember their victories, leading to tougher encounters and more engaging enemies. It also works in the opposite direction. 

Enemies you constantly defeat will become vindictive, searching players out to restore their honor and gain some measure of revenge. They’ll also lose rank and be forced to fight to gain their old position.  

In Shadow of Mordor, your enemies will keep a grudge and remember their victories.

The game achieves this by tracking data about encounters, procedurally generating enemies and giving them unique traits, and letting the game do the rest. This way, each player’s playthrough is completely unique in a way – no one will have the same nemesis, and no two players will experience the same character arcs.  

Red Dead Redemption 2’s realistic game AI 

Similarly to Shadow of Mordor, Red Dead Redemption 2’s developers wanted to make their NPCs believable characters, rather than fillers in an empty world. As such, NPCs often have lives that move on independently from the player – they’re not just waiting for users to interact with them, but are active participants in the world. 

RDR 2’s realistic-looking NPCs

As such, NPCs will react to players’ appearance, notoriety, and actions. If you show up to a bar dressed like a bum, or covered in dirt, some NPCs will ignore you, insult you, and be less inclined to engage with you. But taking time to learn about them, engage with them, and react appropriately will reward players with rich conversations and backstories.  

Leveling Up: The essential role of monitoring ML models in video games

In games such as No Man’s Sky with its endless universes, Shadow of Mordor’s evolving enemies, and Red Dead Redemption 2’s autonomous NPCs, monitoring ML models is essential to maintain consistency, captivate players, and optimize dynamically generated content and AI behaviors.

Monitoring these models in gaming environments involves real-time performance tracking, such as latency and throughput, to ensure that procedurally generated content in games like No Man’s Sky loads swiftly and efficiently. Adaptability assessments are also vital; for example, tracking model accuracy and loss metrics in Shadow of Mordor’s Nemesis system ensures that enemies evolve in a realistic manner. Anomaly detection is crucial in games like Red Dead Redemption 2, where monitoring AI behavior helps maintain the lifelike actions of NPCs. 

Employing fairness metrics and bias-detection tools to evaluate the decisions made by ML models in real-time helps to dynamically adjust model parameters to ensure more balanced and unbiased gaming experiences. This vigilant oversight not only enhances gameplay but also contributes to the sustained innovation and evolution of ML applications in the gaming industry.

New developments for machine learning in the video game industry 

Machine learning in gaming is here to stay, and developers will continue to find novel ways to implement it – both in player-facing functions and on the back end. For instance, one of the biggest uses studios have found already is not even visible to most players – detecting cheats and hacking in-game. 

As topics like player security and privacy become bigger concerns for users, ML will play a crucial role in helping developers step up their efforts.  This includes developing algorithms that use ML to track “normal” player behaviors and engagement and empower AI tools to detect hackers and other malicious actors automatically. Additionally, the industry – which is quickly becoming one of the most profitable sectors in entertainment – will find ways to improve its offerings, whether that’s understanding how specific demographics engage with them, how eSports is viewed and how to expand their reach, or simply to provide greater in-game experiences.  

As this becomes more common, however, developers will need tools to make sure they can provide the same level of performance and meet their deadlines without suffering from crunch or significant delays. That’s where tools like game developer acceleration come in. They allow teams to build ML and Ai tools in games without having to suffer from the delays that would be normally inherent in them.  

Rate this article

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

On this page

Great things to Read

Green Background

Control All your GenAI Apps in minutes