Hannah and The Twelve-Disk Tower of Hanoi (2014)

I’ve been talking about context a lot lately, for good reason: it often is the thing that introduces the essential order that makes good procedural generation come to life.

When generating stories, there have been a lot of attempts to codify the structure of storytelling, based on fairy tales, templates of betrayal, modeling the needs and knowledge of the characters, and so on. Sometimes these approaches produce interesting results. But that is not the only way to give a story structure.

Many other processes have patterns that look somewhat like the pattern of a story: Chess has an opening, rising action, and climax, fitting Freytag’s pyramid rather well but being different each time. 

Remember, while mimicking a natural process is one way to do procedural generation, it is far from the only way. Following the principle of using unusual input and outputs in our procedural generation machines, there are a whole host of other processes that we can use to structure our stories.

Sean Barrett’s 2014 NaNoGenMo entry Hannah and The Twelve-Disk Tower of Hanoi  illustrates this perfectly. While it is a bit dry as literature, it demonstrates how a non-narrative process can be transformed into a plot. 

AI researchers have spent a lot of time experimenting with things like psychological models for characters, which is great. But if you’re a writer or designer you shouldn’t let your inability to write a human-like AI stop you from generating interactive stories. Ultimately, as long as the result feels right you can use nearly anything to procedurally generate something else.

https://github.com/nothings/nanogenmo/tree/master/2014






Boids

At SIGGRAPH ‘87, Craig Reynolds demonstrated a new computer model of animal motion that he called boids. Using just three simple rules, he discovered that the result was a lifelike simulation of flocks of creatures, coordinating their movements.

From Craig Reynold’s page on boids.

These three steering behaviors, while individually simple, combine to produce complex movements, simulating flocks of birds, herds of sheep, or schools of fish. 

Boids were frequently referenced as an example of artificial life. Rather than trying to simulate an artificial intelligence, they merely recreate some of the patterns followed by living organisms.

They are also an example of procedural animation, animation created through processes rather than created by hand or motion-captured. While boids are hardly the only example of procedural animation, they were one of the more widely known inspirations, seeing use in many films such as 1992′s Batman Returns. Many 3D applications include boid behaviors, or have plugins that do so, and the original Lisp source code is available on Craig Reynold’s site, along with links to other implementations.

Boids are frequently implemented as demonstrations of various graphical libraries and systems, such as this implementation in Processing, with source code.

Boids are an excellent example of how simple building blocks can create complex behaviors. They also suggest ways that procedural generation can operate over time, not just as a static thing created at the start of a level: what if your generation continues as the player interacts with it? Contrariwise, can you apply flocking to your level generator, using the end result of the flocking to inform another generative process? And, of course, procedural animation and artificial life are fascinating fields in and of themselves; subjects we’ll definitely hear more about around here.

Reynolds, C. W. (1987) "Flocks, Herds, and Schools: A Distributed Behavioral Model", in Computer Graphics, 21(4), pages 25-34. 

Early boids test:

The film from SIGGRAPH 1987:








Tides (2015)

Tides is a WebGL real-time music video created by the artist @dotminic at petitsapin.com and featuring music by Bronze Whale.

Music videos are, of course, a ripe medium for showcasing procedural generation, since the music can add context in a poetic form, as opposed to the more difficult prose of incorporating generative elements into narrative forms.

http://petitsapin.com/webgl/tides/



Good question! Really, it depends on what skills you already have. I’ve posted a couple tutorials to the blog, but without much regard to skill level. I’ll almost inevitably be posting more in the future.

Last year, the Procedural Generation Jam had a big list of tutorials: http://procjam.tumblr.com/post/99689402659/procedural-generation-tutorials-getting-started That’s a great starting point.

If you don’t have much programming experience, it might be worth prototyping some systems on paper, with dice, cards, or other tools. These can be useful in themselves, and it is good practice for the kind of thinking that’s behind all procedural generation.

Lastly, I want to encourage you to just dive in. Procedural generation is always going to be experimental because it revolves around finding unexpected ways to combine different parts to get new results. Start with something that makes something, even if it is a really simple something, and keep finding new ways to tweak it and combine it until you’ve discovered something new and unique to you.

Anyone else have any suggestions for good tutorials?








The Elder Scrolls: Arena (1994)

Which game lets you visit the provinces of Morrowind and Skyrim? And Hammerfell, Elsweyr, and all of the other provinces on the Elder Scrolls continent of Tamriel. Why, it’s the very first Elder Scrolls game, The Elder Scrolls: Arena!

The vast land area is, of course, only possible via the magic of procedural generation. While parts of the game (such as the main quest dungeons and the basic city layouts) are fixed content, much of the rest of the game (such as shop names, sidequests, other dungeon layouts, NPCs you meet in the street, and so on) are procedurally generated.

image

Whiterun looks a bit different, five hundred years before Skyrim.

