Computer Games Design

Adventures in Procedural Content Generation - Adam Speers

Computer Games Design

Adventures in Procedural Content Generation - Adam Speers

Dungeon Generator: Part 5

Rubrics for cubes

Constructing the basics

In order to fully utilise the dungeon generator tool, a designer must understand the construction rules used to create the example assets.

Dungeon tiles are organised within a scene based on a grid system and formed into the tile shapes using a combination of three simple building blocks (Figure 5.1, 5.5, 5.9). When created, following these rules, the finished tile set will create a seamless environment.

Base components:

Floor

• Outer Dimensions: 8m x 8m x 0.05m

• Pivot Location: Centre of upper face

Pillar

• Outer Dimensions: 1m (0.75m) x 1m (0.75m) x 3.25m

• Pivot Location: Bottom rear corner vertex

Wall

• Outer Dimensions: 0.75m x 6.5m x 3.25m

• Pivot Location: Bottom rear centre

Additional Components:

These components are added to the dungeon to support the semi-linear structure and do not form part of the tile matching process.

Divider Arch

• Outer Dimensions: 0.5m x 7.0m x 3.25m

• Pivot Location: Bottom centre

Divider Windows

• Outer Dimensions: 0.5m x 7.0m x 3.25m

• Pivot Location: Bottom centre

Divider Door Frame

• Outer Dimensions: 0.5m x 7.0m x 3.25m

• Pivot Location: Bottom centre

Door

• Outer Dimensions: 0.5m x 7.0m x 3.25m

• Pivot Location: Bottom rear corner

Base Models and Textures

The following 3D models and textures are example assets used for constructing the prefabs within the Unity prototype.

Floor Component

Figure 5.1: Base component - Floor

Figure 5.2: Diffuse Colour Texture

Figure 5.3: Rougness Texture

Figure 5.4: Normal Map Texture

Pillar Component

Figure 5.5: Base component - Pillar

Figure 5.6: Diffuse Colour Texture

Figure 5.7: Roughness Texture

Figure 5.8: Normal Map Texture

Wall Component

Figure 5.9: Base component - Wall

Figure 5.10: Diffuse Colour Texture

Figure 5.11: Roughness Texture

Figure 5.12: Normal Map Texture


Tile Construction Diagrams

Using the base components, all necessary tile types can be constructed, facilitating population of a generated dungeon with geometry.

The simple dungeon generator uses 5 tile types.

The extended version of the generator includes 9 additional tile types.

The following set of construction diagrams illustrate how each example asset has been formed into a prefab within Unity (Unity Technologies, 2020). They also serve as templates for each tile type. A designer may also use alternate dimensions for tiles, provided that each tile in the new tile-set has identical square footprints. The tool (MazeGeneratorExtended.cs) has an input variable for the base dimensions in the editor which will adjust the spawning rules automatically to accommodate the chosen dimensions. This functionality allows the designer freedom to implement tile designs whose aesthetics evoke desired emotional responses. For example: tight narrow areas may evoke feeling of claustrophobia; cluttered spaces to make players feel nervous and towering architecture to make the player feel small and insignificant (Despain, 2013, p. 202; Kremers, 2009, pp. 194-195; Schell, 2008, p. 42).

Example Tilesets: The Unity prototype uses by default, the example tileset GreystoneExtended illustrated below. It also contains a second set MixStoneMatch which can be selected instead by updating the Get prefab variable of NodeGridExtended.cs. This was included to demonstrate how quickly new dungeon sets can be created and easily integrated with the generator.

Tile_Corner_1

(1 Floor, 2 Walls, 4 Pillars)

Tileset:

Simple

Extended

Figure 5.4: Tile_Corner_1

Figure 5.5: Default rotation

Tile_Straight

(1 Floor, 2 Walls, 4 Pillars)

Tileset:

Simple

Extended

Figure 5.6: Tile_Straight

Figure 5.7: Default rotation

Tile_End

(1 Floor, 3 Walls, 4 Pillars)

Tileset:

Simple

Extended

Figure 5.8: Tile_End

Figure 5.9: Default rotation

Tile_Tjunc_2

(1 Floor, 1 Wall, 4 Pillars)

Tileset:

Simple

Extended

Figure 5.16: Tile_Tjunc_2

Figure 5.17: Default rotation

Tile_Crossroads_4

(1 Floor, 4 Pillars)

Tileset:

Simple

Extended

Figure 5.28: Tile_Crossroads_4

Figure 5.29: Default rotation

Tile_Corner_0

(1 Floor, 2 Walls, 3 Pillars)

Tileset:

Extended

Figure 5.2: Tile_Corner_0

Figure 5.3: Default rotation

Tile_Tjunc_0

(1 Floor, 1 Wall, 2 Pillars)

Tileset:

Extended

Figure 5.10: Tile_Tjunc_0

Figure 5.11: Default rotation

Tile_Tjunc_1a

(1 Floor, 1 Wall, 3 Pillars)

Tileset:

Extended

Figure 5.12: Tile_Tjunc_1a

Figure 5.13: Default rotation

Tile_Tjunc_1b

(1 Floor, 1 Wall, 3 Pillars)

Tileset:

Extended

Figure 5.14: Tile_Tjunc_1b

Figure 5.15: Default rotation

Tile_Crossroads_0

(1 Floor)

Tileset:

Extended

Figure 5.18: Tile_Crossroads_0

Figure 5.19: Default rotation

Tile_Crossroads_1

(1 Floor, 1 Pillar)

Tileset:

Extended

Figure 5.20: Tile_Crossroads_1

Figure 5.21: Default rotation

Tile_Crossroads_2a

(1 Floor, 2 Pillars)

Tileset:

Extended

Figure 5.22: Tile_Crossroads_2a

Figure 5.23: Default rotation

Tile_Crossroads_2b

(1 Floor, 2 Pillars)

Tileset:

Extended

Figure 5.24: Tile_Crossroads_2b

Figure 5.25: Default rotation

Tile_Crossroads_3

(1 Floor, 3 Pillars)

Tileset:

Extended

Figure 5.26: Tile_Crossroads_3

Figure 5.27: Default rotation


Additional Models and Textures

The following 3D models and textures are example assets used for constructing the additional prefabs within the Unity prototype.

Divider Arch Component

Figure 5.28: Additional Component - Divider Arch

Figure 5.29: Diffuse Colour Texture

Figure 5.30: Roughness Texture

Figure 5.31: Normal Map Texture

Divider Windows Component

Figure 5.32: Additional Component - Divider Windows

Figure 5.33: Diffuse Colour Texture

Figure 5.34: Roughness Texture

Figure 5.35: Normal Map Texture

Divider Door Frame Component

Figure 5.36: Additional Component - Divider Door Frame

Figure 5.37: Diffuse Colour Texture

Figure 5.38: Roughness Texture

Figure 5.39: Normal Map Texture

Door Component

Figure 5.40: Additional Component - Door

Figure 5.41: Diffuse Colour Texture

Figure 5.42: Roughness Texture

Figure 5.43: Normal Map Texture


Combining Components

Example output using the tile matching system and additional components

Figure 5.44: Tiled Dungeon Sample (GreystoneExtended)

References

Despain, W. (2013). 100 principles of game design. s.l.:New Riders.

Kremers, R. (2009). Level Design : Concept, Theory, and Practice. Boca Raton: A K Peters.

Schell, J. (2008). The Art of Game Design: A Book of Lenses. Amsterdam; London: Morgan Kaufmann.

Unity Technologies (2020). Prefabs. Available at: https://docs.unity3d.com/Manual/Prefabs.html (Accessed: 21 April 2020).