Informative Maps 01 – City Demographics

Everyone loves a pretty map, even me. But there is also more to maps than their visual appeal, it is the information they convey. An aerial photo of your hometown may tell you exactly how it looks visually and how it is laid out, but it provides very little information about what can be found where in the town. And this is what separates a map from a photo, the additional information it contains that explains what we see in the map.

Today I’ll look into a feature from City Designer – City Demographics. City Demographics in CD3 is a coloring system that lets you color buildings by function (for example residential, commerce, accommodation). This is also a toggle feature which means you can show a nice pretty map for illustrative purposes, and when you need demographics, you can simply turn it on temporarily.

Let us start by looking at an example for how this looks. Here is one of the example maps that comes with CD3 (@Examples\CD3 Example2.fcw). If you open the file yourself, you’ll see that it also shows a grid and an index that I’ve omitted here, but those are also interesting ways of adding information.

Now, by going to the City menu and picking Layers -> All BLDNGs with Color I get the demographic version, using colors to indicate different types of buildings:

You can of course always go back to the normal view by picking All BLDNGs with Shading from the menu instead. Of course, this view may not be all that needed for a small village like this, I just picked it as an example that would be easier to see properly on the blog. But once you have a large city with hundreds of buildings, this view can really help you understand your city.

To use this feature, there are a couple of commands you need to understand, all of these are found in the City menu.

Change House Layer

