Saturday 30 January 2021

Ultraviolet Grasslands and AI Dungeon, Part 2

I'm currently exploring AI Dungeon by Latitude games and working out how far it can be used to create stories and adventures set in a rich, complicated 'anti-canon' setting like Ultraviolet Grasslands (UVG) by Luka Rejec. In the first post, I gave a report on the results of my first attempts to feed the AI information from the UVG setting. The first post also defined some of the terminology that comes up in this post. I'd recommend this post from the Latitude dev team on the hidden vector algebra of how GPT-3 enables AI Dungeon to generate stories.

In my first attempts to create an AI Dungeon scenario set in the UVG, I used the blurbs on pages 6 and 9 of the UVG setting book as the Prompt. I summarised some basic information about the setting and put it into the Memory. I also created some World Info based on descriptions from the sourcebook, keyed to certain locations in the UVG setting such as the Violet city. After I got access to the more advanced 'Dragon' AI, I added an Author's Note to direct the AI about the theme and setting. It read:

This is a science fiction world, a psychedelic post-apocalyptic adventure set in the far future.

I was able to play through some interesting adventures, but a lot of the details of the setting tended to be wrong. There was also a lot of bleed-through or leakage: descriptions of one location would become associated with a different location. Browsing the AI Dungeon Discord server, this seems to be a common problem. The first thing I did was to alter some of the names from the setting so that they were more distinct. Emerald City, the Violet City, the Black City... AI Dungeon can't really cope with switching between discussions of them and so their attributes seem to get blurred together. Redland District risked being described as a district of the Violet City, where the adventure begins. So Emerald City became Gruneheim and Redland District became a Commune. Potsherd refers to ceramics, so the Potsherd Crater was getting mixed up with the Porcelain Citadel. I changed it to God-Eye Crater. Even though UVG is an 'anti-canon' setting, these un-canon modifications are not ideal.

I also moved to using a format for World Info entries created by Zaltys, one of the AI Dungeon users researching the GPT-3 powered system behind the adventure-generator. Violet City's entry ended up looking like this:

Violet City(City). TRAITS: Metropolis. SUMMARY: A decadent trade hub of cat-worshippers. LOCATION: Circle Sea coast. CITIZENS: Rainbowlanders, Cat Lords, Redlanders, Grunelanders, Violetlanders, Yellowlanders. APPEAR(Violet City): purple. FEATURES: Cats sacred, slavery(Bluelanders). RULER: Ailurophile Council. CULTURE: Decadent, cruel, hedonistic.

AI Dungeon seems to like to talk about the rulers of locations (maybe because its training set included RPG sourcebooks?), so I invented the 'Ailurophile Council'. I tried to turn Luka Rejec's evocative prose into neat, flashcard-style prompts. Obviously a lot is lost in translation, <500 characters is not a lot of space within which to summarise a several pages of RPG sourcebook, but that might be the price for consistency. Maybe. I might go back to prose descriptions in future. 

But Zaltys's format is worth testing, so I generated ten outputs for each of a set of inputs to see whether the AI could generate adventures that read like they are set in the UVG. Here's a list of some of the best and most interesting outputs, from a series of replications:

The road from Gruneheim runs straight as a spear to the gates of the Violet City. The road is cleanly swept and worn by the endless caravans that have passed to and fro between the cities of the North for centuries untold. The road is flanked by softly undulating grasslands, which are in turn bordered by gently sloping hills. To the West, the grassland grows thinner and gives way to sparse bushes and bare rocks.

Ahead of him, the road simply stops. It does not give way to a bigger road or a city gate. Rather, it is as if someone has taken a knife and hacked off the last few feet. The crumbling tarmac just stops, as if severed with a blade. Beyond that, the ground is dark and cracked. The land seems half-dead. A dark blue mist hangs over the earth, drifting through the air like smoke.

The city is a jumble of purple-painted wooden buildings, pierced and propped up with timbers. The streets are rough dirt, rutted and uneven. The City's temples are crowded with worshippers, littered with bright silks and rich furs. A caste of warrior-priests guard the city from the hostile worlds around it, each dedicated to a different deity.

The Violet City is a sprawl of winding streets and sudden plazas. Its buildings are of whitewashed clay, with tiled roofs of bright violet. The city is guarded by the Porcelain Guard, who are armed with glistening spears of fine-china. The city is circled by a high wall, broken by four gates. Each gate has a large letter over it, spelling out the word VIOLET.

The Violet City is ruled by the Ailurophile Council, who are all cat-worshippers. They are composed of the feline-obsessed and the greedy. The Ailurophile Council are ruled over by the Gods of Fel, a pantheon of decadent feline deities.

The citizens wear flowing robes, bright slashes of color against the dun-colored landscape. Their skin is dark and their hair raven black. They are a cheerful people, content in their pleasant city. They are ruled by the Council of Cats, a junta of aristocratic feline sorcerers who worship the Dark Goddess Bastet. The Council of Cats is cruel and arbitrary.

