Casual Procgen Text Tools

Last Thursday I was at at the PCG-meets-autotesting unconference at Falmouth, which organized into a bunch of work-groups to talk through ideas related to the conference theme. This was a really fun time, and I am grateful to the organizers and my fellow guests for making it so intriguing.

Our morning work-group started with a suggestion I had: what if there were a casual text-generation tool like Tracery, but that provided a similar level of help in assembling corpora for leaf-level node expansion? What would help new users learn about selecting and acquiring a corpus? What would help them refine to the point where they had something they were happy with using? (And for that matter, are there applications of this that we could see being useful to expert users as well? What could such a tool offer that is currently difficult to do?)

This idea sprang from some of my own discovery that I spend a lot of my own procgen development time simply on selecting and revising corpora. What will productively add to the feel and experience of a particular work, and what should be excluded? How small or large do the corpora need to be? Is there behavior that I can’t enforce at the grammar level and therefore have to implement through the nature of the corpus itself? (I talk a bit about those concerns during my PROCJAM talk (video, slides), especially under the Beeswax category.)

We had a great conversation with Gabriella Barros, Mike Cook, Adam Summerville, and Michael Mateas. The discussion ranged to cover a number of additional possibilities, some of which went considerably beyond the initial “naive user” brief here.

Continue reading “Casual Procgen Text Tools”

Bowls of Oatmeal and Text Generation

In a comment on my recent post on text generation, Dryman wrote

I was wondering if you’d been following some of the recent games criticism discussing where procedural content has ultimately failed to be very interesting or engaging (in games such as Spore or No Man’s Sky), and might have some general thoughts about how procedurally generated text content can potentially be made to resonate more strongly than was the case for the largely graphical reskins in those games. Much of the discussion has focused on what Kate Compton has called the problem of “procedural oatmeal” – i.e. it is very easy to pour 10,000 bowls of plain oatmeal, with each oat being in a different position and each bowl essentially unique, but it is very hard to make these differences *matter* to an audience, and be perceived as truly different in any memorable or thought-provoking way.

(“Some of the recent games criticism” also includes this article from Mike Cook on changing how we talk about procedural generation.)

In response to which, I partly want to point to Bruno Dias’ recent Roguelike Celebration talk, which addresses exactly this point: that procedural generation is not a way to get large amounts of content from small amounts of input, and that procedural generation requires an appropriate design approach.

But to speak for myself: I think the key question in oatmeal-avoidance is whether the generation is connected to anything mechanical. I might be able to generate haiku, or funny food names, or imaginary constellations, or names of funny English-sounding towns, but all that generation is purely decorative unless it is tightly correlated with gameplay — and the player will soon realize that it is decorative and start looking past it.

But what kind of mechanical connection is required? It would be a lot to ask that every procedurally generated variant needed to correspond to different gameplay affordances — that procgen is only interesting if having 10K output states means 10K different verbs or verb clusters or play strategies that could be unlocked.

That’s a very demanding design problem. It’s not completely inconceivable to have elements that work together to generate fresh mechanics: Dominion‘s longevity comes from the fact that the cards play off one another in really interesting ways and make each other useful (or not useful) quite quickly: Peddler might be pointless in a game without +Action and +Buy cards, but in a game with a good action/buy engine and, say, Bishop, it might become a massive source of victory points. There are entire blogs devoted to pointing out productive Dominion card combos and strategies. But that’s a challenge in mechanics design, and if every application of procgen text had to be that mechanically rich, we wouldn’t need it very often.

But there are other applications as well, happily. In The Mary Jane of Tomorrow I wanted pretty much everything the robot said to serve as a reminder of her current training state: it acts as both status information and as a perceivable consequence of what the player has done with her. Show her a book about cowgirls, and she’ll start speaking in a funny accent. Teach her about botany, and suddenly she’ll get really specific about the types of apple she can bake in an apple pie.

Procgen methods are great for this kind of low-levellayered consequence: representing how the player has changed the world state persistently in a small way, rather than massively in a way that forked the narrative.

