# How does Cave/Glade Generator Work

Watabou’s Cave Generator is one in a series of RPG-ready map generators that Watabou has created over the years. All his work oozes style, but the cave generator was always the one I found most mysterious.

I discovered that the entire thing was exported with extremely readable javascript, so naturally I started to poke and prod. Let’s go over how it works.

# 0.999… = 1, with Rigour

I’ve recently seen a lot of demonstrations of why the decimal 0.999… equals 1.

These are endlessly cycling the internet, simply because all the simple explanations aren’t really compelling. You see smart people responding “can’t you just…” or simply not convinced by bare assertion.

The truth is that is that dealing with these things is actually a lot more complex than a glib twitter answer. You should feel uneasy with these explanations. This same subject confused mathematicians of earlier centuries, leading to awkward theories like “infinitesimals”, which ultimately fell out of favour.

I’m going to take you through a proof that 0.999… = 1, with rigour. Rigour is a term used in maths for building from a solid foundation and proceeding from there in sufficiently small steps. Thus, the majority of the article is not the proof but the definitions. How can we talk about infinity in a way that makes sense? The trick, as we’ll see, is to only talk about finite things we already understand, and define infinity in terms of those.

# Wang Tileset Creator

Ever struggled to figure out all the possible combinations of tiles you need to put together for autotiling? I’ve create a tool answers that question for a variety of cases, with visualizations.

Wang Tileset Creator

# Ortho-tiles

Last time, we looked at quarter-tiles. This was an auto-tiling technique for square grids. Each cell in the grid is associated with a terrain (i.e. either solid or empty). Then the squares were split in four, and each quarter was assigned an appropriate quarter-tile.

Otho-tiles extends this procedure to work with irregular grids, even non-square grids. We just have to alter the procedure a little, and be ready to deform the quarter tiles fit in place.

## Ortho?

Ortho is a Conway Operator. It can be thought of as the extension of dividing a square into 4. It divides each n-gon into n “kites” or “ortho-cells”. Each kite is a four sided shape containing the cell center, one corner, and the midpoint of the two edges adjacent to that corner.

The appeal of the ortho operation is it can take any polygonal grid, no matter how irregular, and convert it into a grid of 4 sided shapes. And it’s much easier to work with something that has a consistent number of sides.

# Quarter-Tile Autotiling

Since Oskar posted about it, I see an increasing amount of praise for his Dual Grid proposal for autotiling terrains. It works by drawing tiles at a half-cell offset to the base grid, creating a dual grid, and using marching squares autotiling to select which tile to draw based on the terrains the corners of the dual grid, which is the centers of base grid.

This is a great scheme. It’s simple, only needs a few tiles and can be extended quite easily. It’s used in many games.

But, it does have some drawbacks. The dual grid is difficult to get your head around. You have to worry about ambiguous tiles. And despite being a substantial improvement over the blob pattern, it still requires drawing quite a number of different tiles.

I’m here to explain an alternative, quarter-tile autotiling. Quarter-tiling has also been called sub-tiles, meta-tiles (when doubling instead of halving). I’ve previous described as micro blob, which is the same thing with precomposition. It’s best known for being the tiling built into the RPG Maker engine.

Quarter-tiling is pretty easy to implement, and requires substantially less effort to create tiles for, as it uses fewer, smaller tiles. That does mean it’s not possible to produce as much tile variation as marching squares. But there’s plenty of techniques for adding that back.

Later, we’ll look at ortho-tiles – an extension of quarter-tiles to irregular, non-square, grids.

# Projects Using My Software

Some of my tools and software have been arond for some time. Plenty of people use them them, judging from queries and stats I see, but few write back to tell me where it’s actually been used. Here I document some of the published projects. I’m always pleased to see more.

## Projects Using Sylves

### My Projects

Sylves Demos – Some demo code using sylves in a variety of ways.

Mosaic Paint – A paint program for non-square grids

Tessera – WaveFunctionCollapse procedural generation for Unity.

### Other Projects

With The Grain – a 10 minute zen puzzler.

## Projects using DeBroglie

Wrath & Glory Space Hulk Generator

## Projects using Tessera

Project Electric Sheep – A trippy AI powered walking simulator. Tessera is used for buildings.

Escape From Darkerlands – A mobile game with procedurally generated maps.

The Forever Factory

Infinity Islets

# Unity’s Problem

(Unity the company, not Unity the engine)

Unity have recently announced their third recent round of layoffs, and pretty much everyone is blaming CEO John Riccitiello for persistent mismanagement.

There may be some truth to that, but the fact is that Unity has a bigger problem than its CEO, or its technical flaws. A problem rarely mentioned that explains most of the rest.

# nice-hooks

I’ve created a new open source library.

I’ve been learning quite a bit about AI and AI Alignment recently. A few weeks ago I joined the Interpretability Hackathon. Sadly my contributions were minimal as I had to leave halfway through, but doing it made me appreciate how bad the tooling is in this area.

So I’ve created nice-hooks, a library for working with pytorch hooks and activations more effectively.

GitHub

Docs

# The Man Who Won: Chapter 1

Hi all, Adam here. I recently attended a creative writing class. It taught me that you don’t need to wait for permission to start writing. I thought I’d have a go at making flash fiction. Enjoy!

Tim was on one of his rants again.

# Announcing Sylves

I’ve released a new library, Sylves that handles the geometry of grids for C# or Unity. I’ve basically distilled all my knowledge from several different grid projects, and made a solid base for anything you might want.