How generative agents will revolutionise believability in Video Games

The first of a series of articles about generative agents, the next generation of AI NPCs.

Daniele Nanni
7 min readApr 22, 2023

Introduction

As someone who loves technology and gaming, I can’t help but get excited about the advancements in generative AI and how they might change the world of video games.

With generative AI we refer to a type of artificial intelligence that has the ability to generate content, such as text, images, music or even videos, autonomously and often with a creative flair.

This technology is powered by complex algorithms and large datasets, enabling it to produce novel and meaningful output, making it a valuable tool in various applications, including natural language generation and creative content creation.

In this article, I will focus specifically on large language models, exploring how they have the potential to spark a fascinating transformation in the gaming.

One significant application of these models is the development of generative agents for video games, or in other words AI-powered characters that have the capability to generate content that enhances the player experience.

This allows games developers to offer dynamic and personalised interactions to players, contributing to increased immersion and replayability.

Join me as we explore this transformative journey unfolding in the gaming industry and virtual worlds.

Believability of non-player characters

Contemporary games often feature worlds, characters, and story elements that play a central role, even if the game is not necessarily classified as a role-playing game.

Immersion is a vital component in many video games because it allows players to perceive the game world as if it were a genuine reality. When a good level of immersion is achieved, players can become so fully absorbed by the gameplay experience that they are prompted to perceive the game as though it were a genuine, tangible world.

Gameplay experiences and immersion are complex phenomena with many facets that can vary depending on the characteristics of the game and the player’s preferences. Immersion is not a singular or monolithic concept, and different aspects of immersion may be emphasised in different games and among different players.

Players usually seek games that elicit optimal emotional responses or response patterns, and the believability of Non-player characters (NPCs) can play a significant role in achieving an immersive environment and adding purpose to the player’s experience [1]. If NPCs are poorly portrayed or fail to contribute to a believable environment, it can be challenging for players to immerse themselves in the game.

NPCs with realistic behaviours and personalities can make the gameplay experience more enjoyable and engaging, allowing players to empathise with them and create deeper connections with the game world. Immersive NPCs can also enhance the imaginative immersion of players [2], as they offer a chance to use their imagination and enjoy the fantasy of the game. Therefore, designing NPCs that contribute to the sense of immersion is crucial in creating a successful gameplay experience.

Creating believable NPCs in video games is quite a challenging task, especially for sandbox and open world video games where there isn’t a linear storyline that can be followed.

Coping with the vastness and unpredictability of such open environments can prove to be daunting, requiring substantial resources, time, and effort for developers and game designers.

Manually crafting NPC behaviour to cover all possible interactions is impractical and inevitably leads to limitations in the characters’ ability to fully represent the consequences of their actions and perform new procedures beyond their programmed script.

Machine Learning approaches have shown promise in creating more robust behavioural patterns for NPCs. However, these approaches still present certain limitations that put boundaries around their area of application or lead to unintended interactions between characters.

The NPCs in the video game The Elder Scrolls IV: Oblivion were criticised for their poor design and bizarre behaviour, leading to them to become memes in the gaming community.

With the recent advancements in Large Language Models, there is an opportunity to create a new architecture that could potentially push the boundaries of NPC believability.

By harnessing the power of these models, it may be possible to transform NPCs into generative agents capable of dynamically responding to changes in the game world and even seeking out new behaviour that wasn’t originally conceived by game designers. This could revolutionise the way in which we design and implement NPCs in video games, offering a new level of depth and complexity to the gaming experience.

But what are generative agents?

Generative agents are AI-driven systems that can autonomously create content, such as text, images, or other data, often using neural networks and large language models to produce dynamic and contextually relevant output.

In the context of video games, generative agents, can offer dynamic, personalised, and immersive experiences to the players who interact with them.

This is because generative agents can absorb information about ever-changing world states and use such information to interact with other agents, objects, and human players, make decisions autonomously, and exhibit believable behaviour.

While the technology to create fully functional generative agents does not yet exist, some researchers and companies have started experimenting with integrating large language models such as GPT-4 into games to create more sophisticated non-player characters.

By constantly processing data about the state of the game world, these prototype agents can analyse past interactions and experiences to learn and adapt to changing circumstances. Since they can understand and generate human-like language, they can engage in meaningful interactions with human players and other agents that operate within the same virtual environment.

