Woe! How ill a fate... for ’tis decreed that the Descent of Darkness shall mark the beginning of a new era... a time of hatred and contempt, of sorrow and despair. Thus spake the prophet Eréimul (Aesthurian translation of an excerpt from the Codex of Eréimul). |
Let's have a closer look at towns. In one of the earlier articles I explained how I created entire towns. The problem was that all the buildings were all alike: rectangular, boring... There are ways to make them more interesting. I'll mention two of them and get into the detail with the third one, as I believe it's interesting and versatile. So, how can one make the buildings a little bit more random?
One way is to simply design them by hand. One can handcraft entire buildings or construct them from premade blocks (of course, both blocks and entire buildings might be rotated and mirrored to give an illusion of more randomness). It is quite convenient since we can be sure all elements will look fine and will be placed correctly. The good thing about it is that you can create about any shape you want. The downslide of this might be the tedium of handcrafting everything.
The second way is very simple. Different buildings can be built from different material (wood, stone, brick) or can have walls covered with calcium, painted with tar, etc. Different tile types might be chosen for that, making the towns look at least a little more colourful. In UR, for instance, different materials are used depending on settlements' size (village have wooden or stone buildings, towns have stone or brick ones and more may appear later on). However, this way the only thing that changes is the buildings' appearance, not their shape.
The other way is procedural randomisation. We always part from a typical rectangular building and from there, depending on the building's size, more or less modifications are possible, depending on the building's size. Let's comment on some of them.
Door placement is quite basic. Each building needs at least one door, logically. In UR, doors are placed in the following way. A wall section is randomly chosen and its neighbouring tiles are checked. If there are exactly two neighbouring walls in a straight line, horizontal or vertical, a door can be placed there. Same goes for windows.
This step should probably be made after the whole building has been created and randomized, since adding more features might make the door placement position invalid later.
One way to modify a building's appearance is to modify its corners. The image below shows some of the possibilities.

This way of randomizing the buildings' shape is probably the easiest one to understand and implement.
Let's say we have created a large building like the one on the image below:

What might be added to it are some inner rooms. In order to do that, we pick a random cell inside the inner space marked on the image below:

Then, we simply fill a line or a column with the respective x or y coordinate of that point (in other words: passing through the chosen cell) with wall cells, dividing the building in two parts. A door must be placed in the newly created wall, otherwise one of the rooms will be inaccessible.

There is also another way of creating inner rooms. Parting from the randomly chosen point, we fill one line and one column going from that point to the building's outer walls (again, a door must be created), just like on the image below:

This way, the interior of the buildings will be much more interesting. Also, it will require more time to explore everything, which isn't necessarily good, depending on the developer's expectations. It can be countered by adding more windows for the PC to see the building's interior without having to go in.
OK, let's say we have created a building with an inner room in one of the corners. All we need to do is to erase the contents of this room and the outer walls surrounding it (or fill the area with the ground tile outside the building, like grass).

Additionally, we might consider creating a shrubbery tile (in case we've the Knights Who Say Ni in our game) and instead of erasing the outer walls, replace them with the shrubbery, thus creating a small garden.

The idea is basically the same for T-shaped buildings, but instead of choosing one point inside the marked area, we choose two and separate two areas. Again, shrubberies for the Knights Who Say Ni are allowed.


This one is a tiny bit trickier. Instead of choosing one point within the marked area, we need two in the same line/column.

What we need to do is to create a rectangle of walls inside the marked area and put grass inside it. This requires a fairly large building.

When more than one of the described methods is used on the same building, really interesting structures can be generated. Take a look at the following images.