The city is named after its ruler, the Violet King. He is a cruel and capricious tyrant. The city is a lawless place where all manner of vice is encouraged. It is ruled by five criminal kings, known as the Council of Violets. They are in a state of cold war with the Violet King, as they wish to declare outright war on him and take his place.

The Violet City is ruled by the Council of Cats, an oligarchy of feline mystics who are served by a caste of slaves, the bluedwarves. The city is defended by a large standing army of bluedwarves and a magical order of wizards who manipulate quartz crystals. The city is a center for trade between the Redland Commune and the Circle Sea. You will find many things there."

The City is ruled by the Rainbow Lords. They are a decadent lot, ruled by pleasure, but not without their ancient cunning. They worship many gods: the Cat Lord, the God with the Third Eye, the Smiling One and many more. The rulers of the city are addicted to pleasures of the flesh, but their rule is just. They are not a warlike people, but they will defend their lands to the last drop of blood.

The Violet city is a beacon of civilization in a dark world. It is ruled by the Council of the Claw, wise and farsighted priests and mages who provide both spiritual guidance and leadership to the citizens. They also provide protection from raiders, mutants, and the occasional rogue golem.
You walk through the gates into the city.
The road from Gruneheim has ended. Your journey has just begun...
There are some contradictions with the 'canon' I defined in the World Info in these different descriptions of the city, but interesting ones. There's a bit of bleed-through, with the Porcelain Princes (who are based in a different location in the setting) cropping up as the guards of the Violet City. Those were some of the best replications, from about 50 I generated, here are some of the less impressive efforts:

Their skin is not purple. Their skin is the color of a pale human's skin. They have a variety of hair and eye colors. Some are tall and thin, some are short and fat, some are muscular, etc.

The citizens wear loose tunics, baggy pantaloons, and soft slippers. Their skin is dark blue. They wear their hair short and curly. Men and women alike share an obsession with beauty: they are meticulous about their clothing, coiffed hair, and manicured nails. They walk with a curious waddling gait. They are not tall, but are broad and squat like a tugboat.

The Redlanders are a race of men with red skin, wearing silk, wielding scimitars and repeater hand-bombs. The Yellowlanders are a race of men with yellow skin, wearing silk, wielding scimitars and repeater hand-bombs. The Grunelander men are a race of grunting, bearded men who wear leather armor and wield axes.

The Violet City is a sprawl of camps around a roadhouse. A lizard man makes an offering to his god, a small fire. A merchant from the Redland Commune haggles with a merchant from the Redland Commune over a gem. A lost soul looks for work. A guard dog sleeps in the shade of its master's caravan. A rainbow shield rests against a wagon wheel.

"The Violet City is a place of refuge and trade for the free people of the world. Be wary though, it is a place of many rules and regulations". He chuckles and continues "But then, what else would you expect from a place ruled by accountants?"
You nod solemnly and your companion laughs "But in all seriousness, there is much opportunity for one such as you in the city".

"It is the last bastion of civilization before the trackless wastes. It is ruled by the Red King, a powerful wizard who left the Violet City to its own devices for many centuries. In his absence, the city fell into decadence and debauchery. But he returned, and brought with him an army of the dead, now under his complete control. He uses them to enforce his rule."
Some of these outputs flatly contradict the World Info in a boring way, some are odd and repetitive, some are way off-script but actually interesting, some use similes involving tugboats. Still... I want to know what a repeater hand-bomb is.

There's a big potential for confirmation bias in testing AI Dungeon, so I tried to be a bit more rigorous and rate each of 10 replicates for the set of inputs. Here's what I found:

  • Continuing from the Prompt with no input: 3/10 outputs world-relevant, no problematic or contradictory outputs, no bleed-through.
  • Asking the AI for a detailed description of the Violet City: 5/10 outputs world-relevant, no problematic or contradictory outputs, 2/10 instances of bleed-through.
  • Asking the AI for a poetic description of the Violet City: 8/10 outputs world-relevant, 2/10 problematic or contradictory outputs, 1/10 instance of bleed-through.
  • Asking the AI for a detailed description of the Violet City's citizens: 8/10 outputs world-relevant, 3/10 problematic or contradictory outputs, no bleed-through.
  • Asking a character to "Tell me about the Violet City": 7/10 outputs world-relevant, 6/10 problematic or contradictory outputs, 1/10 instance of bleed-through.

Maybe the AI treats characters in a world as potentially unreliable? Maybe narrators are more authoritative in the training set (which probably doesn't include much Kazuo Ishiguro). 

Formatting of World Info is an art that advances by the week, so the entries I made for the people and places of the Ultraviolet Grasslands could definitely be improved. I'll report what I find in another blogpost along with some analysis of some of the strengths and limits of AI Dungeon. Any suggestions in the comments or on the UVG patreon Discord server gratefully received.

No comments:

Post a Comment

Ultraviolet Odyssey Part 12: The Tollmaster Harlequins

This is the twelfth part of a solo, narrative campaign within the   Ultraviolet Grasslands  RPG setting, created by   Luka Rejec . The text ...