Continue reading “Bowls of Oatmeal and Text Generation”

Visualizing Procgen Text, Part Two

In a previous post (now several months ago — sorry!) I wrote about visualization strategies for looking at procedurally generated text from The Mary Jane of Tomorrow and determining whether the procedural generation was being used to best effect.

There, I proposed looking at salience (how many aspects of the world model are reflected by this text?), variety (how many options are there to fill this particular slot?) and distribution of varying sections (which parts of a sentence are being looked up elsewhere?)

It’s probably worth having a look back at that post for context if you’re interested in this one, because there’s quite a lot of explanation there which I won’t try to duplicate here. But I’ve taken many of the examples from that post and run them through a Processing script that does the following things:

Underline text that has been expanded from a grammar token.

Underlining is not the prettiest thing, but the intent here is to expose the template-screen-shot-2016-09-11-at-4-45-52-pmstructure of the text. The phrase “diced spam pie” is the result of expanding four layers of grammar tokens; in the last iteration, the Diced Spam is generated by one token that generates meat types, and the Pie by another token that generates types of dish.

This method also draws attention to cases where the chunks of composition are too large or are inconsistent in size, as in the case of the generated limericks for this game:

screen-shot-2016-09-11-at-4-45-28-pm

Though various factors (limerick topic, chosen rhyme scheme) have to be considered in selecting each line, the lines themselves don’t have room for a great deal of variation, and are likely to seem conspicuously same-y after a fairly short period of time. The first line of text locks in the choice of surrounding rhyme, which is part of why the later lines have to operate within a much smaller possibility space.

screen-shot-2016-09-11-at-4-45-36-pmIncrease the font size of text if it is more salient. Here the words “canard” and “braised” appear only because we’re matching a number of different tags in the world model: the character is able to cook, and she’s acquainted with French. By contrast, the phrase “this week” is randomized and does not depend on any world model features in order to appear, so even though there are some variants that could have been slotted in, the particular choice of text is not especially a better fit than another other piece of text.

This particular example came out pretty ugly and looks like bad web-ad text even if you don’t read the actual content. I think that’s not coincidental.

screen-shot-2016-09-11-at-4-45-59-pmColor the font to reflect how much variation was possible. Specifically, what this does is increase the red component of a piece of text to maximum; then the green component; and then the blue component. The input is the log of the number of possible variant texts that were available to be slotted into that position.

This was the trickiest rule to get to where I wanted it. I wanted to suggest that both very high-variance and very low-variance phrases were less juicy than phrases with a moderate number of plausible substitutions. That meant picking a scheme in which low-variance phrases would be very dark red or black; the desirable medium-variance phrases are brighter red or orange; and high-variance phrases turn grey or white.

Here “wordless” and “lusty” are adjectives chosen randomly from a huge adjective list, with no tags connecting them to the model world. As a result, even though there are a lot of possibilities, they’re likely not to resonate much with the reader; they’ll feel obviously just random after a little while. (In the same way, in the Braised Butterflied Canard example above, the word “seraphic” is highly randomized.)

Finally, here’s the visualization result I got for the piece of generated text I liked best in that initial analysis:

screen-shot-2016-09-11-at-4-45-44-pm

We see that this text is more uniform in size and color than most of the others, that the whole thing has a fair degree of salience, and that special substitution words occur about as often as stressed words might in a poem.

*screen-shot-2016-09-11-at-5-25-03-pm

There’s another evaluative criterion we don’t get from this strategy, namely the ability to visualize the whole expansion space implicit in a single grammar token.

Continue reading “Visualizing Procgen Text, Part Two”

Worldsmith (Ade McT/interactive fables)

Screen Shot 2016-08-21 at 6.21.43 PM.png

Worldsmith belongs to a category that is still pretty rare, even in this age of growing opportunities for commercial IF: it’s for-sale parser IF. A demo is available for free, but the full version is $5.99. Not only that, but the author has collaborated with furkle (of SPY INTRIGUE fame) to skin an Inform 7 game with images, video, hyperlinks and custom menus. The surrounding images help communicate status information, with images of the NPCs you’re conversing with, and/or the planet you’re currently constructing.

