MAP GENERATOR

Version 0.5

This is still beta software. If you find something particularly annoying or get messages that your request was aborted, tell me. I can't fix bugs I don't hear about. On the other hand, read the text below, some things aren't bugs but designed on purpose. You'll find my address at the bottom of this page.

This generator creates local maps, the scale used for villages, farmsteads, etc. If you don't need a specific map and just let the programs imagination run free, let everything default and just choose a random seed (see below). This is recommended for those that have never used the generator and want to see whether the maps suit their tastes. Read the section about ouput, add a random seed in the shaded field and then proceed to the very end.

If you like to manipulate things and get a reasonable map, please follow the instructions below closely. Not all parameters are intuitive at first and some are not clear at all without ample description. There are also some limitations which you have to abide with, the reasons are given below.

Let me inform you that this program is available for download. The offline version provides a lot more flexibility. But you need to be able to install it. You need at least a "perl" installation and I don't think you can do without "transfig" either. This may pose a problem for MS-Windows users. See the section on output below.

And ultimately, there also is a bare bones version of this entry form page and an example page, where some results are found. They were created with version 0.2 of this script.

Output

Output is generated in three formats for now. One is the scalable FIG format (3.2 to be exact), which can be read by xfig. This program is available for all Un*x-variants, such as FreeBSD, Linux, and Solaris. I believe it can be made to run on the unix-based MacOS too. Another is PNG, a pixel-oriented format, which is derived from the pre-generated FIG file. This is for all those not lucky enough to be using the FIG format. The third format is povray model language (POV for short). You can run povray on it an get a perspective view (or change camera and lighting and do all sorts of things).

The output, exempting POV, uses simple, clear colors, it does not dither or provide textures. There are two reasons for this. One, textures would presumably take longer to generate. Second, textures and dithering are easily added by some image manipulation program. For instance, do a select-by-color and then apply your favorite texture to the selection; you can even make it fade at the edges. Colors therefore always default and cannot be chosen. I may change the defaults in the future.

Some notes on POV output. First of all, the outout is gzipped, because the output would otherwise excessive in size. Any archiver should be able to handle that. Second, there are a few #ifdef (DELUX) blocks inside. If you set that variable, you will get very cool images. (See an example of textures and objects.) You probably cannot just set set DELUX and get a perfect image. You have to seriously reduce excess objects. Otherwise your rendering times can sky-rocket. In fact, my machine hangs with 512kb RAM and 1.4GHz.

Some parameters you may provide may be in conflict with others, or they may conflict with parts already generated. For example, you may specify a river ranging from north to south, but have not told the program to adjust the general elevation to that effect. Then the river may be flanked by a sea/lake on both sides - not very natural in most worlds. You may also find that the exits of your roads are underwater. Again somewhat unpleasant.

Input

Maps can be configured through various parameters, each described individually. They are grouped in several sections, each of which can be omitted when generating a map. This is useful when you know that you wont, e.g., use houses or woods. This uses less resources and is faster. A parameter that pertains to all is the random seed. A map can be duplicated if identical parameters, including this, are feed to the program again. Any value here is as good as the other.

Beside each input field a range is given, that should be observed when entering numbers. In brackets you may see a value, if the entry defaults - in which case the default is in said brackets.

Random seed: (0 - 99999)

One of the main parts of the map generator is the generation of elevation. It should never be omitted, unless you are absolutely sure what you are doing. The results of this step are used throughout the rest. The field is made up of 128 by 128 units, each of which may have a height ranging from -128 to 128. A fractal algorithm is used to generate realistic patterns. Note that the height mentioned is an internal height. Although you will not see it, you need to know its meaning to understand other parameters.

Elevation: On Off

How many feet is one (vertical) unit? At most five elevation lines are drawn. Suppose that you want to draw them at the intervals 10', 20', 30', 40', and 50'. (You can only choose equi-distant heights.) You also equate the maximum possible height on your map to 50'. Now, the internal maximum height is 128 units, unless you chose one or more points in the height field to be higher than default. Assuming you didn't change the defaults, you can safely say 50' = 128 units. Or, in other words, taking some liberty with rounding, elevation lines are to be drawn at 25, 50, 75, 100, and 125 units. Specify a 25 below to get your 10' elevation lines. But consider that 50' is a pretty steep climb for a village campus. That's why the default is 40 units.

Elevation lines: (1 - 999) [40]

