Thursday, 28 January 2021

Ultraviolet Grasslands and AI Dungeon

AI Dungeon is a deep learning-powered text adventure created by Latitude. It utilises Open AI's GPT 3, which in my understanding is a very advanced predictive text model (an autoregressive logit model with a huge number of parameters). My understanding is that GPT 3 has been pre-trained, with Latitude subsequently training the AI that they use on chose your own adventure stories and fan fiction. Given a text prompt, AI Dungeon calculates what words would follow with maximum likelihood, then generates text probabilistically modified by the 'temperature' (randomness) the user has selected. Playing AI Dungeon feels somewhere between a writing collaborative story and playing a very open, but fairly loose, text-based adventure. 

Ultraviolet Grasslands and the Black City is an incredible roleplaying game setting created by Luca Rejec of Wizard Fighter Thief. It's a 'dying Earth' (post-post-apocalyptic) setting set in the distant future. The players lead a caravan across a series of strange locations between the Violet City and the Black City. The UVG sourcebook takes an 'anti-canon' approach: there is a surfeit of overlapping and contradictory information in the book about the world, it's peoples, locations, history and secrets. 

I thought that UVG and AI Dungeon might make a good match. AI Dungeon has a tendency to just make things up, it is not just limited to outputting the details of the world that the user or creator of a scenario has inputted. If a user has specified certain details of the world in which an adventure takes place, AI Dungeon might modify those details or combine them in ways that seem to be fairly novel - giving the impression of creativity. A related tendency of the AI is genre-breaking: fantasy elements in particular have a tendency to turn up in stories of almost any setting. As an anti-canon setting combining elements of science fiction, fantasy and the post-apocalypse, the UVG might be robust to the AI's use of creative license. 

To craft a scenario a player has four tools in the latest iteration of AI Dungeon. 1) The Prompt: the initial input of text. The AI tries to continue this directly. 2) Memory: general facts about the world to keep the AI broadly on track and within the boundaries of the story. 3) World Info: information similar to the memory that is triggered when key words are mentioned in the text input of the player or output of the AI. This can then result in the AI subsequently incorporating world-specific information into the discussion. 4) Author's Note: this is a short line of text that is inserted close to the most recent input. It is normally used to establish what genre, theme and writing style the AI should use. Certain key words seem to make a big difference, the AI has been trained on different writing styles or recognises some terms from Wiki pages about authors and novels.

In my first attempt to make a UVG scenario, I used a combination of the blurbs on pages 6 and 9 of the UVG sourcebook as the initial Prompt. I included some basic facts about the world in the Memory:

Rainbowlanders are humans. The Rainbowlanders have strange technology. The Rainbowlanders worship strange gods. The apocalypse happened long ago. Between the Violet City and the Black City are the Ultraviolet Grasslands. In the Violet City, people worship horned cats. There are no roads in the Ultraviolet Grasslands. Many caravans travel across the Ultraviolet Grasslands. At dawn, the sky is violet. At sundown, the sky is violet.

I also created some World Info, borrowing descriptions from the UVG sourcebook for certain locations and factions or making things up that I thought would help round out the world, such as caravan guards. 

The AI did not have all that much to go on and interpreted what it did have fairly loosely. But maybe because Luca Rejec's prose is so evocative, the AI gave some reasonably interesting descriptions of the adventure my character set out on, although obviously only a fraction of the UVG style made it through. Here are some edited excerpts from the first adventure (italics my inputs):

You're a Caravan Guard for the Crimson Talons, a merchant guild that controls all trade in the western reaches of the continent. Most of your work is protecting valuable caravans from raiders and beasts.

You look at the people, vomes and packbeasts loitering round the gates to the Violet City. You relive the old days in your head. "Days when the Grasslands seemed wide open to me" you think. You miss the open plains, the long horizons, the freedom of riding wherever you wanted to go, chasing nomads and racing across the fields with the wind in your hair and the grass under your horse's hooves. Now you're stuck guarding caravans from bored bandits.

