Wednesday, 12 September 2012

A Future of Polygonal Friends: Final Comments

This piece is split into three parts (Part 1 is here, Part 2 is here), and was written for the Critical Distance Blogs of the Round Table. 

Thanks for taking the time to read 'A Future of Polygonal Friends'!
This was actually an idea I'd had for a long long time, inspired by an article I read in EDGE magazine, talking about AI in games. My initial angle was actually to talk about how we can design better and more empathic NPCs on the whole, but when I saw Critical Distance's Blogs of the Round Table request ('Blogger Jam' would be a way better title, no need to thank me), I set out to take my article concept out of the realm of Notepad musings, and into a properly published format.

And wow. This essay is way too long, hardly ideal for putting on the web. But I felt that to explore the idea in a way that doesn't make people frantically sprint after my own leaps in logic, the first half was necessary. Plus, since this is written with other media bloggers in mind, hopefully those that stumble across this will make it to the end (clearly you have, or you wouldn't be reading this!)

Honestly, I struggled a little reworking this to fit the theme in a way I felt was complete. Writing about AI and good storytelling are both simple enough, but how do you link the two without sounding like an idiot, vague, or a vague idiot? Then I realised the potential was in AI characters telling their own story separate to that of the protagonist's, intersecting when and where the player wants, and there being consequences for those decisions. Story telling and character design need not act at odds to developing AI, but can work with it.

Forgive the large number of Non-AI examples used in the first half; I feel like examples of good design and dialogue without an emphasis on AI would be an important contrast to AI-based solutions. I won't apologise for making fun of Tropers, Power Ranger fans and Katawa Shoujo fans though; y'all are just asking for it.

A Future of Polygonal Friends: AI & Emotional Attachment (Part 2)

This piece is split into three parts (Part 1 is here, Final Comments are here), and was written for the Critical Distance Blogs of the Round Table. 

In the previous part, we covered the following:
  • Great video game stories need a varied cast.
    • But games often have identikit characters that only feel superficially unique.
  • To give characters depth, they need unique and varied dialogue.
    • But dialogue reacting to context is very uncommon.
    • Characters that say little or repeat often are very jarring.
    • Dialogue trees are a possible solution, but have limitations.
Those issues can be solved with some experienced and skilful writing, but there’s a way to both alleviate those flaws, and progress in interesting directions – the inclusion of AI.

What does AI entail? 

Artificial Intelligence is essentially a system of search engines. Put that way it’s not particularly glamorous, but that’s the truth. Artificial Intelligence has been around since the 1950s, and has been the target of obsession by both engineers and science fiction writers of varying quality.

While a lot of our modern technology already has a measure of AI to make our lives easier (even the Auto-Correct on your phone is an AI), we romanticise the idea of social, humanised machines that can be our best friend – or cruellest enemy. And autonomously at that. This is definitely relevant for video games – any character action that’s designed to happen in a way out of the player’s control – however slight – is the result of AI programming.

Narrative writing and AI are not necessarily mutually exclusive. It’s a reasonable point of contention – “How can something not controlled by the player be part of the story?” Most games keep story and gameplay as separate concepts – since if the story is places out of the players hands, there’s the chance that they could actually miss out on the story – a scary thought. However, with a little experimentation, and some advances in how we can program and utilise AI, we can blur the line into something unique.

What makes ‘em tick: AI and interaction

NPCs don’t mean a whole lot if the player can’t interact with them. In the vast majority of games, this details ways to fight or kill them. Not a whole lot of design is required to make a to-be-killed NPC 'convincing', as long as their demise is satisfying enough - but for NPCs that exist outside of a need to be mowed-down, the bar is suddenly set a lot higher for responses to player input. Hell, even major names in the games design industry are starting to recognise how important, yet how undervalued NPC AI is.

This is largely down to empathic reasons. We as humans intrinsically know how rational people react to certain situations. If we help someone they're grateful, if we tell a funny joke they laugh, etc. So, when a character - especially an NPC in a game with a narrative focus - behaves in a way that isn't rational human behaviour, it's jarring. When used intentionally it can create an effective unsettling mood; but often occurrences are unintentional, and it breaks whatever 'immersion' the player might be having with the setting.