These features imbue NPCs with semantic understanding and a certain degree of intentionality. Their underlying architecture allows them to understand the context they are immersed in and shape their behaviour based on how the world evolves over time, including the occurrence of player actions, environmental changes and the behaviours of other agents.

Although still in the prototyping stage, these initial generative agents offer a glimpse into their potential to revolutionise the gaming industry, especially when large language models will become cheaper to run and maintain.

In the near future we could see generative agents transforming the way players act within virtual environments, opening up new possibilities for social interaction, creative production, exploration, and gameplay.

Generative agents can generate dynamic outputs by continuously processing various inputs through the Language Model, without being limited by predetermined scripted states.

For generative agents to be successful, they need to include a certain set of key capabilities:

a. Inter-agent communication: They should be able to interact with other generative agents.

b. Agent-object interaction: They should be able interact with non-agent objects within the game or virtual environment.

c. Human-agent communication: They should be able to engage with human players effectively.

d. Believability: They must exhibit believable behaviour and responses.

e. Experience-based information retrieval: They should be able to access information based on events they have experienced.

f. Memory: They should be able to retain their experiences through short and long term memory.

g. Decision Making: They should be able to utilise the information stored in their memory to make informed decisions, adapt to changing circumstances, and engage in meaningful interactions with other agents, objects, and human players.

Initial experiments with generative agents [3], have demonstrated that equipping them with a sophisticated memory stream that allows them to store and retrieve observed events, reflect on past experiences, plan their behaviour and react to occurring events leads non-player characters to display believable behaviours.

Despite utilising language models in live environments, still represents a challenge due to the high processing costs and low response time, as the technology becomes more advanced and efficient, it becomes increasingly possible to bring generative agents to life.

In addition to this, more sophisticated language models could also allow generative agents to better understand human emotions and respond appropriately, learn and adapt to new situations more effectively, generate more creative responses, follow ethical guidelines and produce rich media.

However, it’s important to acknowledge that alongside these exciting advancements, there are also potential risks and challenges that need to be carefully addressed to ensure the responsible and safe integration of this technology.

Nonetheless, continued research and development of large language models, the potential for generative agents to create deeper, personalised, and inclusive virtual worlds is immense. This opens up to a whole new realm of possibilities for gamers worldwide.

In the next article, we will delve deeper into the architecture proposed by Google researchers, unlocking the secrets to a truly remarkable gaming experience.

Read Part 2 here

References

[1] Niklas Ravaja, Mikko Salminen, Jussi Holopainen, Timo Saari. 2004.
Emotional Response Patterns and Sense of Presence during Video Games: Potential Criterion Variables for Game Design, in Proceedings of the Third Nordic Conference on Human-Computer Interaction, ACM Press, pp. 339–347

[2] Laura Ermi, Frans Mäyrä. 2005.
Fundamental components of the gameplay experience: Analysing immersion in Changing Views: Worlds in Play, Proceedings of the 2005 DiGRA International Conference, 2005.

[3] Joon Sung Park, Joseph C. O’Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, Michael S. Bernstein. 2023.
Generative Agents: Interactive Simulacra of Human Behavior.
https://arxiv.org/pdf/2304.03442.pdf

[4] Georgios N Yannakakis, Antonios Liapis, and Constantine Alexopoulos. 2014.
Mixed-initiative co-creativity. In Proceedings of the 9th Conference on the Foundations of Digital Games. FDG, Liberty of the Seas, Caribbean, 8. http://www.fdg2014.org/papers/fdg2014_paper_37.pdf

[5]Max Kreminski, Melanie Dickinson, Michael Mateas, Noah Wardrip-Fruin. 2020.
Why Are We Like This?: The AI Architecture of a Co-Creative Storytelling Game https://dl.acm.org/doi/pdf/10.1145/3402942.3402953

[6]Marie-Laure Ryan, Jan-Noël Thon. 2014.
Storyworlds across Media. University of Nebraska Press. https://digitalcommons.unl.edu/cgi/viewcontent.cgi?referer=&httpsredir=1&article=1273&context=unpresssamples

Attributions

Icons by freepik.com

In–game screenshot: Elder Scrolls IV: Oblivion. Copyright held by UESP for use under the same Attribution-ShareAlike 2.5 Licence

--

--

Daniele Nanni

Developing Neo-Cybernetics to empower humanity. Exploring AI's impact on our world.