All Posts

The Grokalow

Fiction

One day, the grokalow crawled out of the swamp. “It looks like a gargantuan alligator”, cried a bystander, as it approached. “Nay, it is a brobdingnagian crocodile”, countered a second, as the grokalow licked its leathery lips. “Without a clear definition, we cannot conclude this thing is a threat”, surmised the third, settling the matter. […]

Editable WFC

Advanced Tutorial

When I spoke about autotiling, I briefly touched on how it’s possible to use Wave Function Collapse (or other constraint based generators) as a form of autotiling, i.e. user-directed editing of tilemaps. I’ve usually referred to this technique as “editable WFC“. It’s a combination of autotiling and WFC, and contains the best of both: Being […]

Chiseled Paths Revisited

Intermediate Project

Back in 2017, I described a method of random path generation called Chiseling. It gives very nice wiggly paths, but I was never satisifed with the performance. I later revisited it, and found a faster algorithm, but it was a bit complicated to implement. I’m pleased to say that I think I’ve finally found a […]

Resolving Ambiguities in Marching Squares

Intermediate Tutorial

One issue with 2d Marching Cubes (i.e. Marching Squres) that I glossed over in my original tutorial is the issue of ambiguity. Later I talk about how dual contouring avoids this problem. But it turns out there’s actually a well known, but little documented way of resolving those ambiguities called the Asymptotic Decider, which I’ll […]

2d Marching Cubes with Multiple Colors

Intermediate Tutorial

2d Marching cubes (sometimes called marching squares) is a way of drawing a contour around an area. Alternatively, you can think of it as a drawing a dividing line between two different areas. The areas are determined by a boolean or signed number value on each vertex of a grid: But what if we didn’t […]

Varia 1.0 released

Project

Announcing Varia, a new Unity asset for adding small random variations into your games. Spice up your levels, remix your gameplay, and make your assets go further for you. It’s FREE! Get it here

Classification of Tilesets

Intermediate Tutorial

Many years ago I started looking at different sorts of tiles sets used by artists. A good tile set is flexible enough to allow tiles to be re-used in a lot of situation, but simple enough that the tiles can be easily created. Ideally, it would enable autotiling or otherwise be easy to design levels […]

Infinite Modifying in Blocks

Intermediate Project

I’m going to share with you a technique I’ve found for doing lazy, reliable, deterministic, constant-time infinite generation of tile based levels using Wave Function Collapse (WFC). But first, let’s cover some background, Modifying in Blocks, and lazy chunk based infinite generation.

Constraint-Based Tile Generators

Intermediate Tutorial

Last article, we were comparing WaveFunctionCollapse (WFC), and Model Synthesis (MS). These are both similar procedural generation techniques that work along similar lines. Specifically, they generate a grid of tiles (or pixels), using a set of hard constraints, and some generalized solver technique to find a solution, a set of tiles that satisfies all the […]

Model Synthesis and Modifying in Blocks

Beginner Tutorial

I’ve written a lot about Wave Function Collapse. Developed in 2016 by Maxim Gumin, it’s an algorithm for generating tilemaps and pixel textures based on the constraint solving with extra randomization . But did you know most of the key ideas come from a paper written a full decade earlier? Today, we’ll be looking into […]

Beyond Basic Autotiling

Intermediate Tutorial

Autotiling is a system for automatically picking which tile to place on the map, based on user input. It’s a fast way to design levels without having to fiddle with every tile indivually to ensure they are all consistent. Autotiling becoming increasingly well supported by game engines. While there’s not a great deal of standardization […]

Advanced Table Constraints

Advanced Tutorial

Previously we considered the Arc Consistency 3 and Arc Consistency 4 algorithms, which are an essential component of many constraint solvers. I’ve been using AC-4 myself for some time, and I naturally got curious as to what other improvements can be made. Diving it, I discovered there is a huge amount of papers with new […]

Arc Consistency Explained

Beginner Tutorial