Then there’s the gameplay. Worldsmith is heavy on both simulation and procedural text; I’ve seen a lot of authors start work that made ambitious use of those, but very few actually finish something of that scope and complexity.

The essential premise is that you are a world-builder in competition with several other world-builders (a very high-powered version of the Great British Bake-Off, perhaps). In order to do this, you must combine fundamental elements such as Air and Fire to make planets; set the planets in chosen orbits in your pet solar system; seed those planets with life; and then nurture the life to a degree of sentience that will survive in the wider universe and be able to leave its home planet before said planet becomes uninhabitable.

So far as I’ve seen, this is very much a systems game rather than a puzzle game. There is loads of information to learn about how various elements combine and what sorts of creatures they are likely to produce. Though you get a tutorial (a rather exasperated encounter with your teacher, who evidently feels that you really should have mastered the elements of world-construction by now), there’s a dizzying amount to retain, and you’ll likely find yourself reviewing your instruction manual quite a lot.

I haven’t managed to win. On the contrary, I’ve made a series of half-baked planets and seeded unsuccessful life on them, and needed to restart several times. (It turns out that if you teach your lifeforms too much too quickly, they’ll probably just destroy themselves, so slow up, Prometheus.) But I feel like I’m learning, so this is good restarting, rather than the bad frustrating restarting when a puzzle game has gone unwinnable.

In response to the decisions you make, your world is formed with differently described land forms, creatures, and technologies. It’s probably the closest thing to Spore-in-text-form that I’ve seen.

Still, eventually I realized that if I wanted to blog about this piece, I was going to have to go against my usual preference and write it up without having played the whole thing. So that’s a big caveat. I have some things to point out about Worldsmith but I have not seen anything near all of it, and certainly not most of its storyline.

Continue reading “Worldsmith (Ade McT/interactive fables)”

Visualizing Procgen Text

Lately I’ve been aggressively telling everyone I know to do more visualization of the systems they’re building, and thinking about what that might mean for the procedural text experiments I’ve been up to.

If you’ve played with The Mary Jane of Tomorrow, you’ve probably noticed that some of the poems it generates show a lot more variation and richness than others. That’s easy to observe, but can we quantify it? Can we draw observations about what level of complexity is the most satisfying, and identify portions of the game where more or less complexity would improve the experience? If we’re procedural text artists, how do we decide where to direct our attention?

One of the fun/horrifying things about this particular medium is that it pretty much never feels like you’re done: it would always be possible to add more corpora and more variant templates. Both Mary Jane and Annals of the Parrigues came to an end because I needed to move on to other work, not because I couldn’t think of anything further to add. But one thing I might want from a procgen text tool is help discerning where the biggest blank spots are currently.

The first step towards visualization is of course figuring out what aspects of the system you might want to look at, and in fact I often find “how would I draw a picture of this?” to be a good way of making myself think about the salient qualities of a particular system. Here are the things I decided I wanted to know about the text in Mary Jane:

Size of component phrases: how long is the smallest atom of text in a given composition? When you see something in the text, was that produced by a human or is it the juxtaposition of several pieces selected algorithmically? This is very varied in Mary Jane, with some poems or conversation options picking entire sentences, and other selections being just a word or two long. (Parrigues goes even further and composites town names from constituent syllables, but Mary Jane isn’t going that far.)

Number of alternatives: if a phrase was picked from a list, how many other options were there? Number of options is going to determine how unique a particular element is in your experience of the text.

Salience of selected phrase: why did we pick this piece? How many pieces of information about the world model did it have to match in order to be selected? (And to combine those two points, if we picked a highly salient phrase, how many other options were there of equal salience?)

Continue reading “Visualizing Procgen Text”

ProcJam Entries, NaNoGenMo, and my Generated Generation Guidebook

ProcJam happened last month, pulling together lots of different awesome things:

 

Screen Shot 2015-11-26 at 3.47.25 PM