You can, in theory, walk from town to town, asking the locals where the nearest dungeon is, but this quickly highlights the weakness of the game: though the world is vast, the generator isn’t quite sophisticated enough to differentiate it and you’ll end up using fast travel quite a bit to skip to the next interesting place. There’s not enough context to keep the different places separate in your head. Still, for 1994 this is quite a lot of content, and you’ll likely only see a tiny fraction of it.

image

Randomly generated dungeon, partially explored.

The dungeons can be a bit sparse, with more dead ends than treasure. It can also occasionally be clever, when the water canals, pits, secret doors, and other hazards combine in interesting ways.

One thing that helps overcome the weaknesses in the generator is that you can acquire very powerful spells and tools that let you create and remove walls, levitate over pits, let you absorb magic, and just generally let you turn the glitchy nature of the game against itself.

(Arena, due to its troubled production, also started that other Elder Scrolls tradition of lots of bugs. The currently available version has patched the worst ones, but it’s still not perfect.)

Bethesda released Arena for free online a while back, so you can go download it from the official site: http://www.elderscrolls.com/arena/






Aggressive Passive (2013)

If you’ve ever had annoying roommates or passive-aggressive family members, you might relate to this novel.

It tells the story of a group of roommates who share a house but hate doing chores. What follows is an extended tale of relationships characterized by indirect hostility, as in all the best novels.

As you might have guessed, Aaron Reed, rather than writing this novel himself, has written a generator to write one for him, which I can’t help but interpret as being the most passive-aggressive way there possibly is to complain about your roommates.

You can read the novel and generate your own version at: http://aaronareed.net/if/NaNoGenMo13/sample.html




Eyeo 2014 - Darius Kazemi

Darius Kazemi, Internet Person, gave this presentation last year about his bots and creative process. He talks about exploring black boxes, discussing how code is weird, the problem with elegance, how to make less boring procedural generation, Spelunky, the importance of context,

Context, in particular, is an important idea. Darius discusses how a generator goes from flat and boring to interesting by adding context to templates and random input.

Context is a succinct way to discuss something I’ve been dancing around here: that the generator is much stronger when there’s an idea behind it. That’s why I’ve talked about controlled chaos and the need for structure: these are both ways to think about giving more context to the things you are generating.




Frontier: Elite II (1993)

The sequel to Elite had an ambitious goal: to simulate the entire, real-world Milky Way galaxy. Including the ability to land on millions of procedurally generated planets. While still fitting on a single floppy disk.

In the original Elite, each system had exactly one star, one planet, and one space station, and the variation in the procedural generation was focused on the economy and the system’s position in relation to other systems. Frontier: Elite II tries to simulate as much of then-known astrophysics as possible, with binary star systems, exoplanets, and so on (but, alas, no black holes).

It also included many real-world stars, with procedurally generated planets and realistic distances. This made Proxima Centauri something of a pain to get to, since it is 0.23 or so lightyears from Alpha Centauri A and B.

The sector-based procedural generation system did have its limits, including some repeating sectors due to flaws in the way galactic density is hashed into the generator. The galaxy is also mostly treated as flat with stars that rise above and below the plane, which messes with the positioning of real-world stars. 

Still, the intended limits of the travelling range mean that most of the flaws weren’t discovered until years later. That they were discovered at all is more a testament to the dedication of the playerbase to a game they couldn’t quite find a replacement for.

(Because I can’t find my copy at the moment, the video is via https://www.youtube.com/watch?v=XP0Wfn9_nnc and courtesy of CuteFloor.wordpress.com who have a ton of videos archiving videogaming history.)




The Zelda Dungeon Generator

Becky Lavender’s dissertation project is generative-grammar dungeon generator for Zelda-style games.

Like any good research project, there’s a wealth of references to other attempts to generate Zelda puzzle dungeons, as well as other research, so this is an excellent starting point if you want to dive deep into dungeon generation of any sort. 

But she doesn’t stop there: she built the Zelda Dungeon Generator based on her research, solving a lot of practical problems along the way. It generates a mission graph and a map shape using generative grammars, with the goal of producing a dungeon that has greater Context than a more typical chaotic dungeon generator.

http://www.beckylavender.co.uk/the-zelda-dungeon-generator.html




StyleNet

This is apparently the year for neural networks in algorithmic art. A week or so ago, Leon Gatys, Alexander Ecker, and Matthias Bethge posted a research paper entitled ‘A Neural Algorithm of Artistic Style’.

Alex J. Champandard used the technique to produce the video above. He has also set up a twitter bot that will take your photos and translate them into the style of famous paintings. There is, of course, also a twitter #StyleNet hashtag for other people’s experiments.

There are already multiple implementations with source code available on Github, by JC Johnson, Brandon Amos (crossed with DeepDream), Kai Sheng Tai, Anders Boesen Lindbo Larsen, and Eben Olson.

At this point, the exploration of the artistic applications of StyleNet are still in the very early days. Some of the painting transformations are astonishingly effective, while others are less so. But they’re conceptually centered around relatively straightforward uses for the algorithm. There’s a lot of space for software artists to take this as a starting point and springboard into some totally unexpected applications.

(video via https://www.youtube.com/watch?v=56CoHGxRg7c)