I’ve been doing a lot of experiments with WaveFunctionCollapse, which as we’ve covered before, is essentially a constraint solver turned into a procedural generator. The underlying solver WaveFunctionCollapse came with is called Arc Consistency 3, or AC-3 for short. But AC-3 is actually one of a whole family of Arc Consistency algorithms. Today, my solver […]

Recursive Subdivision Variants

Beginner Tutorial

You are probably familiar with Recursive Subdivision – also known as Binary Space Partitioning – as a procedural generation technique. Like all the best proc gen, it’s a simple idea, that produces complex output. I’m here to discuss some variants that others have used to produce interesting results.

Tessera: A Practical System for Extended WaveFunctionCollapse

Advanced Project Uncategorized

I’ve been working a lot on Tessera. I presented a paper at the most recent PCG Workshop of FDG, where I explain how Tessera makes WaveFunctionCollapse somewhat less daunting, and go into some of the details of its features. That may not be news for users of the software, but here I explain how things […]

Using Unity’s TextGenerator.verts

Uncategorized

TextGenerator.verts is meant to give the position information of every character in a given string. This is useful in Unity if you need to align something with exactly where some particular text is occuring, if for some reason you are not already using TextMeshPro. Older Unity versions created 4 verts for every character, which made […]

Junkbot Arena

Project

I entered the GMTK Jam again. This year, I was in a larger team, working together on the theme Joined Together. You can play it on itch.io.

Driven WaveFunctionCollapse

Intermediate Tutorial

WaveFunctionCollapse (WFC) is a procedural generation technique for creating images and tile-based levels. I’ve discussed it many times before. As a technique, it has some pros and cons. Pro: it’s almost uncannilly good at stitching together tilesets into interesting arrangements, and is pretty good at copying the style in a supplied sample image. Cons: it […]

Some Triangle Grid Extensions

Intermediate Tutorial

Following my article on triangle grids, I’ve been doing a lot more thinking about periodic grids. Here’s three neat things.

Triangle Grids

Beginner Tutorial

Ah, the triangle grid. Square grids are virtually ubiquitous, laying out out everything from the pixels in an image to houses in a city block. The hex grid has a decent showing too, particularly in board games. But triangle grids – regular tilings of the 2d plane with equilateral triangles – just don’t seem popular. […]

Dungeon Generation in Unexplored

Intermediate Level Generation

It’s rare that you see a game that gives top billing in its marketing to the quality of its procedurally generated levels. Normally PCG is sprinkled in a game to add a bit of variety, or to make up for the lack of actual level design. But, for 2017’s Unexplored, the rest of the game […]

PhantomGrammar and Ludoscope

Intermediate Level Generation

Last time, I took inspiration from a game called Unexplored, and wrote about about a system of rule evaluation called Graph Rewriting. In developing Unexplored and earlier games and academic papers, developer Joris Dormans has over the years developed an entire software library centered around graph rewriting. It’s called PhantomGrammar, and it comes with an […]

Graph Rewriting for Procedural Level Generation

Intermediate Level Generation

I’ve been doing this series on how games do level generation for some time, and I have a complete beauty for you. I’ve spent a lot of time deconstructing Unexplored, a 2017 indie game by Joris Dormans. It just nails procedurally generated zelda-like dungeons, and I had to know for myself how the magic happens. […]

Lock and Key Dungeons

Beginner Tutorial

Lock and key dungeons are, well, video game levels with locks preventing progress, and collectable keys that let you proceed. The concept is a lot broader than it sounds. Locks/keys aren’t necessary physical objects, but anything that works in a similar way, which can often be quite abstract. Once you are familiar with the pattern, […]

Compressed Sparse Fibers Explained

Advanced Tutorial

I was browsing the Apache Arrow docs and spotted a term unfamiliar to me. Intrguied, I discovered that Compressed Sparse Fibers are a new technique for representing sparse tensors in memory. After reading up a bit, I thought I’d share with you what I’ve learnt. The technique is so new (well, 2015..) it is not […]

New Discord Server

Uncategorized