The problems I’ve brought up in the previous part are closely related to this jarring feeling. Homogeneous characters don’t feel convincing when we know how people can vary so much in real life. Characters with unchanging disposition feel like the Terminator (with maybe fewer homicidal tendencies), and ones with unchanging dialogue are just that much more two-dimensional.

AI can definitely be handled badly. 2005's Façade was a breakthrough in AI and interactive drama, but its open-endedness was its downfall (to ignore the bare bones graphical presentation). Harassing the confused AI became something of a Youtube fad.

AI and Character Design 

Building on the concepts brought up before, this matters to character design diversity since people with different backgrounds are obviously going to think differently. It’s one thing to have a game character act uniquely within the plot, but when it comes to general gameplay, they often behave just like any other ally or enemy. It’s common in RPGs where you can give instructions to AI allies that different allies will act in the same way if given the same instruction (discounting things like different equipment load outs).

The Sims is the all-encompassing example about AI’s effect on character design. Any given character in the game is a bundle of personality traits and quirks, which manifest themselves in any action a Sim will take, even in subtle ways. The Sims 3 raises the curtain a little on how this process works – the player can select five specific personality traits when making a Sim, so the effects of these choices are more obvious. And with the 63 different Traits to choose from (and that's not including the expansions!), you’ll be hard pressed to get two Sims alike by chance.

Charismatic, Dislikes Children, Neurotic, Perceptive, Schmoozer. Me in a nutshell, really.

Applying this to characters out of the player’s hands is definitely an interesting direction to go down. Party members that are different in every way, right down to how they deal with a problem would make them so much more distinct. If these personalities were randomised from game-to-game, no two players would have the same experience.

AI and Character Dialogue 

AI matters to dialogue variety because no one maintains a single way of speaking. We change how we talk depending on who we talk to, or just how we’re feeling at the time. It’s jarring in a game to do something that upsets a character, only for them to go right back to a neutral attitude afterwards.

Animal Crossing, while very simple from a technical perspective, tries very hard to use dialogue and AI effectively. There are only 6 different personality ‘types’ in the game, which over 200 possible villagers can use, but you only ever deal with up to 10 of them at a time, masking the potential repetition. There’s an incredible amount of dialogue, tied to the weather, the time of day, if it’s a special holiday, if the villager is happy or sad… the list goes on. They will even talk to each other, and let you eavesdrop.

To create variation within a single conversation, dialogue trees function perfectly fine in a very controlled way, but the content of a dialogue tree doesn’t often change according to any context other than ‘state of the main plotline’. What’s more, dialogue trees only work if the player is present. Gaming narratives are often incredibly solipsistic – nothing can happen if the player isn’t there to witness or directly affect it, and that’s not how a believable world can function.

The Witcher 2 at the very least uses its dialogue trees in a way less transparent to the player, and with some neat consequences. The small, but incredibly important decision to not display whether a dialogue choice is 'good', 'evil' or otherwise tied to a game mechanic (which many games are guilty of) means that the player isn't so easily yanked out of the narrative when making a decision. What you do decide on ends up having further-reaching consequences than just the next line of text, as characters remember how you treated them, and will pass on the word of how much of an asshole you are to their peers.

Taking a cue from Animal Crossing’s book, and having conversation dialogue triggered by the state of the game world, and using Witcher 2's system of making sure your decisions are remembered down the line, will obscure some of the ‘branches’ of the dialogue tree from the player’s view. Guy Hasson put forth a theoretical way of managing dialogue trees that operate through more than just what the player does.

For those that don’t warrant complex dialogue trees, there are still solutions to give them variation. Here, randomisation is the key – Procedurally Generated sentences. What’s that? Well, since sentences (in any language) have a logical structure, having a computer construct unique utterances from word and phrase banks will save you from ever hearing a “Welcome to Cornelia!” more than once. It’s a solution that rules out voice acting (it’s hard to get artificially constructed voice sample utterances sounding convincing without some heavy editing and knowledge of phonetics), but it still has a definite future in RPGs.

AI and the ‘Simultaneous Story’ 

Animal Crossing and The Sims use AI in a way that creates robust characters, but they can act freely in a game with no overarching narrative. This isn’t to say that those games should adhere to a plotline (the spinoff Sims games that do are… tepidly received), but the big ‘future of video game AI’ lies in the combination of the two.

The key to more convincing, immersive worlds is that it doesn’t expressly revolve around you. Other characters doing their own thing independently of you are only the start. If these characters actually acted out their own stories incidental to your actions, it would be an implementation of subplots on a scale that books and movies definitely can’t match.

It’s an old title, but The Legend of Zelda: Majora's Mask is a very well-made example of a ‘simultaneous story’. Almost every character in the game has an intricately detailed life and schedule. Thanks to the strict three day timeframe the game takes place in, the NPCs can be given pre-programmed daily schedules, so their lives can unfold out around the player.

This is where the line between story writing and AI crafting is blurred a little. With the technology available at the time, having the characters act uniquely and randomly would be too much for the poor old N64, but by framing the NPC actions around set narratives, the amount of AI coding was a lot less intense, and the player has the ability to visit the same events again and again from different perspectives (as they learn more about the plot as a whole).

The Dead Rising titles all function on an in-game clock, with game events tied to it. Plot events will happily occur without you if you aren’t there to intervene, resulting in missed plotlines to major changes like characters dying. The first Dead Rising was incredibly strict with its time limit, making it nearly impossible to see absolutely everything in one run (you are, after all, a reporter – not a superhero). It's a shame that then, for the most part the survivors you encounter are there to be escorted to safety, and not too much else.

AI and the Visual Novel 

I feel like a side mention should go out to the Visual Novel. As the name suggests, it hugs a lot closer to literary storytelling, and for the most part forego AI in its entirety. Likewise, Point ‘n’ Click Adventure games are the text adventures of yore with a graphical polish. This gives them a lot of flak from consumers and critics – how could a genre survive when, in terms of technology, they are so undemanding?

Interestingly, that may be their strength. They are the Dialogue Tree to the extreme – everything is precisely controlled and scripted. But with that, it also means that there is so much more room to write their plots and characters as carefully as possible. They have no veneer of complex gameplay, and often can’t hide behind flashy graphics. The Ace Attorney games and the Monkey Island series contain some of the most complex characters in gaming, at least in terms of background detail and motivation. If any genre is to go the distance in creating deep and empathic NPCs within a narrative, you bet it’ll be a Visual Novel or an Adventure Game.

That, however, doesn’t mean that AI can’t make them more robust experiences. What the characters do when the player isn’t talking to them is just as important as the face-to-face chatting. Christine Love proved that with the background-running social networking in ‘don’t take it personally babe, it just ain’t your story’. Dating Sims corner the market on major characters that interact with the player in ways other than dialogue trees (meaning statistically, not carnally you pervert), but NPCs having a ‘memory’ for what you do and say would be both a lot more involved, and avoids simplifying the nature of relationships to “Choose dialogue option B”.

The future of AI

So what's happening next in the world of video game AI? Well, if you have the free time, take a look at Prom Week, a cute flash game that takes up the idea of generated conversations, and lets you experiment with them, reminiscent of The Sims, but with actual dialogue. Designed by Mike Treanor and a small crew of game designers from Santa Cruz university, it constructs sentences to feel unique, based on context, and how interacting characters feel about each other. The game challenges you to set up the characters to certain goals, but it's still relatively easy to orchestrate the right outcomes since the behaviour feels so genuine.

Prom Week is about its AI system through and through, but you only need aspects of its concept to bring an old game somewhere new. Imagine if LA Noire remembered the reputation you made for yourself; carrying out your investigations kindly, with ruthless efficiency, or like an Actual Cop.

The biggest AI breakthroughs are going to take a long time, and it might take even longer to use them to craft a game world that tells a really great story. A game where the subplots both operate independently of the player, but are also organically reflecting the player choices is a risky, big budget venture. And NPC that truly feels like a person when held up to the cold harsh light of gameplay may never even happen. But I remain hopeful. One day then, my enjoyment of video game stories won’t feel so sordid.

Read on to Final Comments.

A Future of Polygonal Friends: AI & Emotional Attachment (Part 1)

This piece is split into three parts (Part 2 is here, Final Comments are here), and was written for the Critical Distance Blogs of the Round Table. 


Some people read Playboy for the ‘articles’. Some people watch films for the celebrity roles. I play games for the story writing and characters. It’s my dirty secret.

The quality of script writing in games can barely even scratch the quality of what would constitute a ‘good’ film or novel, but I have a major soft spot for when a game wants to spin me a fable, or endear me to characters. Because writing a decent script for a game is apparently so damn hard, the industry focus is elsewhere; AAA titles push heavily for graphical fidelity and larger worlds to explore.

I feel that the next big step for games is improving how they tell a story – and that’s not just a plea for the industry to wean me off my addiction to charmingly ineffectual narratives. There are so many ways to go about stepping up the storytelling in games, critics could write (or argue) about it for months, but here I’m going to focus on character-driven storytelling.

To support a great character-driven narrative, you'll need... well, great characters. But if the only properly fleshed-out character is the protagonist, a player will have a hard time getting emotionally invested. While a well-written character in a story or a film can feel believable just by just watching them, video games are an interactive medium. We can prod a character, and we watch how they react with scrutiny.

In those cases, traditional writing can only take you so far – it’s the Artificial Intelligence of a game character that breathes more life into them.

But before I talk about what we can do with AI, there are some key topics aspects to cover first, more to do with writing skill than technical – and will use some examples from games where AI isn't a factor. It will also bring up potential writing and design problems that we'll come back to in the second part. All in good time.

Variety is the spice: Character design of the cast

It's very easy to formulate a cast of characters for any video game setting. The number of RPG characters with almost predestined personalities to fit in with their profession; the hardened crew of soldiers in any FPS (don't forget the token black one!); the full rainbow of 'sexy' feminine personalities the hero can bump uglies with. When you’re trying to get the character design process out of the way so other aspects can we worked on (which is a terrible idea by the way, but it definitely does happen), falling back on a familiar pattern to construct a cast is a tempting idea.