The tide slack gives the (internal) height difference between the water line and the beach line, i.e. the area to be drawn as beach. Your interpretation of this effect may be different, but this is how you manipulate the river banks.

Tide slack: (0 - 99) [5]

The corners of the field are (0,0), (0,128), (128,0) and (128,128). They are termed NW, NE, SW, and SE. To each of these a starting elevation can be given. If for instance the east edge of you map should be higher than the west, you could give NE and SE a height of 64 and let the other default (to zero). To allow fine-tuning you may also supply values for the points midway between the ones already described - their naming is obvious. (E.g. (64,64) is called Center.) If you don't supply anything, they are generated.

NW: (-128 - 128) [0]
N: (-128 - 128)
NE: (-128 - 128) [0]
W: (-128 - 128)
Center: (-128 - 128)
E: (-128 - 128)
SW: (-128 - 128) [0]
S: (-128 - 128)
SE: (-128 - 128) [0]

The percentage of water on the map, given the generated height field. There can be more water on the map, depending on rivers. If you want no water, choose 0 here (and don't choose rivers). If you choose 100, you wont get much else. Every point in the height field of zero or below is under water. Everything else is above water. This is valid for rivers as well (see below).

Water percentage: (0 - 100)

Rivers enter the field at some point and exit it at another. Technically it is possibly to let a river end somewhere in the center of the map, but this is rarely ever wanted. Rivers will cut their path in the elevation field we already generated in the first step. If you don't want rivers, switch this section off, otherwise a default river is generated, flowing from N(orth) to S(outh). Rivers are also generated by a fractal algorithm.

Rivers: On Off

The coordinates you enter are of the form (x,y) and one of either "x" or "y" should (almost) always be 0 or 128. This is the constraint points on the border have. You can only specify up to two rivers - which ought to be enough for most local maps. As you can see, the first river may default.

First Start point X: (0 - 128) [64]
First Start point Y: (0 - 128) [0]
First End point X: (0 - 128) [64]
First End point Y: (0 - 128) [128]
Second Start point X: (0 - 128)
Second Start point Y: (0 - 128)
Second End point X: (0 - 128)
Second End point Y: (0 - 128)

The ravine setting determines the width, with which a river will cut its path. The larger this value, the wider the river gets and the wider its bed, including any beach.

Ravine: (0 - 99) [20]

The river depth setting determines the depth, with which a river will cut its path. The larger this value, the deeper the river gets and the more pronounced its path. Shallow rivers may have strips that appear dry, while deep rivers can have almost no beach. Be aware that the value is measured in internal height and is a negative elevation, i.e. under water. This value and the ravine setting above give a river its "vertical" form.

River depth: (0 - 99) [15]

Houses are placed next, with another fractal algorithm. All houses are rectangles. They differ in orientation, length/width ratio, and size. Only the latter is configurable. Turn this off, if you don't want houses, because 40 houses are generated by default. Another point to note is that the number of houses specified does not imply all of these houses will be placed. The reason is that you may have created a water world and all houses would be under water. Such houses are silently dropped. In case you have a map which is half under-water and you need a certain number of houses, specify twice as many and you may be lucky. However, the sizes may not be the ones you specified. This is one of the weak points of this tool, but at present you do not have much control in such a case. If you need specific houses, all you can do is not to create too much water (this includes rivers).

Houses: On Off

The housing ground specifies how far apart houses will be placed, i.e. spacing. If you specify "1", houses may be jammed next to each other and given the algorithm be even placed on top of each other. If you change the default, make it a power of 2 (e.g. 4, 8, 16, 32). If you need several large houses, this may an option for you, because otherwise large houses may be cramped. Be reminded that this tool does not generate city maps, where houses are cramped. (If you try this, you may get a lot of interesting results, but not a city map.) This parameter is coupled with the number of houses. If you specify a big housing ground and a large number of houses, things don't fit on the map. In a case, where these two paremeters conflict, the housing ground takes precedence over the number of houses.

Housing ground: (0 - 99) [4]

Here you can specify a list of house sizes. The list is comma-separated and each entry is a size. There is a natural limit to the number of houses placed given by the size of the map divided by the housing ground specified above. Also don't create houses that are too big. They can step on each others toes. Keep in mind that not all houses may actually be visible - some may have sunk below the water.

Houses: (1 - 99, ..., 1 - 99) [2, ..., 6 x 4]

You may also specify the blocks for houses, i. e. to create new roads. A "0" means that all houses will line up on one road, while a "100" will yield a potential 100 blocks and almost always yield more road endpoints than there are houses. All houses not being a center of a block will be spread about the roads. The distance between houses is only governed by the housing ground already specified.

Housing block tendency: (0 - 100) [8]

Roads are drawn between blocks and the exits. Exits are specified below. The algorithm used is something midway between a minimum distance spanning tree and a least steep slope graph between the housing blocks.

Roads: On Off

Just as rivers cut their path into the ground, so do roads impress the country side. This may not look like the logical thing to do, but it works from generator perspective. Image that the impressions were there before and the roads added later. The higher you choose your value, the flatter the roads will get. With "100", the terrain is evened out where the roads are. Remember the ravine setting above? It also says how wide the road-bed is. (This parameter is currently not used.)

Road flatness tendency: (0 - 100) [25]

The coordinates you enter for the road exits are of the form (x,y) and one of either "x" or "y" should (almost) always be 0 or 128. This is the constraint points on the border have. You can only specify up to two exits - which ought to be enough for most local maps. As you can see, exits will default.

First Exit Road X: (0 - 128) [0]
First Exit Road Y: (0 - 128) [64]
Second Exit Road X: (0 - 128) [128]
Second Exit Road Y: (0 - 128) [64]

Gardens are the little patches behind houses which are used to grow some personal vegetables and the like. The size may be increased, but thats about all you can do. The algorithm used tries to create the patches through a random walk.

Gardens: On Off

The nature of the algorithm doesn't allow for big patches. They would get spread out too much. Also be reminded that these patches take land away from fields and woods. The number you specify is the number of "blobs" assigned to each house. Blobs are dropped silently, just as houses, if they fall below the beach mark.

Garden size: (0 - 99) [8]

Fields are large patches of land converging on the map from the outside. They enter at various angles and sometimes fit comfortably fit inside it. The algorithm will try to "shoot" the field into the map until it can't find any more space.

Fields: On Off

Specify the sides from which fields may emerge. The order is N, E, S, and W. Thus, (1,0,0,1) means fields will enter from the north and east. If you don't want fields, uncheck this section above, don't specify (0,0,0,0) - this will default.

Field sides: (0 - 1 x 4) [1,1,1,1]

A measure of how much field area should be attempted to add. A field size is given by length x width. See below for these values. There may be less or more fields, depending on the "circumstances" generated so far, so this is just a rough measure.

Total field size: (0 - 1000) [500]

Field length in internal (horizontal) units. The total size of the map is 128 x 128 = 16,384. Also note that regardless of the field area left, the maximum field possible will be added.

Field length: (1 - 99) [30]

Field width in internal (horizontal) units. Also see the notes given for the previous value. Try to keep the field width even.

Field width: (1 - 99) [12]

The corners of the field may appear edgy (0) or be round as to make the whole field appear rounded at the end (Field width halved). Alway choose a value between 0 and half of your field width. This is why field width should be an even number. If you choose values larger than that, you create smaller and probably strange fields.

Corner rounding: (0 - 9) [0]

Woods are created by an algorithm similar to the heights. You will find some of the numbers famliar, but they will have a slightly different context.

Woods: On Off

The percentage of the whole area to be covered by wood. All previously generated land marks are ignored for this purpose and are subtracted later (see Assart below). Also ignored is the area under beach level, e.g. water. Thus, if you specify 50% water and 50% woods, you will get 50% water and 25% wood and 25% normal ground, ignoring all other effects. That is equivalent to saying, half of the wood is underwater.

Woods percentage: (0 - 100) [45]

Each structure takes away from the woods. This includes roads, fields, houses, and gardens. The amount of free space around such a structure is called assart. (It is measured in horizontal units.)

Assart: (1 - 999) [4]

The remaining entries are designate the wood "level" of the varies points on the map. If you want wood converging on your map from the south specify NW, N, and NE as 128 and let everything else default (or even set it to some negative value).

NW: (-128 - 128) [0]
N: (-128 - 128)
NE: (-128 - 128) [0]
W: (-128 - 128)
Center: (-128 - 128)
E: (-128 - 128)
SW: (-128 - 128) [0]
S: (-128 - 128)
SE: (-128 - 128) [0]
Output:


Copyright 2004 Michael Jung < miju@phantasia.org >