Let’s face it, running your own WordPress blog is a sign you are woefully out of date. I can see plenty of readers, but never hear from them. So I’ve created a Discord server. Feel free to log on and ask me support questions about my projects, suggest new article ideas, or just to hang […]

For Keep’s Sake! Explained

Intermediate Level Generation

I recent entered make a game for PROCJAM 2020. As I was making it purely to fun (there’s no winners to the competition), I focussed thing to make something that expanded my skills and was technically impressive. As such, there’s lots of interesting techniques that I felt were worth briefly explaning here.

For Keep’s Sake!

Project

I did another game jam. This time, I made For Keep’s Sake!, for PROCJAM 2020. It’s not really a game, it’s just a toy procedural thing / tech demo. Still, I had fun making it and I hope you enjoy.

Dungeon Generation in Binding of Isaac

Beginner Level Generation

The Binding of Isaac, and its remake, Binding Of Isaac: Rebirth are one of my favourite games of all time. It’s a roguelite twin stick shooter, much like Enter the Gungeon. The dungeons it generates are particularly iconic. I’ve seen countless tutorials online offering how to do Isaac-like generation, but I was interested in how […]

Lucky Fluke Post Mortem

Uncategorized

I recently made a game in 48 hours, Lucky Fluke. Though technically I’ve done game jams before, I’ve not done one in a decade, and not ever as successfully. So I thought I’d write up what I learnt.

Lucky Fluke

Project

This year I decided to enter the 48 hour GMTK Jam. I teamed up with the excellent Praeto and jhicks to make a little shooter based on the theme: Out of Control You can play it on itch.io.

Level Generation in SLIGE (Doom level generator)

Intermediate Level Generation

It’s time for another in my series on how games do level generation. Let’s take a look at SLIGE, a random level generator for Doom. The original Doom. That’s right, we’re going back to the early 90s for this one. Doom was one of the first games designed from the ground up to friendly to […]

Wave Function Collapse Explained

Beginner Tutorial

A simple guide to constraint solving Since developing DeBroglie and Tessera, I’ve had a lot of requests to explain what it is, how it works. The generation can often seem quite magical, but actually the rules underlying it are quite simple. So, what is the Wave Function Collapse algorithm (WFC)? Well, it’s an algorithm developed […]

Dungeon generation with pathing

Wave Function Collapse tips and tricks

Intermediate Tutorial

I’ve been experimenting a lot with constraint-based procedural generation these days. Specifically the Wave Function Collapse algorithm (WFC). I’ve even made my own open source library, and unity asset. WFC is a very flexible algorithm, particularly with the enhancements I’ve designed, but at the same time, I’ve found it’s quite hard to actually get it […]

Tessera Pro Released

Project

Due to demand, I’ve now released Tessera Pro, an upgraded version of Tessera which comes with source code and some extra features. Hopefully with more features to come. I’m really pleased with how the project has been recieved so far, and am hoping to see some awesome games made with it. Check it out on […]

Messing with Unity’s GUIDs

Tutorial

I recently released an addon in the Unity asset store. It’s actually two addons: Tessera Pro is a fully featured copy, with complete source code, and Tessera which has cut down features, and you just get a precompiled .dll. I quickly discovered a big problem – if you upgrade from Tessera to Tessera Pro, then […]

Tessera 3d tile level generation

Project

After a lot of work, I’ve prepared my first ever commercial release. It’s an addon for Unity that lets you procedurally generate levels and other things based on a simple tile setup.

Dungeon Generation in Enter The Gungeon

Intermediate Level Generation

I’ve been playing a lot of Enter The Gungeon recently. It’s a great, brutally hard, twin stick bullet hell that reminded me a lot of Binding of Isaac. But as I’ve been playing it more and more, I realized that the dungeon design actually shows some subtle genius. There are many procedural generators out there […]

Dungeon Generation in Diablo 1

Intermediate Level Generation