A procedural château generator (or perhaps you’d prefer a procedural Palladian façade generator). A Twitter bot that tweets about odd clothing combos.

Ordovician generates strange sea-creatures that swim across your screen:

Screen Shot 2015-11-26 at 4.37.57 PM

But I was most fascinated by the pieces that do procedural work with words. K Chapelier’s Stochastèmes generates new words based on the poetic corpora (such as thurweedlesoe when I picked Wordsworth, and woulders).

baladescreenshot

Balade is Windows-only, so I wasn’t able to play it, but the screenshots give a sense of the French cityscapes it generates through words: you can choose streets to travel and receive small descriptions of these places.

Paradise Generator uses random text combinations to suggest a variety of possible paradises: a fairly light level of procedural generation, but using some well-selected components. At least, my first couple of paradises were quite interesting.

Servitude plays a bit more like a traditional game, though it claims there are various randomized elements.

Or there’s Mainframe, a procedurally generated horror game by Liz England and Jurie Horneman. I didn’t manage to win it (maybe I just didn’t persist long enough; I’m not quite sure), but it combines the body horror and malevolent AI themes I associate with a lot of Liz’s stuff. (Maybe unfairly? Yes, maybe unfairly.)

*

Meanwhile, ProcJam was not the only place for a bit of procedural generation this month. NaNoGenMo was the full-month press to procedurally create 50,000 words – 50,000 words of anything, not necessarily guaranteed to make sense.

Carolyn VanEseltine used Markov techniques and a ChoiceScript grammar to make an interactive generated novel, complete with choices, chapters, and stats.

Nick Montfort created a generated poem about consumerist impulses, one that offers us 126 pages of possible purchases such as “a subtle indigo topcoat that is exclusively available here” or “an understated navy thong that is significantly reduced in price”.

Kevan.org created a work based on Around the World in 80 Days mashed up with information from Wikipedia, which produces many many paragraphs like this:

Moving on, we arrived at London South Bank University. If I remembered correctly, this was founded in 1892 as the Borough Polytechnic Institute. Passepartout asked me if it was chosen to be clerk to the Governing Body, but I did not know. Passepartout examined the training and demonstrating Centre for Efficient and Renewable Energy in Buildings (CEREB). Passepartout explained how it had been designed to include two Thames barges set above a pentagon surrounded by five other pentagons. We moved on, disappointed by stricter student visa requirements in the United Kingdom.

The full repository of other creations can be found at the NaNoGenMo 2015 site, coordinated by Darius Kazemi.

*

Exploring the resources associated with NaNoGenMo and ProcJam brought me to this forum on generative text, and from there this video by Kenneth Goldsmith on conceptual writing, which gives an above-average explanation of what’s interesting about procedural writing in its own right.

*

Not really part of either of those things, Caelyn Sandel and Carolyn VanEseltine have a game idea generator that randomly combines concepts they’ve had for their works into new concepts. And of course Juhana Leinonen’s IF Name Generator is a classic, but it has been newly updated with name lists from IF Comp 2015 to remix those titles.

*

So. I thought about doing NaNoGenMo or ProcJam or somehow sort of doing both. ProcJam is so open-ended with its “make a thing that makes things” concept that almost anything could probably be construed to be a part of that project. And I’ve also got several procedural text game projects that have been knocking around unfinished for ages. What I ultimately wound up doing was sort of related but in fact none of the above.

Parrigues1The Annals of the Parrigues (warning! PDF!) is a (mostly) procedurally generated guidebook to a fictional pseudo-English kingdom, along with a making-of commentary on the process of generation. There are also some portions of the code (though I’m not releasing the whole source at this point, and indeed it wouldn’t really be meaningful to do so, as you’ll see if you look at the thing). It’s not an interactive piece of fiction at all, though it was built with various tools including Inform. Rather, it’s a story I wrote with the machine. If you want to know where to find the biggest library in the kingdom, what type of meal to avoid at the Fenugreek and Sponge, or why people keep trying to assassinate the Duchess of Inglefunt, this one’s for you.

 

Parrigues2