How is Artificial Intelligence Used in the Video Game Industry?
I see a lot of takes on the internet that range from optimistic, to speculative, ignorant
and flat out wrong.
So it's time to set the record straight.
From intelligent characters, to procedural generation, player modelling, texture upscaling,
cheat detection, natural language processing and more, this episode of AI 101 will seek
to answer this question as succinctly and clearly as I can: how is Artificial Intelligence
adopted in video games?
What folows is undoubtedly not going to be exhaustive.
It's hard to condense everything into a concise video.
But it should cover the fundamentals for anyone interested to expand from there.
In addition, this overview will focus on techniques employed within actual video game productions.
We will save looking at AI research in games for another time.
To begin our exploration of AI for video games, we need to start by explaining what we mean
by 'artificial intelligence'.
Artificial Intelligence is a term that has existed since 1956, which is designed to represent
a collection of various algorithms, philosophies and techniques for enabling computers to make
intelligent decisions.
Since its inception, the notion of AI has gradually delineated into particular schools
of thought.
The first is to embed knowledge of the problem as a series of states comprised of facts and
how these facts can be changed courtesy of actions.
This creates a representation of the problem known as a state, and this allows for a system
to search within this representation to find sequences of actions to solve a specific problem.
This approach is commonly referred to as symbolic AI, and - given its prominence in the early
days of the field compared to now - is sometimes referred to as 'classical AI'.
Meanwhile the other major category is called machine learning.
While this is the dominant field of AI, it is far from a new concept, with the term 'machine
learning' first devised in 1959 and the first application that adheres to this concept emerging
not long after the term Artificial Intelligence itself was first devised.
Machine Learning refers to a collection of algorithms that learn a solution by looking
at existing data about a given problem.
It can do this in a variety of ways, either without supervision of the designer, by learning
to replicate existing phenomena or by improving the solution through trial and error.
In each instance, the system 'learns' by iteratively improving the solution it presents, by reducing
the perceived error of its outputs.
The system doesn't learn the way humans typically do, it simply becomes 'less bad' at the problem
it tries to solve.
This is often useful when the problem space is very complicated and multi-faceted, given
a machine learning system can generalise to handle a myriad of unique situations better
than a symbolic system can.
Now regardless of opinion, any argument of what consitutes as AI in this diagram is not
open to debate.
Algorithms from both symbolic AI and machine learning fields adhere to the principle of
agent theory - in that they make intelligent actions based on the information provided,
such that they will provide as close as optimal solutions that fit a desired goal.
Since the inception of the field, what we - both as developers and the general public
- consider to be 'intelligent' has changed drastically as the state of the art has improved.
But fundamentally, simple search algorithms have just as much right to be considered AI
as the biggest breakthroughs in machine learning.
Speaking of, more recent developments in machine learning have led to the emergence of two
specific sub-disciplines.
The first is deep learning, a term that first arose in 1986 but its current adoption is
largely courtesy of a number of significant breakthroughs in the late 2000s and early
2010s, after which Deep Learning has since dominated the AI landscape.
Deep learning refers specifically to the technique of training large-scale artificial neural
networks - non-linear data structures that adopt principles from neurology - albeit in
a very naiive way.
In games they were largely popularised courtesy of work by the likes of Google DeepMind, as
they trained deep neural nets to learn to play classic Atari games, as well as Blizzard's
StarCraft II.
The second recent development, is what is collectively known as Generative AI: a sub-discipline
of deep learning, and adopts the same principles of training deep neural networks, only this
time as generative models rather than intelligent inference models.
This has largely been popularised by the likes of Open AI's ChatGPT.
Now we are seeing generative models being created for a myriad of purposes, ranging
from story generation to character dialogue, audio assets and art assets in a myriad of
forms.
So that is AI at a very high level, and in each sub discipline, be it symbolic AI or
machine learning, there are a myriad of different approaches that are designed to suit specific
types of problems, and even specific permutations of those problems.
But now let's talk about how they are utilised in games, and the other sub-discipline that
this subsequently created.
--How AI Intersects with Games -- Now it's important to delinate the types of
ways in which artificial intelligence is employed in video games, both in terms of the features
it helps achieve, and the ways it is used in production.
AI typically had three applications in games:
- AI that 'Plays' - as part of regular gameplay.
- AI that creates content for a game.
- AI that models properties of the game.
On top of how it is used, there are two distinct ways in which it is adopted in the project:
- First there is AI that is part of the players experience.
The AI that the player will actually interact with.
- Secondly, AI that is part of the games development and production.
The AI that is used to help improve quality in production, or resolve problems more effectively
or efficiently than developers doing it manually.
Now it's worth stressing that when the video games industry talks about AI, it is for the
most part talking about one specific subset: AI that plays as part of the players experience
- which I'll unpack in a second.
Using AI as part of the development process is a more recent development, largely within
the past 5-10 years, and it is right now in 2024 an area that generative AI seeks to invest
in.
But as I say, for the bulk of developers, when we talk about AI in games, we're talking
about player facing systems.
So let's dig into that some more: AI that is player facing and part of the experience.
What that means, the approaches adopted, and what specific use cases exist for it.
It's important to start with a discussion of AI for Game Experience, given it leads
to another important distinction.
Thus far, my argument of what constitutes as AI is that it makes intelligent decisions
based on the problem it is trying to solve.
It has a specific goal it is trying to achieve.
Or in the case of a lot of machine learning it is creating content that is reflective
of what it has been trained against.
AI that is part of a games experience is often built with the intent to be fun.
Fun is a highly subjective concept, and as such what we consider intelligent or optimal
in a game is seldom what is considered as such in real world contexts.
Given it's more important that an AI do something that is interesting to facilitate the player's
experience, rather than be perfect in its execution.
Plus, there are specific problems that AI is required to solve.
This includes not just making decisions in the interests of players entertainment, but
knowing how to move characters around the world (be it in 2D or 3D), reacting to the
players behaviour in ways that are contextually relevant and consistent, and facilitating
the fiction of the games narrative in ways that support the players enjoyment.
All the while ensuring it is computationally efficient and tractable such that it can execute
on the hardware it is running on, and will not negatively impact performance of the game
itself.
This has led to a sub-discipline referred to as Game AI - this is a specific subset
of symbolic AI methods that have been adapted to suit specific game design problems.
This has almost exclusively focussed on our first application category - AI that 'Plays'
as part of regular gameplay.
This creates the behaviour of non-player characters or NPCs.
I have covered many of these over the years in my videos, but let's just list some examples:
- Search algorithms that are adopted for navigation, with specific techniques for steering vehicles
and similar objects.
- Navigation meshes are data structures built to delineate what areas a character may move
across, and how to calculate paths across it.
- Finite State Machines seen in DOOM, Half-Life and even The Last of Us encapsulate relevant
behaviours a character may execute, and the conditions which necessitate which behaviour
remains active.
- Behaviour Trees like in Halo and Alien: Isolation provide mechanisms to identify sequences
of actions relevant to current context, while also ensuring behaviours can quickly shift
based on in-game events.
- Goal Oriented Action Planning in F.E.A.R.
compute sequences of actions to solve a particular goal, and then how it should translate into
execution within a finite state machine.
- Utility AI is used to help identify the best actions to execute in a give situation,
or the best goal to solve in the current context.
- Bark systems that run simple rule based conditions for playing audio to communicate
information to the player.
Plus on top of this, there's a lot of other symbolic AI techniques adopted for Game AI
purposes.
Strategy games like Total War use tree search algorithms for decision making, or influence
maps for spatial analysis, while games like The Sims use constraint satisfaction techniques
so that characters can execute actions concurrently or in ways that appear more human like.
Meanwhile, by comparison, machine learning techniques are not as heavily adopted in this
category.
As discussed in my dedicated AI 101 episode on Machine Learning for Games, as well as
my episode on why making good AI for games is difficult, Machine Learning is still not
that pervasive in this category.
This isn't to say that machine learning is not adopted in games experiences.
Far from it.
There are examples of machine learning techniques being used for the likes of NPCs in games
like Creatures and Black and White in 1996 and 2001 respectively.
But it has largely seen more success in recent years, most notably in the likes of opponent
racers in the MotoGP series, the SophyAI of Gran Turismo 7, in enemy factions in Age of
Empires 4, or for decision making in the video game adaptation of the card game Race for
the Galaxy.
Plus Forza's Drivatars which is special instance, given that it models the behaviour of players
- a topic I'll discuss later - and then reproduce it in front of others players.
So having discussed AI that plays, there is arguably the second most well known application
of AI in games, and that's AI that creates.
Content creation for the player experience falls under many categories, be it levels,
characters, weapons, narratives or more.
We typically refer to this as procedural content generation.
PCG is a topic that is often considered not to be AI, but this is a philosophy that denies
a fundamental concept of the approach.
All PCG algorithms intelligently apply rules and processes that craft content with respect
to a pre-determined notion of quality.
This heuristic of what is considered a 'good' decision or not during generation, is often
laced within the design of the algorithm.
While pseudo randomness is a fundamental requirement of procedural generation to achieve variation,
regardless of how rich or complex the process is, it is making decisions to craft content
that respects implicit design rules and is therefore, at its most fundamental level,
an intelligent system.
This argument has only been made stronger by the recent rise of generative AI techniques.
Given generative AI is essentially procedural content generation but rather than building
an algorithm to craft content, it is model trained from existing examples.
At the time of writing, generative AI for games is a big talking point.
The production challenges, limitations and legal requirements are not currently established,
and the number of AAA games that have adopted this in a released product is still in the
single digits.
As such, this is the area of this taxonomy that will no doubt see significant change
when I update it in the future.
But in the meantime, let's look two other major developments that have reached consensus:
the first is in real-time rendering, whereby AI helps to draw graphics on the screen as
you play the game.
First up there is DLSS, or Deep Learning Super Sampling, this process is improving the overall
graphical quality of a game in real-time by running AI upscaling on your GPU.
Check out my dedicated episodes on the topic to find out more.
In addition to this, more recent developments in neural rendering are allowing for upscaling
that works in bespoke areas of the game.
For example, 2023's God of War: Ragnarok uses a neural rendering feature so that the textures
put in the final build of the game are a lower resolution, and thus saving disk space on
the player's Playstation 5.
The final aspect of AI for player experience, is how machine learning is used to model player
behaviour.
We already discussed player modelling in the context of AI opponents like in Forza, but
performance for matchmaking purposes.
Xbox's TrueSkill and TrueMatch algorithms learn how to model the skill of a player over
time such that they can create the most engaging matches possible.
Meanwhile Riot have employed machine learning as part of their skill based match making
approach for Dota 2.
As we move into AI for Game Production, it's important to highlight that this is - by game
development standards - a relatively new field.
AI used as part of a games production is a concept that only existed in a handful of
examples even 15 years ago.
The innovations in deep learning over the past 10-12 years have enabled for a variety
of new ideas to be explored in this space, and yielding returns that make it actually
worthwhile to use these systems as part of a game production pipeline.
Once again, we break this down into 3 applications: AI that plays, that creates, and models.
So let's get started.
The one major application of AI that plays as part of production is in quality assurance
and testing.
Testing is an increasingly popular area of application for AI given it can help speed
up, and ultimately improve one of the most demanding aspects of a games production.
Given the very nature of the field, bugs and issues can emerge in a game in a myriad of
ways, be it broken feature, erroneous functionality, art assets loading incorrectly and much more.
But identifying where these bugs occur, and the often complex series of actions that need
to be taken to trigger them, can be incredibly demanding.
Typically this is the realm of human testers, who spend significant time trying out specific
configurations and actions in different scenarios.
But now this is an area where AI can not only help automated that repetetive activity, but
also run curiosity-driven algorithms to ensure they explore the game and try out different
behaviours to see if specific bugs occur.
We've seen this already on the channel as I dug into the bots in Ubisoft's Division
franchise.
Meanwhile, the likes of Electronic Arts have shared their work on a myriad of titles recently
at the Game Developers Conference, plus smaller companies like modl.ai are also providing
these tools such that they are more accessible for indie developers.
Moving into AI that creates, this is where we're seeing a lot of opportunities emerge.
Naturally, you may think that the bulk of this is courtesy of generative AI.
But this is already an area that has seen significant gains courtesy in the past 10
years, so let's walk through what is - to my mind at least - the most prominent examples:
First up there is animation, with motion matching techniques being an example where AI is used
to resolve a production issue.
This technology has appeared in my detailed breakdowns of games such as Hitman and The
Last of Us Part Two, but it's not the only part of the visual aspects of games that's
seen AI driven innovation.
Texture upscaling, which is a process whereby AI can take art assets and reproduce them
at higher quality, is one that first emerged courtesy of modding communities, but has made
its way into game production pipelines.
With the Mass Effect: Legendary Edition being arguably the most high profile example in
recent years.
Unlike AI for real-time rendering, this process is computed during development, with the upscaled
assets used in the game build.
To find out more about how it works, check out the dedicated episode on the topic.
Two final things to mention in this space, are the use of AI for accessibility and for
code generation.
AI that can generate subtitles from dialogue and voice chat, plus the use of text-to-speech
systems for reading aloud menu items.
I consider this as part of production rather than player experience, given the adoption
of the technology may help offsets costs and production time in creating these assets otherwise.
Similarly, code generation using generative tools like GitHub copilot, can help developers
more rapidly iterate on initial ideas before refining them into production ready assets.
Moving into AI that models, while there is some experimentation in areas such as physics,
there are two main areas in which this is employed.
The first is in player modelling for analytics, this is more or less the practice of data
sciences in extrapolating information about a player base, with some AI adoption in there
at times to help developers understand how their audience is playing their game and what
issues or otherwise they're experiencing.
A simple yet still relevant example of this, is the analytics research in Tomb Raider:
Underworld, a topic I explored in a video many years ago.
The final area that has been applied in production, is the use of machine learning as part of
efforts to combat cheating and toxicity.
Like many online spaces, online games sadly have to deal with bad actors who seek to ruin
the fun for everyone else.
Be it by harassing others via text or voice chat, or through their actions within the
game space.
Similarly, some go one step further and utilise cheats and other mechanisms to circumvent
regular play is an increasing problem.
It's in the best interests of games studios to ensure their online community is as healthy
as possible, especially when so many games seek to monetise their players.
Naturally, the internal mechanisms of many of these systems is relatively unknown.
However, developers such as Valve have openly discussed their efforts of using deep learning
to catch cheaters in their popular shooter Counterstrike.
Thanks for getting this far and surviving this fairly heavy breakdown.
I hope you find this useful.
If it helps give a clearer picture of the state of the industry, provides guidance on
your own interests in the subject, identifies areas to dig into further or just settles
an argument you had with a friend, then I consider my job done.
I doubt this answers everyone's questions, given there's so much ground to cover, and
I really hope I didn't miss anything.
But then there are over 100 videos on this channel on the subject if you want to dig
into this some more.
As noted in the title, this is acknowledged as the 2024 edition of this breakdown.
My plan is to update this information periodically as the state of the art evolves and standards
begin to converge.
While game AI is long established, and not going to change too drastically, this will
be particularly relevant when we discuss generative AI.
We've yet to see how this becomes established industry practice, and this will take time.
It took a few years for deep learning to cement itself into games the way it has now, and
we are still finding ways to use it as part of game development.
As such, it's important to be patient and wait and see how generative AI becomes a part
of game development processes.
While there are a myriad of examples emerging of generative AI being used in games, relying
on such speculative experimentation to dictate industry practice would be naiive.
When I mention deep learning in games, as you've seen throughout this video I have pointed
to a myriad of games with different genres, budgets, applications and more.
By comparison, generative AI has yet to move beyond experimentation to reach not just healty
iteration but an informed consensus.
That will take a couple more years to manifest.
So yes, expect updates in the future, as this diagram evolves.
And so to make things easier for everyone, this big shiny graphic that you see right
here, that I spent far too much time developing, is available as an infographic that you can
download and share with your friends and colleagues.
The next time someone tells you that YOU don't understand how AI can be used in video games
- which I'm sure happens all the time down the pub - you can proudly display this diagram.
Because after all, the most reliable sources of information out there, are shouty self-indulgent
old white guys on the internet who share their perspectives on video platforms.
Speaking of, don't forget to subscribe on YouTube, both this channel and my second channel
AI and Games Plus, as well as Twitch, TikTok and... oh yeah the Branching Factor podcast
on Spotify or Apple Podcasts.
Y'know this started out as a joke and the longer I write it, the more horrified with
myself I become.
AI and Games is a crowdfunded series and its thanks to my viewers that new videos continue
to drop.
To find out how to support the show, please visit the links on screen and or check out
the video description to find out how you can support AI and Games on Patreon, YouTube
and Substack.
Take care of yourselves, and I'll be back.