Diablo1 is a classic 1996 hack and slash rogue-like. several fans took it upon themselves to reverse-engineer the source code. I began a week long deep dive into how exactly did lead developer, David Brevik, actually craft these levels. It may have taken away some of the magic of the game, but I learnt lots of techniques I think are applicable to anyone developing a similar game, which I share with you below.

DeBroglie v0.1

Project

Introducting my latest project, DeBroglie. DeBroglie is a C# library and Windows command line application implementing the Wave Function Collapse algorithm with support for additional non-local constraints, and other useful features. Wave Function Collapse (WFC) is an constraint-based algorithm for which takes a small input image or tilemap and procedurally generating a larger image in […]

Barycentric Perlin Noise

Advanced Project

Perlin noise is a classic procedural texture. It gives a wavy grayscale image, that has all sorts of uses in computer graphics. Commonly, it’s used to blend two textures together. But what if you want to blend three or more textures together? Well today I have the answer.

Random Paths via Chiseling

Advanced Project

I went over a previous project to randomly generate paths between points and came up with a much more efficient and versitile algorithm. (EDIT: In 2022 I found an even better way.) The algorithm is simple. Start with the entire area covered in path tiles, then and remove tiles one by one until only a […]

Dual Contouring Tutorial

Beginner Tutorial

How to create a sharp mesh from a function without even trying In part 1 and part 2 of the series, we looked at the Marching Cubes algorithm, and how it can turn any function into a grid based mesh. In this article we’ll look at some of the shortcomings and how we can do […]

Marching Cubes 3d Tutorial

Beginner Tutorial

In the first article I showed how the Marching Cubes algorithm works in 2d. In this tutorial, I cover how it can be extended to 3d.

Marching Cubes Tutorial

Beginner Tutorial

In Minecraft, you can dig in any direction – removing a block at a time with well defined edges. But other games manage to destruct terrain smoothly, without all the blockiness of Minecraft. The following tutorial in Marching Cubes, a technique for achieving destructible terrain, and more generally, creating a smooth boundary mesh to something […]

Celtic Knots 1.0 – Now with Twills

Project

I’ve just released a new update for an old blender addon, bumping the version to 1.0. The addon can now generate a much wider variety. Check it out on github.

Random Path Algorithm

Uncategorized

Quick follow up to my previous post, I found the same technique is pretty good at generating organic looking random paths. You simply start with an empty room, and keep randomly filling points until it is no longer possible to add any more without disconnecting the room. What’s left is a nicely wiggly pathway.

Fast Traversal Queries of Procedurally Generated Rooms

Uncategorized

I’ve been playing around with procedural generation recently, and one question has repeatedly been nagging at me. How can you randomly spice up a level while making sure you don’t accidentally block off the exit? Jump to the code, the live demo.

Blue Noise Particles

Project

I’ve released a plugin generates a random arrangement of particles with a blue noise distribution. This is also known as Poisson Disk Sampling. This distribution of particles guarantees no two particles are very near each other. It’s often considered a higher quality particle arrangement than Blender’s default uniform sampling. It’s particularly useful for organic arrangements, […]

Axaxaxas

Project

I’ve released a Python based string parser on GitHub. This was part of a much more ambitious project that fell through, but I extracted the good part. Axaxaxas is a Python 3.3 implementation of an Earley Parser. Earley parsers are a robust parser that can recognize any context-free grammar, with good support for amiguous grammars. […]

Celtic Knots

Project

I’ve created a Blender plugin generates 3d beziers curves in elaborate “celtic” style knotwork, based off of a framework mesh. Tested with Blender 2.68a. It’s available on github. Celtic Knots are a intricate decorative design found in Celtic and other cultures mosaics and manuscripts. The knots often include elaborate variations and unusual angles that the […]

Tileset Roundup

Beginner Tutorial

Following my development of Resynth Tileset, I’ve been doing some thinking on the nature of tilesets, and the possible ways to auto tile them – that is, to paint tiles as is with a brush and letting the computer do the tile selection. Let’s review a few possible ways of doing so. Just to be […]

Resynth Tileset

Project