The laziest pattern is what I like to call 'Super Sentai casting'. Did you ever watch Power Rangers as a kid? Or maybe you're an adult child and are still watching it – whichever. In every series they have a cast of around five, and their characters are the result of some kind of MadLibs-by-committee, something like this:

___ is one of the ___ youths with attitude, representing the colour ___ and the legendary ___. Their general passion is ___, and they're the ___ of the group.

Pretty ridiculous. What's more ridiculous is that video games, even ones that are meant to be heavily character-focused, still write their cast like this. Take Katawa Shoujo (lit. ‘Cripple Girls’):

___ is one of the students at a school for the disabled. She suffers from ___ but wants to ___ in spite of this. Her ___ reveals her 'true beauty', and you help her with ___ so you can eventually get up in dem guts.

What these MadLibs designs lead to is a homogeneous cast. Everyone being of the same demographic leads to pigeonholed personality traits to set them apart. (The Japanese Otaku culture has a huge number of words to describe these personality tropes).

Even otherwise good games can fall victim to it. Persona 4’s main cast is all very similar in age, background, and role in the story – though that’s partially down to thematic reasons, and they are instead humanised by putting their insecurities at the forefront. ‘Tough, but Kind-on-the-inside’ Kanji isn’t an especially complex character, but the struggles he has with his sexuality are very human and identifiable.

