Unconstant Conjunction latest posts

Expressing L-systems in Rust

I thought I’d jump on the Rust blogging bandwagon. Specifically, I’ve been toying with a new library to define and iterate over L-systems in a unique and Rust-inspired fashion. It’s been very rewarding to fool around with a type system so foreign to my roots in duck- and weakly-typed languages.

If you haven’t heard of L-systems before, they’re mostly used to make pretty pictures. I was able to create a little animation of the first seven iterations of an L-system that draws Penrose tiles (below).

Penrose Tile L-system

L-systems have put them to a variety of different uses, including modelling plants and trees, buildings and cities, and all manner of interesting geometric constructions. They hold their fascination in part because of the way in which a very small number of basic components and rules can evolve in startling ways over time. In other words, L-systems put emergence on display.

Continue Reading →

Using More Interesting Random Values in Procedural Content

This post is an inquiry into some of the drawbacks with using the random() function to generate all your random values, and discusses the circumstances in which the Beta distribution might prove a compelling alternative. It is written with procedural games in mind, there is no expectation that the reader know what a ‘distribution’ is, and all of the code examples are written in Python.

Continue Reading →

An Update on the Libnoise Wrapper

NoisyPy Perlin Demo

I’ve gotten a good chunk of the Libnoise wrapper working. And despite several sessions of head-against-wall bugs, my SIP and disutils setup seems to be working nicely. Some of the C++ code in noiseutils.h (which comes with the Libnoise examples) is quite outdated, so I wrote several of my own output functions in pure C++. This also gave me the opportunity to write exporters to OpenGL textures, which seem to work seamlessly with Pyglet. I should have a whole directory of examples up and running shortly, drawing from the standard Libnoise examples and as well as demonstrations of OpenGL textures.

Continue Reading →

Building Libnoise on OS X

    29 September 2013 // tagged

Although it is very old (and unmaintained since 2007), Libnoise is a great library for procedural generation of pseudorandom noise. It provides a wonderfully intuitive way of chaining together various layers and styles of noise that I’ve never seen matched, even in newer implementations. It also supports seeds (which I require), and is largely feature-complete. I’ve used some of the Java and XNA ports in the past, but in the last few days started getting interested in using the original C++ code, partly because I’m wondering if it can be converted into a Python extension.

Continue Reading →