Wednesday, December 27, 2017

City Symbols (Part 5): Larger Buildings

In this series I'm working on procedural generation of map icons to represent cities.  So far I've been focused on generating simple houses:
Now I'm going to look at generating some larger buildings.

One obvious option is just to increase the size of my small buildings by making them wider.  This actually works fairly well:

although obviously the buildings created this way share a lot of visual elements with the small houses.

Another approach is multiple story buildings.  Most of the building blocks are in place for multi-story buildings -- it's mostly a matter of lifting the roof up and sticking in more basic building shapes for the additional stories.  Obviously I don't want doors in the upper floors, and I suspect that having the same window placement in the upper stories will look better than random windows.

Here's a first cut at a two story building:
It's basically just a one story building with the story height doubled.  That's because my code incorrectly assumes that the height of the building shape is also the height of one floor.  I need to separate those two numbers.
That's better.  Now I need to add the windows in to the upper floors.
Looks good.  I've added in some variation in the size of the windows.  Only a small amount so that they still look the same size, but enough to make them look a little more hand-drawn.

Tall buildings start to look like towers, so let me add a roof with battlements.   This is a low wall with gaps like teeth that are familiar from every child's castle drawing:
There's also the version where the battlement has been stepped out from wall to overhang the building.
A simple wall is just a house with a flat roof, and no windows or door:
These are more interesting when they have battlements:
Doorways in walls are a little different than the doors in houses.  I'd like these doorways to have the option to be open and show whatever is behind the wall.  To do that, I actually have to carve the door out of the wall, or I get something like this:
Here the door is not filled in, but the wall behind it still is.  So I'll carve the door out by removing the baseline between the sides of the door and substituting in the path of the door.
Now a castle of sorts is two towers with a wall between them.  Here's an initial cut:
This will probably continue to evolve, but you get the general idea.  Hopefully I'll be able to use all these building blocks together in interesting ways.

No comments:

Post a Comment