Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Shape Grammars

GTD-Carthage edited this page Jul 17, 2018 · 9 revisions

Shape grammars are a method of procedural generation that Oblige 7.x relies on to create its new rooms. Shape grammars offers a balance between entirely computer-generated architecture and human design by allowing a user to input set of rules and products for which the procedural generation is restricted to, creating a balance of patterns that is still seemingly human-created.

I'm Here to Mod Oblige, Not To Become a Linguistics Expert!!!

Imagine building something with Lego blocks. When you start from nothing, you virtually have the option of using any block at all as a basis for constructing whatever. As you continue, the amount of possible blocks you can use drastically decreases - for example, you can't place a 2x8 brick over a slope - if you do, the rest of the block will be hanging off the side. If you used the slope block as your first block, your options for what block to place are limited. If you used a brick as your first option, you can keep stacking bricks until it ends in a slope again.

In this sense, we defined a rule and an effect for that rule.

  1. Place an initial 2x8 brick or slope block.
  2. If there are free 2x8 bricks remaining, we can stack more 2x8 bricks or place a slope block.
  3. If you place a slope block, that ends your construction.

Now imagine Oblige carving out rooms in a similar manner.

How Oblige Does It

Oblige's shape rules can found in scripts/rules.lua for all 7.x release except for the last, 7.70, where it is instead found inside games/<game_name>/shapes.lua.

Clone this wiki locally