Making a Customized XML Config File =================================== George Jones cod2gen.blogspot.com 8/23/2006 Many options for cod2gen can be set by making your own config file. Such options include grass textures and sizes of various parts of the buildings that get created. Originally these things were hard-coded in the program, but they have been moved into a separate config file so that end users can choose these things for themselves. First, notice that many of the nodes can have a "chance" attribute that you can use to set certain nodes to be more likely to be chosen than others. For instance, you might have 4 sky textures that you like. You would add each as a child of the . Supposing that you like one of them more than the others, you can give it a higher chance, "2" for instance, which will make it twice as likely to be chosen compared to the other three, which have a default chance of "1". To make a customized XML file, I would suggest copying either the default.xml or basic.xml that are provided instead of starting from scratch. I am looking to include some different config files in future versions, for the different areas, eg. France, Russian, Tunisia. I haven't gotten around to doing this, so if anybody takes the time to do this, please share with the rest of us. I'd love to see some snowy or desert maps. File Structure: =============== Optional nodes are labeled with an asterisk (*). - This must be the top-level node. It has no attributes. [ Attributes ] x_size: the length of generated map in game units y_size: the width of generated map z_size: how high up is the sky outer_wall_height: how tall is the wall that surrounds the map [ Children ] - options for textures to use for the outer wall. [ Attributes ] name: texture name chance: liklihood of being chosen [ Children ] [ Children ] [ Children ] [ Attributes ] name: russian, american, british [ Children ] [ Attributes ] name: player model name - same ideas as allies, but use German - supported game types, multiple allowed [ Attributes ] name: dm, tdm, ctf, hq, etc [ Children ] - options for textures [ Attributes ] name: texture name chance: liklihood of being chosen - the ground [ Attributes ] x_res: x resolution of terrain mesh y_res: y resolution of terrain mesh height: difference in height from highest point to lowest point smoothness: ranges from 0 (no smoothing) to some very large number (smoothed into oblivion). Values between 0.2 and 0.8 seem reasonable. - different region types that you will allow [ Attributes ] num: how many separate regions to create [ Children ] - rope bridge with minefield gorge carved out below it [ Attributes ] chance: liklihood of being chosen [ Children ] - if present, will cause there to be a minefield at the bottom - if present, will cause there to be water at the bottom [ Attributes ] texture: water texture - the rope beneath the planks [ Attributes ] texture: texture for the roap - planks of the bridge [ Attributes ] texture: plank texture length: size of plank from side to side; a small size here makes it like a tightrope width: size of plank in the direction you walk; a small size here makes it like walking on thin twigs separation: distance between planks - patch of multi-story buildings good for jumping and sniping [ Attributes ] chance: liklihood of being chosen unit_size: how big is a 1x1 type building alley_size: how wide is the alley between buildings wall_thickness: how thick are the building walls first_height: how tall is the first level second_height: how tall is the second level third_height: how tall is the third level rail_height: how tall is the railing rail_thickness: how thick is the railing walkway_size: how wide is the walkway the 2nd and third stories [ Children ] - options for textures [ Attributes ] name: texture name chance: liklihood of being chosen - trees and brush [ Attributes ] chance: liklihood of being chosen trees_per_acre: density of the forest. 100 is pretty thin, 500 is a logging operation. allow_resize: whether trees will or will not all be 100% height height_percent_mean: how tall is the average tree, as a fraction, eg 0.7 is 70% scaled. height_percent_stdev: standard deviation of height percentages [ Children ] [ Attributes ] name: name of the model - jaggy rock formations that come out of the ground [ Attributes ] chance: liklihood of being chosen smoothness: same as terrain smoothness. A lower number makes for pokier rocks [ Children ] - options for textures [ Attributes ] name: texture name chance: liklihood of being chosen - randomly dispersed tombstones [ Attributes ] chance: liklihood of being chosen graves_per_acre: density of the graveyard [ Children ] [ Attributes ] name: name of the model - path carved out of the terrain [ Attributes ] chance: liklihood of being chosen width: how much shoulder room you've got depth: how deep is the trench [ Children ] - options for textures. This is the dirt texture. The side wall texture is not configurable (yet). [ Attributes ] name: texture name chance: liklihood of being chosen - dirt pile [ Attributes ] chance: liklihood of being chosen [ Children ] - options for textures [ Attributes ] name: texture name chance: liklihood of being chosen - random models dispersed throughout the map to add some flavor [ Attributes ] limit: how many models to place [ Children ] [ Attributes ] name: name of model radius: how much room the model takes up height: height of the model chance: liklihood of being chosen repeat: how many times to repeat the model in a patch (good for grasses, bad for say, tractors) - Ladders are only used on buildings right now, but could possibly be used elsewhere in the future, so this node is separate from the buildings region node. Ladders are modeled as two brushes for rails and a brush for every rung. [ Attributes ] width: ladder width thickness: rung thickness lip: how many units above where the ladder reaches that it peeks up over the top [ Children ] - options for textures [ Attributes ] name: texture name chance: liklihood of being chosen