Sleeping Dragon 

Sleeping Dragon is a generative music program created by Ross Fish. It creates ongoing, non-repetitive ambient music.

Because the human mind latches onto patterns, having music that doesn’t repeat can be useful, especially for ambient music, which often gets employed as a background mood-setter, or as a white noise substitute. Thus, a program that generates an endless variety of ambient music can have practical uses, as well as being pleasant to listen to.









nucl.ai Livestream

The nucl.ai conference is going on right now, and after a hiccup at the start the live stream is available. I couldn’t make it to Vienna, and it started in the middle of night for me, but I’ve been dipping into the livestream and absorbing the discussion.

Today’s track that interests me is the Dynamic Dialog & Storytelling, though there’s a lot of interesting AI topics being discussed. Tomorrow has a bunch of Procedural Content Generation talks, and day #3 has Generative Systems & Design.






Ancient Domains of Mystery

ADOM is one of the big five roguelikes of the Usenet era, and even back then it stood out as something a bit different. 

While the other games were open-source and developed by teams, ADOM has always been the personal project of Thomas Biskup. It has a mostly-fixed overworld, populated by a series of different (sometimes wildly different) dungeons. 

Since it’s been in development for over twenty years at this point, it’s dense with features. It’s got dungeon plants that grow according to Conway’s Game of Life. Key skills include food preservation, literacy, and bridge building. There’s a key to wipe your face, and you may find yourself needing it. 

image

ADOM has more story than most roguelikes, with lots of quests and special locations with their own rules for dungeon generation…

image

…though good luck asking people about it when you’re a corrupted Chaos Knight with tentacles instead of a mouth.

The main quest is to deal with the source of Chaos that’s somewhere deep beneath the mountain range, but there’s dozens of different dungeons to explore. The overworld-with-different-dungeons design allows the game to explore a lot of different approaches to generating levels. Many of the places are semi-optional, giving players a way to manage their own risk. A few interesting ones:

- The cave where monster generation is scaled to the player’s experience level, so it’s easy-ish a low levels and nearly impossible at high levels…and there’s a second dungeon that can only be accessed by passing through the cave.

- Most of the dungeons are persistent, and stay the same once generated. The exception is the optional “infinite dungeon” which will generate a new level each time you use the stairs.

- The Tower of Eternal Flames uses the usual generation rules, but adds the twist that the environment is very, very hot and requires the player to take precautions against the heat.

This combination of a mostly-fixed overall progression and a highly variable emergent experience has given ADOM some dedicated fans. Many roguelikes have similar structures, though ADOM takes it much further than most, with the gradual discovery of the fixed quests being an important part of learning the game.

And, of course, there’s the depth that twenty years of development can bring. Rather than making everything procedural and unpredictable, ADOM takes advantage of the structure of the fixed features. That’s why cats are significant, deciding whether to get the water-proof blanket is a strategic choice, beeswax is occasionally vital, and rescuing the small dog is a challenge.

image

Most of the large-scale variation is instead found in the characters themselves. Summoners play very differently from Elementalists. The relatively sophisticated inventory model includes details like not being able to put on or take off rings if you’re wearing gloves–which can, of course, be cursed so you can’t remove them–and similar nuances. With skills, talents, a star sign, and a procedurally generated backstory, each character is unique.

The graphics were originally all in the traditional ASCII character mode, but a tile-based mode has been added since the return to active development a few years ago. 

Like other roguelikes of the Usenet era, ADOM was freely downloadable, but the developer requested that players send him a postcard. He’s still getting them, and has apparently got quite a collection now.

These days, development of ADOM is supported by the Deluxe version, which is available on Steam and has a number of additional features (including a non-permadeath mode), though the Classic postcard-supported version is still available.




A Neural Network Playground

Neural networks have been discussed a lot around here, but do you know how they work? 

Well, one of the best ways to learn something is to play around with a version of it that lets you visualize what’s going on under the hood. Daniel Smilkov and Shan Carter built this visualizer that lets you do just that. 

Hit the play button and you’ll see the neural network try to classify the dots based on whether they’re positive or negative. You can use different data features, add layers and neurons, and try different data sets to see what results you get. A neural network that works for one kind of data doesn’t necessarily work so well on a different arrangement, so even with the rapid feedback it can be tricky to find the best settings. 

Incidentally, the flexibility of generative processes is one of the things I like about the topic in general. Play is an effective way to learn how something works, and being able to see what each individual neuron is outputting makes it much easier to grasp what is going on under the hood.




Fractal Algorithmic Music

One reason that generative music always gets my attention is that, due to my limited musical skills, it’s pretty easy to get music that sounds better than I could compose myself. That doesn’t mean that generative music is easy, though: assembling it often takes a knowledge of music theory that’s pretty advanced. Jarring noise can be physically painful in ways that visual art seldom is.

This particular example of generative music, by Steve Gilliland, takes advantage of the mathematical relationships in music. The pitches are generated with fractal algorithms, via FractMus 2000. It’s up to the composer to translate that into a finished piece. Helpfully, FractMus 2000 also outputs a generative video based on the music, which not only gives and additional way to explore the composition but was also repurposed as source material for this video.

