-
Notifications
You must be signed in to change notification settings - Fork 11
Shape Grammars
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.
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.
- Place an initial 2x8 brick or slope block.
- If there are free 2x8 bricks remaining, we can stack more 2x8 bricks or place a slope block.
- If you place a slope block, that ends your construction.
Now imagine Oblige carving out rooms in a similar manner.
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
.