Skip to content
Matt Basta edited this page Aug 30, 2014 · 2 revisions

The interiors of buildings are generated randomly. Previously, building interiors were static (found in the resources/interiors/ directory). The new buildings use a fairly straightforward algorithm to generate the interiors:

  • A three-by-three grid of rooms is created. No building interior can be larger than that.
  • A lobby is placed in the bottom center.
  • A coin is flipped to generate rooms on each side of the lobby (except the bottom, which is at the edge of the building).
  • Coins are flipped to generate rooms attached to each of those rooms. This continues until all rooms are accounted for. Rooms cannot be generated if there is no room for them to connect to.

Once each room has been added, hallways are generated. Currently, all adjacent rooms connect.

Decorations

  • The top four tiles of the back of each room are un-walkable and show the back wall of the room. This differs from dungeons, which are designed to look wall-less.
  • Rooms have a chance of using carpet.

Shops

Shops have special generation rules:

  • The lobby in a shop cannot have an exit to the "center" room. It can only have exits to the left and right.
Clone this wiki locally