Saturday, 16 April 2022

“and a miniature three-handed sword” - d30 AI encounters

I couldn't resist getting GPT-3 to spit out a bunch more random encounters. I used the same examples as last time to teach the machine what I wanted, and here's what it came out with. There are certain tropes and stereotypes emerging here, but also occasional stunningly original ideas. Enjoy!

noisms and the Hall of the Third Blue Wizard

I interviewed noisms, who blogs as Monsters and Manuals, publishes noisms games, and is best known for his fantasy game setting Yoon Suin, the Purple Land. Right now he'a running a Kickstarter for The Corridor of the Seventh Green Magic User  The Hall of the Third Blue Wizard, a zine featuring high-quality commissioned RPG modules and short stories. Although I fucking hate acronyms, for sanity's sake I'm sure I'll be referring to it as THOTTBW or THotTBW or THot3W by the end of this post, however dirty that makes me feel.

Here are audio and video versions of the interview, and below them are a summary of what we talked about with LOTS of notes and links and other good stuff.

Wednesday, 13 April 2022

Gespenwald, Cairn, and the NSR

Firstly, I have a new thing out. It's called Gespenwald, comes in the form of a PDF (printable as a double-sided A4 trifold), and can be downloaded here. I will have printed copies available in a couple of months.

It kicks off with a children's rhyme:

On Narren Night, my love and me
We met beside the Gespen tree
We kissed and counted, one, two, three,
And turned, and touched the Gespen tree

The Gespen Tree, the Gespen Tree
Her elbows wrapped around her knee
As old as bone and stone is she
The Gespen Tree, the Gespen Tree

In Gespenwald, around the tree
We spent the night, my love and me
Until the sun returned and he
Left me alone, beside the tree

Oh Gespen Tree, oh Gespen Tree
Return my stolen love to me
Next Narren night, please set him free
Oh Gespen Tree, oh Gespen Tree

Gespenwald is a freeform adventure written for the Forests of Another Name jam. Although it's written for the game Cairn, it can easily be played with Into the Odd and its derivatives; or adapted for other games; or even, like my previous publication Mostly Harmless Meetings, read as a piece of Oulipian fantasy fiction.

I thought I'd use the release of this new piece of writing as an opportunity to talk a little about Cairn, a game which many people won't be familiar with, and, via Cairn, to talk about the "NSR" community.

Monday, 11 April 2022

Yakanory and the dark fiction of James Burt

 The first review of Mostly Harmless Meetings is in, and interestingly it looks at it not from a gaming perspective, but as a work of literature: "a sort of Borgesian/Oulippian take on British rural folklore". I like that! Admittedly I've not read any Borges (I've just ordered a copy of Labyrinths, and I'm told that he also wrote a monster manual), and the closes I got to Oulipo was Georges Perec's Life, A User's Manual, which I've managed to abandon twice, because I can only take so many lists (here's an idea: a random stuff-in-the-attic generator, for 20th century horror games, based on Perec's lists; a sort of "Life, A User's Tables"). You can read the review, by my friend James Burt, here.

I have recently been reading, and been very impressed by, James's own work: dark, weird, sometimes horrific short stories. His story A Disease of Books impressed me so much that I resurrected a project I started during the first COVID lockdown: Yakanory. Basically me reading stuff aloud, this started with me reading Dr Seuss tales to friends' kids over Facebook Live, then briefly took on a bit of a life of its own. My reading of A Disease of Books is below, and I've put quite a few other readings up on YouTube and plan to do more soon. You can generally tell how manic I was at the time of recording by what I'm wearing (and I always was a little manic, otherwise I don't think I'd have had the courage to do something like this).

You can buy more of James's stories for dirt cheap over on Etsy, read his blog and follow him on Twitter. But first, are you sitting comfortably? Then I'll begin...

Monday, 4 April 2022

Generating random content for RPGs using Artificial Intelligence

Sea-biscuit cutting and rolling machine

The topic of Artificial Intelligence in TTRPGs (actually Machine Learning - but I'll call it AI for simplicity's sake) is something I've seen discussed a lot recently. noisms asked on his blog whether AI would change the hobby. On the NSR Discord server we've had AI-generated failed careers for Electric Bastionland posted by Chris McDowall, and some Cairn sparks from Yochai Gal, plus an ongoing discussion on how AI can be used in RPGs.

Machine Learning is something I've wanted to tinker with for a while now. I've been put off by lack of a powerful enough PC, a loathing of the Python programming language, and general laziness. Meanwhile I've poured hundreds of hours' hacking into my Deity Galaxy twitter bot, using Tracery and nested lists (a little like Perchance) to generate text which is... rarely satisfactory. I plan to publish a book of "nanodeities" based on curated output from Deity Galaxy (I wrote about this a while ago). But before doing so, I will  have to spend a lot of time sharpening up the bot's output.