(via https://www.youtube.com/watch?v=6VZq7EurckI)




ConvChain

From the same source as last week’s texture synthesis, here’s a level design approach that uses a Markov chain Monte Carlo simulation to generate level maps.

We’ve encountered Markov Chain Monte Carlo simulations before, though not always under that name. A Markov chain is a sequence of variables, where the probability of moving to the next state depends only on the current state. The “Monte Carlo" part just means that it’s an algorithm that uses random sampling, in reference to the casino in Monaco. The idea is that the state of the Markov Chain will match the desired distribution after a certain number of steps.

You can see this in action in the video: the algorithm takes a sample image or level as input and builds a cellular automata that is most likely to generate that image. It’s a kind of reverse engineering generator that learns the goal and tries to emulate it. 

The other interesting thing here is that a level can be treated as an image, or an image as a level. This is an important principle to remember for procedural generation, and why I keep harping on unusual inputs: everything in the computer is just data and code, and you can often use data interchangeably, even if it wasn’t originally designed for that. 

Therefore, you can do things like take image filters such as blurring, sharpening, convolution, high-pass filter, distortion, tone-mapping and so on, and apply them to your tile-based level generator.

Which is actually how I originally became aware of ConvChain: the overworld map you can see in the video is made up of tiles sampled from a world map created via Neural Doodle.

Amit Patel of Red Blob Games made an online web-demo and the original code is on GitHub: http://github.com/mxgmn/ConvChain

(via https://www.youtube.com/watch?v=fxWEn2jpJ6I)









868-HACK

868-HACK is a minimalist roguelike with a cyberspace theme. The 6x6 board distills the basics of the genre into bite-sized bits.

I was given the game by one of the top players; judging by my current dismal high-score the skill required to score at that level is really impressive. Even playing casually, learning enough to get to the end of eight levels was a pleasantly challenging progression. I’m not going to explain anything about the rules, because they’re just different enough from the norm that teasing out what is going on is part of the fun I had.

What I will tale about is the procedural generation. The game’s space is small, but dense. There are only 36 tiles on each level, but each tile is potentially significant. Combine that with the relationships with neighboring tiles being important, the different movement rules for the monsters, the spell-like functions that you can run if you can afford the cost, and the subtleties of the scoring system, and it demonstrates that you don’t need an infinitely large game map to make good use of procedural generation.




Texture Synthesis

I was working on a post about this approach to texture synthesis when ExUtumno posted this video and saved me the trouble of trying to describe it. Based on P. F. Harrison’s PhD dissertation, the algorithm fills in pixels in a random order, using a best-fit search to find close matches from the example source texture. This turns out to work particularly well for synthesizing pixel art.

ExUtumno has been working on texture synthesis for a while now, in part for eventual use in the in-development RPG, ITER IN IGNOTUM. Some of the previous code is on GitHub, in the SynTex repository.

I think it’s an excellent example of how new artistic tools can empower artists and let them create more art. There’s a version of this algorithm available in a plugin for GIMP if you’d like to try playing with it yourself.

(via https://www.youtube.com/watch?v=8sUMBMpZNzk)




Deepdream + Densecap

Gene Kogan combined a Deepdream hallucination with an image-recognition-and-captioning algorithm so we can get labels for what the computer thinks that it sees. 

Since Deepdream image generation is like looking for shapes in clouds, the results tend to be full of bizarre juxtapositions. (And, in this case, the computer is obsessed with dogs.) While the two algorithms don’t line up exactly, the captions give a hint at the things that the other half of the process thinks it sees.

Gene points out that while these particular competing neural networks are humorous, they demonstrate misunderstandings that could be troubling in more serious applications. (Indeed, the current law-enforcement facial recognition systems likely have racial-biases due to the limitations of their training data.)

The European Union has been taking steps toward the concept of “right to explanation”, the idea that you should be able to have an explanation of how an algorithm evaluated you. As far as I’ve seen, AI researchers are generally positive about the idea: they want to know why things work too, after all. Perhaps someday soon, you’ll see an evaluation of your information similar to the Densecap video. Hopefully it’ll be more accurate.







Machiavelli (Merchant Prince series) 

The second game in the Merchant Prince series is Machiavelli. (Confusingly, the third game is Merchant Prince II.) In it, you play a merchant of Venice, sending out ships and caravans to trade between cities and explore to find new markets.

While the game could be played with a randomly generated map, that’s not the innovative feature. You see, the game shows you the entire world map at the start. Only, it’s wrong. Similar to historical maps of the period, the map is a guess as to what is out there, a here-be-dragons version of the world you’re about to explore. The map is pretty accurate close to the starting city of Venice and becomes more distorted and inaccurate the further you travel.

This is a fascinating feature for a couple of reasons: first, it better reflects historical exploration, where the places unvisited by Europeans had a history and place of their own. The merchant ships you send out in the game aren’t travelling into black fog, they’re chasing legends, rumors, and best guesses. Rumors of legendary lands are visually depicted. 

Second, and more generally, it gives the player more context for the world they are exploring. This is useful for a historical map, but its transformative for a generated map. The player can suddenly make informed decisions about where to explore.

Giving context like this lets the player learn about the world at their own pace. Instead of presenting the player with overwhelming detail, as world generators are apt to do, you can introduce concepts gradually. The player starts with a vague understanding of the layout of the world and can fill in the details piece by piece. It gives a systemic hierarchy to the information, in the same way that a visual hierarchy guides a viewer from the most important elements to the less important details.

And, because the map is wrong, it doesn’t detract from the sense of exploration. Does that island on the map really exist? Is there an undiscovered land just over the horizon? Is that legendary city really out there somewhere?

image

As you can see, the coast of Africa isn’t where the map said it was…

I assume the other games in the series also had this feature, but Machiavelli is the one I own.