From code to emotions: “AI is changing storytelling in games”

Today’s game characters can express joy and sorrow and act on their own desires and needs, much like people. Game researcher Mirjam Palosaari Eladhari develops intelligent agents, AI systems designed to behave like humans, complete with emotions and moods.

Portrait of Mirjam Palosaari Eladhari 

Mirjam Palosaari Eladhari studies how complex game characters are created, and how they behave once players interact with them. Photo: Johanna Säll/Stockholm University

“Once they are placed in the game, they are ready to respond to whatever happens,” says Mirjam Palosaari Eladhari, Associate Professor in Computer and Systems Sciences at Stockholm University.

Her research focuses on AI-based game design, a field within game development where artificial intelligence plays a central role in the game itself.

“AI tools are used to create intelligent, believable characters – opponents that are unpredictable and fun to play against. They can also generate objects and environments for the game, such as new planets where the story can unfold, and adapt the level of difficulty to each player.”

Co-creation

Part of her research explores ways of developing layered, complex characters. But her main focus is what happens during gameplay, when an AI system and human players create content together, a process known as co-creation. In most games this happens through what is called mixed-initiative creation, where the narrative emerges from a combination of the game’s programmed decisions and the player’s own actions.

“In that interaction something entirely new can emerge, that didn't exist before. Unexpected stories about life and relationships often arise in games that revolve around something else.”

According to Mirjam Palosaari Eladhari, with an academic background in literary studies, the real-time interaction between players and the game system creates a new form of storytelling.

“What makes online role-playing games so interesting is that there is not just one main character, like in a novel or a film with a fixed plot. In games each player can build their own character. You are not the sidekick to someone else’s charismatic hero. You are the main character in your own story.”

AI a natural part of game design

Although AI is becoming increasingly common in game design, Mirjam Palosaari Eladhari does not believe artificial intelligence will take over the creative process.

“When Alan Turing* began writing AI code with pen and paper in the 1950s, one of the first things he worked on was AI for chess. AI and games have always been closely connected. There are AI systems that can generate small, complete games, but I think players will continue to want games with a distinct creative voice and identity. And it is a myth that everything happens automatically. Game developers programme the AI and provide the input.”

*Alan Turing was a British mathematician, logician and computer scientist, widely regarded as the father of modern computer science and artificial intelligence.

What makes a game meaningful?

“Like all art forms, games affect us deeply. Gaming has moved from being a subculture to becoming a natural part of everyday life for many people. Today there are games across the entire cultural spectrum, from disposable entertainment to high culture.”

But what is most important for a game of quality, besides complex characters, is the storyline. It needs a good and engaging story. Something most successful games have in common. But there are other factors as well.

“As a researcher I also study the deeper side of digital games, for example how to design games with high artistic quality, and how games can become more meaningful on a personal level.”

How is it possible to measure if a game is meaningful?

“One way is to study how players talk about games on digital platforms, something we call re-telling. This can reveal how well a game works and which characters or environments players connect with. There is a vast amount of material from players discussing games, not only in forums but also in fan fiction and blogs. By analysing these retellings, we can see what players found particularly meaningful in a game and what made a lasting impression.”

Some characters become so popular that entire fan fiction genres emerge around them.

“People draw them and continue their stories beyond the game world. That gives us a strong indication of how significant a game can be for its players.”

Game dynamics as support

Mirjam Palosaari Eladhari is currently exploring how gameplay can help out in everyday challenges.

“Through the world of games, you can observe dynamics in social relationships that might otherwise be difficult to see. Repeated interactions with other players can reveal how relationships develop in specific situations, whether that involves guilt, cooperation, or other aspects of human interaction.”

This knowledge can then be used in practical applications.

“One current project aims to help people with autism structure their daily lives. A common difficulty can be deciding what is important to focus on. We have developed an application that helps guide attention to the right task, for example: ‘now it’s time to water the plants’.”

The appeal of researching games

For Palosaari Eladhari, the most exciting aspect of game research is the mix of theory and practice.

“What makes it so interesting is the opportunity to study games in theory and then test those ideas in practice. The intersection between design and research is the most rewarding part. It can actually be difficult to separate research from artistic work in game development. The two are closely intertwined.”

Future game research

According to Mirjam Palosaari Eladhari, the research field has developed rapidly from a pure technical point of view to a broad field of aspects, which makes it more fruitful.

“Researchers come from many different disciplines, psychology, literature, technology and sociology. It is important that the research question and the method used align with one another in order to produce meaningful results.”

And one major challenge remains:

“The big question is whether there is a method in the world that can truly measure the cultural and social impact of games.”

Portrait of Mirjam Palosaari Eladhari

For Mirjam Palosaari Eladhari, research and creative work in game development are deeply intertwined. Photo: Anette Gärdeklint Sylla/Stockholms University

Examples of AI technologies used in game development

  • PCG (Procedural Content Generation)
    A technique that allows games to generate content dynamically instead of designing everything in advance, for example allowing a forest to grow instantly rather than creating every individual tree.
  • ML (Machine Learning)
    A group of techniques that enable computer programs to learn from data.

“These are technologies where AI learns from experience rather than being explicitly programmed for every action. They are trained on data provided by humans, and we guide them on how to interpret that data and what they should become good at. If I want an AI character to learn how to be frightening or adorable, it first needs to understand what humans find scary – or irresistibly cute.”

More about Mirjam Palosaari Eladhari

About the research

Last updated: 2026-03-05

Source: Communications Office