I’ve released a GIMP plugin on Github that allows you to create large tilesets really easily, like this one, based off of the Resynthesizer Plugin. Read more about it on github. Here’s a tutorial.

Meatballs

Project

Click to play Made for TIG Jam UK 4 with Joe Bain.

X Gems of AS3 Language Design

Uncategorized

Ok, so AS3 has its fair share of problems. It is slow, it has next to no support for templates/generics and somewhat sparse standard library. And yet still I love using it. Why? It has managed to pull together some of the rarer features that I think every language should have. Language designers, take note […]

Release of Box2DFlash 2.1a

Uncategorized

I’m releasing an alpha version of Box2D Flash 2.1. It’s got a shiny new website, too. It has may features that were lacking before, but you’ll have to discover most of them for yourself. This move is prompted mainly by the announcement of Erin that Box2D 2.1 itself is going to be delayed for more […]

Box2DAS3 back up to date

Uncategorized

Yeah, so I finally caught up with Erin’s changes to the C++ version. It’s still not quite usable though – a few bugs remain to be found, not to mention the fact patches of functionality are missing or broken. I’ll be putting up a preview version soonish, though. I also spent 10 minutes cutting out […]

More Box2DAS3 v2.1a Progress

Uncategorized

Ok, the first revision (r52) of Box2DAS3 for the next version is available now on SVN. Phew, that was a lot of work. Lots of stuff doesn’t work, but the reduced testbed ought to compile and run. Notes: The old SAP broadphase works, as well as Dynamic Tree. It’s 3-4x slower than the old version! […]

Box2DFlash 2.1 Progress

Uncategorized

Quick bulletin that I’m working on porting Erin’s recent changes to Box2D, which will eventually become the bulk of 2.1. It’s a pretty big job, which I’m doing at once, so there’ll be nothing compilable for a while. I’ve done maybe 10%.

Sprite Choppa

Project

I saw a poster on TIGSource talk about manually cutting up sprite sheets, so I’ve dusted off a project from 2007 to solve it. Just load up a sprite sheet, select the background color, and export the results into a directory. It’s got a few extra features useful for what I originally wanted it for, […]

Box2DWith

Project

Announcing my newest finished project, Box2DWith. I’m collecting together various utility classes for doing all the stuff with Box2DFlashAS3, but found annoying. Demo, Docs

ASDoc Enhancements

Uncategorized

I’ve not posted for a while, but that doesn’t mean I’ve not been doing anything. Generally less visible stuff (yes, some porting), but I have converted Box2DFlashAS3 to use ASDoc to generate beautiful documentation. The results are available here. For lack of a better place, this will be their permanent home, and I’ll try to […]

Control MediaMonkey From Launchy

Uncategorized

You ever want a Lauchy command to control MediaMonkey? Well now you got it. Just download the attached zip, and extract it somewhere Launchy can see .lnk files (like the default Utilities folder, e.g.). The same files work for Winamp, just change the names to something more appropriate. The trick is an obscure little utility […]

b2BuoyancyController

Uncategorized

Following the poll, buoyancy seemed to be the popular choice for Box2D feature. I decided against the fancy and probably unreliable technique I was going to use, and have produced a “controller” based on good old, geometry, cribbing a fair amount of Erin Catto’s notes on the subject. Demo

1300 Strips of Qwantz

Uncategorized

The entire Qwantz (dinosaur comics) archive expressed in one comic: Qwantz, for those who don’t know, is a webcomic only in the sense of being a comic on the web. Despite having posted about 1300 comics as of writing, the images have not varied at all, just the text. I’ve averaged every comic with a […]

Box2D Raycasts

Uncategorized

Box2D has always had a function called TestSegment for colliding segments with shapes, but it really needed conversion into proper raycasts. Check out a Demo.

b2ConcaveArc

Uncategorized

My first proper contribution to the wonderful Box2D engine, specifically the Flash port. I’ve added a third shape type to the engine, which dramatically increases the possible shapes you can describe. Hopefully my contribution will also show other people how to add shapes, and some of the deeper aspects of the engine. It’s easier to […]