“I'm looking for information. It's a long time since I've been to the Violet City, what's it like?"

The vome begins his sales pitch. "The city is a thriving metropolis. The jewel of the continent. It's a place where people can go to seek their fortune, or simply to watch the never ending stream of entertainers, artists and gladiators.”

You interject with a question: "Does it still have all the cats? Last time I was there people were going crazy over them."

"It does", the vome replies. "The city is infested with them. The ruling class, the Felinists, all worship cats."

The AI picked up on a few of the features of the world, such as that the ruling class of the Violet City are cat-worshippers, referring to them as 'Felinists', which is an improvisation.  Although I've edited it, the story was pretty coherent. A murder of a guild member led me to a cat-worshipping group of priests within the city. Not bad. But the AI handled 'vomes' poorly, even though I tried to establish that they are aggressive, corrupted biomechanical replicators in the World Info. Here's a fairly long excerpt from another adventure, which I have edited a fair bit to cut out extraneous chat and leave behind what was interesting:

The wind blows through your hair, carrying with it the scents of grass and stone, the campfire smoke, the dry tang of gun oil, the sweat of camels, the incense from temple-caravans, the cloying perfumes of decadent nobles, and the stink of slaves.

You look towards the rising sun. The road ahead leads past the ruins of an ancient city, built by men who once ruled this land. A great wall surrounds it now. It was destroyed centuries ago when the Rainbowlanders invaded.

You walk up to a group of mercenaries guarding a caravan outside the gates of the Violet City. They mill about, many of their fellows standing watch on the walls, but they look with interest as you. It is clear they recognize you, a caravan guard from a far-off land.

You look at the weapons the mercenaries are holding. They are flintlocks, old-fashioned weapons, but frightening in their power. They are holding them loosely, but you know that if they saw the enemy, they would be able to kill many times over.

Two of the guards are standing to attention, holding dagger-axes. Their armor is studded with gemstones: amethysts and jades and diamonds. The guards are staring at you expectantly, waiting for you to move on.

You address the guards "Is the caravan looking for another adventurer?"

"Yes, yes! We're looking for a hero, someone to lead us to the Black City!" one of the guards says eagerly. "We want you to take our offer." another guard says.

"Okay, take me to the Caravan Master" you say. You turn, and walk back towards the Caravan Master's tent. The guards salute you, but do not question you. They know your duty. "I am Aleph. I was told you were looking for an adventurer" you say to the Caravan Master.

You see a man, swathed in a black cloak. His face is visible only down to the nose, where a half-mask is worn. A pair of small spectacles is perched on his forehead. He replies  "That is correct. Are you a hero?"

"No. I am but one adventurer" you say truthfully.

"Ah. Well that will have to do" replies the Caravan Master. "You may need to do some heroics to save the caravan."

"Yes, the road to the Black City is very dangerous" you say and nod.

"The Black City, the seat of the Dark Order, is not a place that can be approached without reason" the Caravan Master continues. You nod again, indicating that you understand. 

"Where is our first destination?" you ask.

"The town of Twenty-Three, near the border between the Black City and the Gloom."

It's an adventure!

You shake his hand. "It's an honor, sir" you tell him. "But what trade goods are we carrying to the Black City?" you ask.

The Caravan master laughs. "We're not selling any. We're just transporting a gift to the Black King. He's the one you need to speak to, not me" 

Some wonky text, some generic frontier-adventure stuff, and some filler I edited out, but some interesting evocative images that riff loosely on the UVG. In this run I was sold a cursed broken mirror that induced a fatal sickness in anyone who gazed into it... which seems pretty on-theme. 

These early runs mostly used the more limited 'Griffin' version of the AI. In the next post, I'll report on trial-and-error experiments using the more powerful 'Dragon' version of the AI along with more precise directions about the UVG as a setting.

2 comments:

  1. Looking forward to hearing what happens next!

    ReplyDelete
    Replies
    1. Thanks! I've been playing around with the scenario-generating features of AI Dungeon, but I'll carry on with this adventure when I next get a chance.

      Delete

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 ...