This command is used to change which layer a building resides on, which controls the demographic coloring. City symbols are complex symbols, so you should always use this command to change the house layer, and not do it manually using the regular ways of changing the layer of an entity. When you use this command, it asks you to select buildings. This work with house symbols, as well as houses drawn using the house drawing tool. Just select the buildings you want to belong to a particular type, hit do it and when the command line then prompts you for the New Layer, right click to pick it using the dialog (or type it in if you prefer). Note that the dialog will show you the list of all layers, but you should only select one of the BLDNG (###) ones, it is only these layers that are part of demographic coloring.

Do note that the colors will not change immediately, this just sets the layer, but you also need to run the next command afterwards.

Color Buildings

This is the command that actually sets the colors on the buildings based on the layer. When running this command, it will bring up a dialog listing the demographics layers available. You can click on the color swatch in front of the layer name to change the color used. Then, hit the Change now button to process all the buildings in the map and change their colors. Of course, the result will only be visible if you are in demographics color view, but even if not, they will still be changed for the next time you switch to it.

 

And that’s the basics of it. Below, you can see a somewhat larger city (The example city from the Tome [And also an important city in my home campaign]) with demographic coloring off and on.

Troubleshooting

There are two things to be aware of when using this. First of all, not all styles support it. The building symbols has to be crafted specifically for supporting this feature (Which also means that if you import custom symbols yourself, it will not work out of the box. The Tome of Ultimate Mapping do have a tutorial on how to make symbols compatible). If you are going to map a new city map and want a a style that support this, I recommend simply starting a new test map, put in a few buildings, and try to turn on demographic coloring. If nothing seems to happen at all, the style doesn’t support it. If you get an error message about a missing layer however, see below.

The second potential issue is that the map/template doesn’t contain the right layers, even if the style supports coloring. This manifests in multiple error messages, all complaining about a missing layer. To fix this, all you have to do is to add the missing layers, for example from the standard layer dialog which you can get to by clicking the layer indicator in the status bar, then just add all the missing layers from this list:

BLDNG (CRIMINAL)
BLDNG (CUSTOM 1)
BLDNG (CUSTOM 2)
BLDNG (GM)
BLDNG (GOVERNMENT)
BLDNG (GUILD)
BLDNG (HOUSE 1)
BLDNG (HOUSE 2)
BLDNG (HOUSE 3)
BLDNG (INN)
BLDNG (MERCHANT)
BLDNG (MILITARY)
BLDNG (RELIGIOUS)
STRUCTURES (COLORS)
STRUCTURES (FILL STYLE)
STRUCTURES (OUTLINE)
STRUCTURES (SHADING)
BUILDINGS

of course, if you want an easier way to do this, you can just create a macro. The below macro will add all the required layers, and it won’t be a problem if any exists already before running it. If you need a tutorial about macros, you can look at my Getting Started with Macros – Part 1 article.

MACRO BUILDINGLAYERS
GOLAYER BLDNG (CRIMINAL)
GOLAYER BLDNG (CUSTOM 1)
GOLAYER BLDNG (CUSTOM 2)
GOLAYER BLDNG (GM)
GOLAYER BLDNG (GOVERNMENT)
GOLAYER BLDNG (GUILD)
GOLAYER BLDNG (HOUSE 1)
GOLAYER BLDNG (HOUSE 2)
GOLAYER BLDNG (HOUSE 3)
GOLAYER BLDNG (INN)
GOLAYER BLDNG (MERCHANT)
GOLAYER BLDNG (MILITARY)
GOLAYER BLDNG (RELIGIOUS)
GOLAYER STRUCTURES (COLORS)
GOLAYER STRUCTURES (FILL STYLE)
GOLAYER STRUCTURES (OUTLINE)
GOLAYER STRUCTURES (SHADING)
GOLAYER BUILDINGS
ENDM

Can I add more Layers (Or rename existing ones)?

Yes, but the list of layers that are shown/hidden by the ‘All BLDNGs with ###’ command from the menu is hard-coded in a macro, so it is a bit more involved than just adding the layer.

First, just add the layer in the layers dialog. Do following the same naming standard of BLDNG (###) used by the existing layers. I recommend adding a new one rather than hiding the old one.

Then, in the Color Buildings dialog, hit Add and pick your new layer.

Finally, you either need to edit the existing macros. Refer to the article series I linked above for the details about doing that. The three macros you need to edit are the SC, HB and SB macros which are the 3 macros used by the commands in the City -> Layers submenu. SC is shown here, the rest are very similar, the difference is mainly whether they hide or show something.

MACRO SC
RDOFF
SHOW BLDNG (CRIMINAL)
SHOW BLDNG (CUSTOM 1)
SHOW BLDNG (CUSTOM 2)
SHOW BLDNG (GM)
SHOW BLDNG (GOVERNMENT)
SHOW BLDNG (GUILD)
SHOW BLDNG (HOUSE 1)
SHOW BLDNG (HOUSE 2)
SHOW BLDNG (HOUSE 3)
SHOW BLDNG (INN)
SHOW BLDNG (MERCHANT)
SHOW BLDNG (MILITARY)
SHOW BLDNG (RELIGIOUS)
HIDE STRUCTURES (SHADING)
HIDE STRUCTURES (FILL STYLE)
SHOW STRUCTURES (COLORS)
SHOW STRUCTURES (OUTLINE)
RDON
REDRAW
ENDM

Now, simply change it to

MACRO SC
RDOFF
SHOWF BLDNG (
HIDE STRUCTURES (SHADING)
HIDE STRUCTURES (FILL STYLE)
SHOW STRUCTURES (COLORS)
SHOW STRUCTURES (OUTLINE)
RDON
REDRAW
ENDM

Notice how I replaced all those SHOW BLDNG (###) lines with a single SHOWF BLDNG ( line.  Basically, instead of handling the layers one by one, I used a filter command to show all the layers that starts with “BLDNG (” instead. I talk more about this command in the Map Views article. This avoids the issue of having to update the macro all the time if you add new layers. The changes to HB and SB are basically the same, just make sure to notice where it uses SHOW and HIDE. The filter version of HIDE is just HIDEF. Also notice that for the STRUCTURES (###) layers the macros show some and hide some, so don’t use the filter statements here.

Now, it is up to you whether you wish to replace the actual macro in the macro file, or if you want to make a new macro to avoid changing the original one, or even add it to a clickable hotspot in the map instead. All of this is described in the getting started with macros article series I linked to earlier. Keep in mind if you edit the macro file, it may get overwritten in an update. Also remember that improper editing of the macro file can cause program crashes or disrupt functionality, so adding a hotspot in your map is the safest way to do this, but that means adding the hotspot to every map that needs it instead of using the menu elements

 

Leave a Reply