It means that in the end, you’re asking people to empathise with an idea; a cluster of memes and implicated cues, rather than an honest attempt at making something human. Chicken Nuggets compared to an actual chicken. This works out okay in some situations – and for some people – but some stories just cannot be told effectively with a hollow or homogeneous cast.
The very best game casts have characters from all walks of life, so not only are they unique physically, but their experiences and world views are also in contrast. It can even help improve games that are otherwise lacking.
For example, take Lux-Pain for the DS. A Visual Novel, it wasn’t incredibly well-received due to haphazard mechanics ideas that don’t go anywhere, the cheesy premise of a high school-aged secret agent investigating mysterious goings on, and an absolutely god awful English translation. And yet, its wide and varied cast gave it some serious charm. You encounter students, teachers, shop keepers, even television personalities – and underneath the… unfortunate dialogue, there’s some simple but passionate backstory and character motivation.
Shunichi Inagaki is just your average nightclub owner – he's not even connected to the mystery Lux-Pain revolves around. But he's still appears, going about his daily business. As you talk to him, you find out about his family, his relationships with other members of the cast – and if you take the time to read the dossier files that slowly fill in as you play, he's rather ham-fistedly implied to be gay. Appreciated, though not artful. As friendly and relaxed as he is, not even Shunichi manages to escape the bad translation.
The translation team was apparently a group of around 10 in India. It shows.

