11: {text: !!python/unicode '=== Config.bmp: How to Make it Yours ===


    http://community.simtropolis.com/omnibus/simcity-4/mapping-and-terraforming/configbmp-how-to-make-it-yours-r76


    [""http://www.simtropolis.com/library/Omnibus/configbmp/ConfigExample1"".gif]


    http://www.simtropolis.com/library/Omnibus/configbmp/ConfigExample1.gif


    #SC4_Mapping




    By Birdin, March 30, 2011


    Making a basic config.bmp that works is really simple, and probably not even worthy
    of an article in the Omnibus. In fact it''s easier than I make it sound just below,
    but I wanted to be thorough for the engineering types who want to understand every
    detail. But I figure it''s a good place to start before I get to the more fun
    part of the article.


    First, there''s really only one rule regarding how a region is divided into cities:
    that each city is a square of 1km, 2km, or 4km on a side (aligning to a 1km grid)
    and the cities can''t overlap. For simplicity, most people make their regions
    so that the cities fill a rectangle (often 16km x 16km) but this isn''t completely
    necessary, as we''ll see later.


    Anyway, the config.bmp file is a standard Windows (or OS/2) Bitmap file. The color
    depth should always be 24 bits (true color) and the width and height in pixels
    should equal the east-west extent and north-south extent of the region in kilometers,
    respectively.


    Each pixel represents one square kilometer in the region, and the color of the
    pixel is determined by the size of the city covering that square. Red (RGB=255,0,0)
    is for small (1km) cities, green (RGB=0,255,0) for medium (2km), and blue (RGB=0,0,255)
    for large (4km) cities. For example, a 9x7km region might be divided like this:

    ConfigExample1.gif


    And the config.bmp (enlarged 4x here for clarity) would look like this:

    ConfigExample2.gif


    While I''m at it, I''ll note that the dimensions of the greyscale heightmap image
    can be obtained by multiplying the dimensions of config.bmp by 64 and adding 1.
    So a 9 by 7 kilometer region would need a greyscale heightmap image of size 577
    by 449 pixels.


    All of this so far is just about common knowledge. So far.


    The first "secret" I''m going to tell is how SimCity interprets the colors in
    config.bmp. Each pixel doesn''t have to be one of pure red, green, or blue. In
    fact, *any* color can theoretically be used in a config.bmp file.


    When SimCity looks at a pixel in config.bmp, all it really cares about is whether
    or not each channel of the color is 255. Any other value from 0 to 254 might as
    well be zero. Now any pixel where the red value is 255 and the other two values
    are not 255, the pixel is considered to be red. Similarly, any color where the
    red and blue values are 254 or less and the green value is 255 is considered to
    be green, and any pixel with a blue value of 255 while the red and green values
    are both not 255, is considered blue. On top of that, any pixel where *no* channel
    has a value of 255, or if more than one channel has a value of 255, the pixel
    is considered "other."


    What does SimCity do with "other" pixels? It leaves that part of the region empty.
    In this way, one can create a region with an irregular shape, even holes or "islands"
    that aren''t connected (even by ocean) to other parts of the region.


    This can actually be useful in reducing import times for custom regions, as SimCity
    won''t take the time to process parts of the region that aren''t covered by cities.
    If a large section of a region is ocean, those parts of the region can be left
    not covered by cities, and only the playable cities will need time to import.


    One last secret. If possible, SimCity will reduce config.bmp to the smallest possible
    rectangle containing its red, green, and blue pixels, eliminating "other" pixels
    on the bottom (south) and right (east) edges.


    Note, SimCity will not crop out pixels that actually represent cities, only empty
    areas. It will then look for a greyscale heightmap in the *new* dimensions calculated
    based on the cropped config.bmp.


    This means that theoretically, one can take a 640x480 (or larger) digital photograph,
    make sure none of the pixels are lighter than (254,254,254) and then place a proper
    config.bmp in or near the upper-left corner. I wouldn''t suggest doing this on
    Simtropolis''s Map Exchange, however, because a .bmp file at that size would be
    ridiculously large to download, and your map will probably be deleted from the
    STEX.


    It can be fun, though, to put a nice frame around your config.bmp (leaving extra
    space in your greyscale image on the top and left sides for the frame, since SimCity
    won''t crop on those sides) or play around with the colors inside the map itself
    as long as care is taken to make sure you don''t change how a pixel will be interpreted
    by SimCity. Here''s an example.

    Config_Example.jpg


    A simple application of this is Fertile Coast in the STEX There, the colors between
    the cities are varied a little bit so different cities can be distinguished by
    a human viewer. Phil''s Country and Columbus* show some more advanced techniques.
    There are endless ways in which people can personalize their config.bmp files.
    Please use good taste.


    * Columbus was not yet uploaded at the time of this writing, but an enlargement
    of its config.bmp can be found in the City Journals forum.

    '}
