Skip to content
George Aleksandrovich edited this page Aug 15, 2019 · 5 revisions

Welcome to the Labrys wiki!

What is Labrys?

In short, Labrys is a Unity library that can be used to make procedurally generated dungeons quickly (both on asset development time, and dungeon generation time). The library differs from other procedural generation libraries (such as DunGen) in that we aim to provide:

  • more low-level customization of the generation algorithm
  • more interesting layouts (not just prebuilt rooms connected by corridors, but dynamically generated rooms)
  • more SPEED (1000+ room dungeons can be generated in less than a second)
  • todo actually substantiate some of these claims™

Awesome! How does it work?

Our dungeon generation is heavily based on the concept of Wang tiles.

Wang tile demonstration image

Wang tiles are a neat mathematical concept that let you make large, interesting looking images from a small set of tiles. Imagine bathroom tiles: little squares that have some paint on them. If you paint them in such a way that edges have the same color, then you can place two tiles together to produce a seamless transition. By being clever about how you paint them, it only takes a handful of unique tile patterns to make an interesting design. The above image was generated from just these tiles:

Blob Wang tile set

There are a lot of different variations of Wang tiles, with different descriptions of how they connect together. Labrys uses the "blob" variant (in mathematical terms, a 2-edge, 2-corner Wang tile), which can be used to describe "rooms" and "corridors". By replacing the blue in the above images with a background, and the yellow with a some sort of a room, we can produce interesting looking maps:

Commune procedurally generated dungeon

We take this concept and apply it to 3D. Instead of painting on floor tiles, we represent each Wang tile as a 3D model. So long as each model is designed to connect consistently with other models, you can produce a seamless dungeon with physical large rooms and narrow corridors.

Labrys dungeon with placeholder models

A description of the core generation code can be found here: Generator

Clone this wiki locally