Bioware’s Dragon Age and Mass Effect series get huge fan followings for their cast alone. In both the Grey Wardens and your interstellar crew, you are partnered with casts so diverse, they aren’t even all human. On a level, that feels like a slightly cheap way of adding cast diversity, but it does give scope to including perspectives that can’t be (safely) attributed to human culture.
The lack of diversity in video game casts is very much a social problem, and game designers limit themselves – or try to diversify and fail – for a few reasons. Maybe they’re not confident in writing characters of a demographic different to themselves. Maybe they don’t have the time and resources to design complicated casts (in which case they should probably manage their budget better). More likely, they’re fearful of what might happen if they don’t pander to the less-than-liberal consumer base that aren’t interested in characters that don’t fulfil their power- or sexual-fantasies. Or the TV Tropes crowd who can only process media that’s heavily compartmentalised.
The quality and diversity of a cast is only going to change significantly when social attitudes change, and the ETA relies heavily on your optimism.
Words, words, words (and actions): Dialogue style and variation
A problem that affects all media is dialogue diversity – it’s not uncommon to have a work where all the characters speak in a manner very similar to that of the writer. The writer knows how they sound, and so by writing in their own ‘voice’ as it were, it’s easy to write in a way that’s (superficially) convincing. But when too many characters sound similar, the suspension of disbelief falls apart, and no one sounds convincing.
In practice, this only really affects games without voice acting – with the dialogue voiced, characters will naturally vary linguistically (unless all characters are voiced by the same actor, but that would just be silly). So in a way, technological progress in game design has solved this one. But there are obviously still instances where games can’t afford – or just don’t need – voice acting, so bearing this in mind is still important. 9 Hours, 9 Persons, 9 Doors has a wonderfully varied cast – and a very good story in general – but due to the game’s philosophical (and pseudoscientific) themes, all the characters know a whole lot about prosopagnosia or Ice-9 for reasons not always explained, and sound very similar when discussing it.
Who would think that this lady had just explained 5 minutes worth of 'morphic resonance'?

Furthermore, it’s not just how a character speaks, but how often. It’s difficult to love a character who doesn’t communicate with you very often (not that it stops fans from writing smutty fanfiction about them, but still). ‘Communication’ need not require dialogue (an obligatory mention to Ico and Journey here), but even then, a limited range of expressions can leave conversations one-sided, and characters feeling flat.
A game could have a wide range of NPCs, and have them be story relevant, but if they say precious little, or worse, are prone to repeating the same thing often, then it drags you out of the experience; the grand play ruined by a cast member repeatedly yelling about mud crabs.
Catherine handles dialogue incredibly well. It has a lot of dialogue with characters that are incidental to the overall plot, and they continually change what they have to say over the course of the game. Obviously they have a limit, but the game sidesteps a situation where the player unintentionally causes dialogue to repeat by marking when a character has said all the useful information they have to offer.
Limited or repetitive dialogue is eased in many modern games by having dialogue trees in major conversations (which has definite flaws; I’ll elaborate in the second part). At the very least it ensures that the major characters don’t just exist to spout the minimum of dialogue to push the plot along, but it would be a total failure of pacing to employ this with every single character in a game, along with taking way too much effort to implement.
Okay, that covers the ground work. In the second part, I’ll be talking about AI as a concept, how it relates to the above, and where we can go from here.

Read on to Part 2.