After doing some research, we found two challenges with subdivision algorithm. 1). It is too random to control the width and length of white boxes. 2). It is hard to achieve an organized layout based on the reference art work we found.

Untitled

Other art pieces created by this artist:

Untitled

Untitled

Untitled

Untitled

Historical Research

Based on the historical research, Tang city has a grid-based layout. The basic unit of a tang city is called ward. A standard ward contains 16 blocks and each block is composed of different building clusters. Bigger building cluster may represent markets, religious places and noble families.

Capture.PNG

From the images, we can see that the ward is organized in a grid based layout. Therefore, it is better to come up an algorithm that can provide better controls on how build clusters should be arrange in an area.

Inspired by Random Level Generation from Path of Exile, which the level is composed of a set of pre-made blocks, we can easy control how a pre-made block looks like and even have different algorithm for each block so that it is not pre-made anymore.

Untitled

                                                  *Level demo from Path of Exile*

Implementation

For class structure, we will have three classes: Ward, Block, Building Cluster. A ward contains a set of blocks. Each block contains a set of building clusters. Each building cluster is an actor inherited from a base class so that building cluster can override the algorithm to have different generative behaviors. Ward, Block and building Cluster all have Rect data to define the position and area in the world space.

Untitled

struct Rect{
	float x,
	float y,
	float width,
	float height
}