A couple of weeks ago my friend, the horror writer James Burt, came to visit. We had a wonderful walk around the hills about Allenheads where, among many other things, we talked about my nanodeities plans. James has written previously about using AI as a writing partner, and our shared acquaintance Shardcore published what may be the world's first AI-written book, "The Future is Already Here" by Algohiggs (a computerised riff on the book The Future Starts Here by John Higgs which, BTW, is a fabulous book; if everyone read it then the world would be a better place). James suggested that I try generating deities using AI and the GPT engines.

So that's what I've done. I used the OpenAI Playground to paste in some prompt text (which you'll find at the end of this post) and was blown away with the results:

Mallus, deity of the abandoned sock, is a small, slightly furry creature, not dissimilar to a ferret, that can be found in the laundry basket of most homes. Mallus is a mischievous god, and often delights in hiding one sock of a pair, or tangling up clothes that have just been ironed. To please Mallus, leave a sock out on the floor for him to play with.

Kerfuffle, goddess of tangled wires, is best worshipped by knotting together at least 7 different electrical cables, and then throwing them into a puddle. The resulting sparks will be a sign of Kerfuffle's favour. Kerfuffle herself is a small, spiky sphere, not unlike a hedgehog made of barbed wire.

Snorfle is the god of hiccups. Snorfle is an amorphous blob of green slime with a single eye in the center. To worship Snorfle, drink a pint of milk and then try to hiccup. If you are successful, Snorfle will grant you a wish, provided that wish is related to hiccups.

Schnarf is the god of electronic bleeps and bloops, and can be found in most electronic devices, especially those with a lot of buttons. Schnarf is especially fond of mobile phones, and can often be found lurking in the background when someone is taking a selfie. To worship Schnarf, simply take a selfie with a mobile phone and then offer it up to the god.

Those were all written by a computer! Wow. OK, that got my attention.

Suddenly I'm thinking of all sorts of uses for GPT-3 powered text generation. Tables of random content are a Big Deal in TTRPG-land, people can't seem to get enough of them (witness the wonderful d4 Caltrops). Right out of the box, GPT-3 understands these tables. When I asked it to "write a table of random encounters for a fantasy TTRPG", here is what it came up with:

10 believable but rather vanilla possible random encounters

As an aside, something which initially appears surprising is that this output includes the gaming-specific term "2d6". One of the great things about GPT-3 (in comparison with its more readily-available predecessor GPT-2) is that it was trained on a mind-boggling number of web pages, undoubtedly including many gaming blogs (and probably a sizeable number of random encounter tables). It is really great at understanding context, and using the relevant domain-specific language in its output. It can even write computer code, given just a very simple prompt:

To get improved random encounters, I started writing ("crafting"?) prompts to seed the AI-generated list. i.e. I started to write the sort of encounters that I would like to read. This took many iterations and, as you'll see from the prompts at the end of this post, required adding a huge amount of spice to the seed text in order to get encounters that didn't sound too generic.

Here is what the AI came up with when I tasked it with creating some random wilderness encounters (I had to hit "submit" several times to collect all of these examples):

* A small village of mud-huts is in the process of being slowly buried by an encroaching sand-dune. The villagers are in a state of panic. A quick check will reveal that the sand is being controlled by an evil sorcerer, who lives in a crumbling manor-house in the centre of the village, surrounded by a low moat. The sorcerer’s name is Hamza Omri, and he is a wicked man. In his basement, he possesses d6 bottles of a potion which, when drunk, will transform the drinker into a sand-dune. These potions are worth 100GP each, and Omri is willing to sell them. The sorcerer also possesses a magical amulet, which will allow the wearer to control any sand-dune within 100 miles. Omri is very reluctant to sell this, but will do so if offered d1000GP.

* A group of d6 pixies flutter down from the trees, laughing and playing. They carry with them a large number of brightly-coloured flowers, which they offer to the PCs. If the PCs accept the flowers, they will find that they are unable to move from the spot. The pixies will then proceed to strip the PCs of their clothes and possessions, and will fly away, laughing. The flowers are actually poisonous, and will cause the PCs to become paralyzed for d6 hours.

* A large group of d6+12 unicorns approaches, led by a magnificent white stallion. The unicorns are on their way to a magical spring, where they will drink the water and be transformed into Pegasus. The stallion is the only one who knows the location of the spring, and he is very reluctant to reveal it. However, if the PCs can convince him that they are worthy, he may show them the way. The spring is located in a hidden valley, guarded by a ferocious dragon. The dragon will allow the PCs to pass if they can answer three riddles.

* A small campsite, in which a fire is burning and a pot is bubbling. Sitting around the fire are 2d4 humanoids, with the heads of eagles. They wear colourful feathers and have beaks made of gold. These are the Aaracockra, a race of bird-people. They are friendly, and will share their food (a stew made of insects and small rodents) with the PCs. They will also give the PCs 2d4 feathers, which can be used as currency in some cultures, or as quills for writing.  
* A d4-1 skunk-like animals are chasing a small golden-furred creature with a long tail. This creature is a “chai”, a small, intelligent, furry creature who is being hunted by the skunks, who are known as “chai-hunters”. These chai-hunters are attracted to the chai’s fur, which is used to line cloaks and blankets. If the PCs help the chai escape the chai-hunters, the chai will invite them back to its village, where they will be welcomed with a feast and a chai-fur-lined cloak.
* 3d20 flying bats, each with a wingspan of around 9 feet, descend from the twilight sky, circling around the PCs, hissing and squawking. These are not ordinary bats. They are “shrieking bats”, which can emit a loud shriek which can be heard up to 5 miles away. This shriek can be used to warn other animals of danger, or to call for help. The bats will only attack if provoked. If the PCs capture one of the bats, they will find that its fur can be sold for 5GP.
* A column of luminous green slime slides across the ground towards the PCs, slowing as it nears them. This is a “slime-beast”, a predatory creature which feeds on small animals. If the PCs do not move out of the way, the slime-beast will envelop them, and begin to digest them. The slime-beast can be killed by fire, or by being frozen solid. If killed, the slime-beast will leave behind a sticky green residue which can be used as a glue.
* A large, slow-moving, armoured creature, resembling a cross between a turtle and a snail, emerges from a nearby pond. This is a “turtle-snail”, a harmless creature which is often hunted for its meat. The turtle-snail’s meat is tough and stringy, but can be roasted and eaten. The turtle-snail’s shell can be used as a bowl, or as a shield.

* A pink elephant-like creature, with trunk outstretched and a gleaming white tusk. It is covered in dozens of colourful umbrellas, hanging from its sides like leaves. The elephant is the reincarnation of a local rain god, and the umbrellas are his “holy symbols”. He is friendly and curious, and will follow the PCs around, trundling along behind them. He is also very clumsy, and has a habit of knocking over small trees and stepping on things. If the PCs give him a basket of fruit, he will be overjoyed, and will bestow upon them a magical blessing: for the next 24 hours, they will be able to breathe underwater.

* 2d6+6 very tall (around 12 feet) humanoids, with ashen grey skin and long white hair. They are wearing simple white tunics, and each carries a large wooden staff. These are the ash-walkers, guardians of the forest of Ashes. They are friendly, but will not allow the PCs to enter the forest of Ashes, as it is a sacred place. If the PCs are persistent, the ash-walkers will tell them a story: “Once, long ago, there was a great kingdom, whose people were just and good. But the king was corrupted by power, and he became a tyrant. His people rebelled, and the kingdom was destroyed in the ensuing war. The forest of Ashes is all that remains of that kingdom. It is a place of sadness and loss, but also of hope. For one day, the ash-walkers believe, the kingdom will be reborn, and its people will be just and good once again.” 

Well. That's rather interesting. There's still a clear tendency for these encounters to revert to something rather more generic than the examples I've fed them, and there are inconsistencies which need tidying-up and details which need filling-in. But I'd say that these encounters are at least as creative as 75% of the equivalent human-written content out there.

I'm really tempted to keep fiddling with this and creating more encounters, but OpenAI Playground costs money (I'm still well within my $18 initial free credit, but I have lots of uses I want to put that remaining credit towards). 

In the future I'm sure we will see more and more AI replacing (or at least providing an increasingly-used alternative to) old-school tables. The key, as ever, is the seed text, and so there will still be a need for humans to craft texts which lead to interesting results from the AI. Unlike with tables though, a single set of well-written prompts can generate pretty much unlimited outputs forever more. So it may not be true to say that we will need good writers as much as ever. We may only ever need them once.

The other thing that this type of AI is great for - and which I intend to explore a lot more over the coming months - is providing inspiration and feedback for human-written text. This might operate in a similar way to existing writing partnerships, allowing ideas to be bounced back and forth and refined before the human partner settles on a final revision. Also a great way for breaking out of writer's block!

Below are the hand-written prompts I put into the OpenAI playground to generate the texts above. To generate your own encounters, sign up for an account at OpenAI, then head to the playground and paste in the second list below (or write your own prompts). I'd be really interested to hear of any good results that it comes up with - please write them in the comments below.