Difference between revisions of "Overgrowth Object Xml File Format"

From Wolfire Games Wiki
Jump to: navigation, search
(Move Overgrowth Object XML to its own page)
 
m
Line 2: Line 2:
 
This is the top-level XML file for a level object. It specifies visual parameters, some gameplay parameters, and paths for visual assets.<br>
 
This is the top-level XML file for a level object. It specifies visual parameters, some gameplay parameters, and paths for visual assets.<br>
 
Other XML file types reference this XML file type, such as [[Xml File Formats#Character XML|Character XML files]] and [[Xml File Formats#Item XML|Item XML files]].
 
Other XML file types reference this XML file type, such as [[Xml File Formats#Character XML|Character XML files]] and [[Xml File Formats#Item XML|Item XML files]].
 +
</onlyinclude>
  
 
== Object XML Example ==
 
== Object XML Example ==

Revision as of 11:05, 10 September 2023

This is the top-level XML file for a level object. It specifies visual parameters, some gameplay parameters, and paths for visual assets.
Other XML file types reference this XML file type, such as Character XML files and Item XML files.


Contents

Object XML Example

<?xml version="1.0" ?>
<Object>
    <Model>Data/Models/Buildings/arena/arena_gate.obj</Model>
    <ColorMap>Data/Textures/Buildings/arena/arena_gate_c.tga</ColorMap>
    <NormalMap>Data/Textures/Buildings/arena/arena_gate_n.tga</NormalMap>
    <TranslucencyMap>Data/Textures/Buildings/arena/arena_gate_tl.tga</TranslucencyMap>
    <WindMap>Data/Textures/Buildings/arena/arena_gate_wind.tga</WindMap>
    <SharpnessMap>Data/Textures/Buildings/arena/arena_gate_sharpness.tga</SharpnessMap>
    <Label>impale</Label>
    <WeightMap>Data/Textures/Buildings/arena/arena_gate_w.tga</WeightMap>
    <PaletteMap label_red="Bars"
                label_green="Ropes"
                label_blue="Banner 1"
                label_alpha="Banner 2"
                label_other="Banner 3">
        Data/Textures/Buildings/arena/arena_gate_m.tga
    </PaletteMap>
    <DetailMaps>
        <DetailMap colorpath="Data/Textures/Buildings/detail_textures/wood_grain_c.tga"
                   normalpath="Data/Textures/Buildings/detail_textures/wood_grain_n.tga"
                   materialpath="Data/Materials/wood.xml" />
        <DetailMap colorpath="Data/Textures/Buildings/detail_textures/gray_metal_c.tga"
                   normalpath="Data/Textures/Buildings/detail_textures/gray_metal_n.tga"
                   materialpath="Data/Materials/rocks.xml" />
        <DetailMap colorpath="Data/Textures/Buildings/detail_textures/cat_cobbles_c.tga"
                   normalpath="Data/Textures/Buildings/detail_textures/cat_cobbles_n.tga"
                   materialpath="Data/Materials/rocks.xml" />
        <DetailMap colorpath="Data/Textures/Buildings/detail_textures/gold_hexagons_c.tga"
                   normalpath="Data/Textures/Buildings/detail_textures/gold_hexagons_n.tga"
                   materialpath="Data/Materials/rocks.xml" />
    </DetailMaps>
    <DetailObjects>
        <DetailObject obj_path="Data/GrassTest/grass_square.xml" weight_path="Data/Textures/Environments/Cliffs/groundbase_02_grass_short.png"
                      normal_conform="0.9" density="3" min_embed="-0.2" max_embed="0.0" min_scale="4.0" max_scale="6.8"
                      view_distance="10" jitter_degrees="10" overbright="0" />
        <DetailObject obj_path="Data/GrassTest/grass_square.xml" weight_path="Data/Textures/Environments/Cliffs/groundbase_02_grass_short.png"
                      normal_conform="0.9" density="2" min_embed="-0.2" max_embed="0.0" min_scale="4.0" max_scale="6.8"
                      view_distance="20" jitter_degrees="10" overbright="0" />
        <DetailObject obj_path="Data/Objects/Environment/Rocks/lichen_rock_a.xml" weight_path="Data/Textures/Terrain/forest_hills/forest_hills_not_grass.tga"
                      normal_conform="1" density="20" min_embed="0.3" max_embed="0.7" min_scale="0.08" max_scale="0.12"
                      view_distance="10" jitter_degrees="45" overbright="0.4" tint_weight="0.5" collision_type="static" />
    </DetailObjects>
    <ShaderName>detailmap4</ShaderName>
    <avg_color r = "100" g = "128" b = "47" />
    <MaterialPath>Data/Materials/wood.xml</MaterialPath>
    <Flags transparent = "true"
           no_collision = "true"
           clamp_texture = "true"
           bush_collision = "true"
           terrain_fixed = "true"
           dynamic = "true"
           double_sided = "true"
    />
    <GroundOffset>0.5</GroundOffset>
    <ColorTint r = "101" g = "129" b = "46" />
</Object>

Object XML -> Model element

<Object>
    <Model>Data/Models/Buildings/arena/arena_gate.obj</Model>
    ...
</Object>

Required - Path to the obj format model file.

Model element -> element text

<Model>Data/Models/Buildings/arena/arena_gate.obj</Model>

Required - String value. Path to the obj format model file.

Object XML -> ColorMap element

<Object>
    ...
    <ColorMap>Data/Textures/Buildings/arena/arena_gate_c.tga</ColorMap>
    ...
</Object>

Required - Path to the image file for the color map texture for the object.

ColorMap element -> element text

<ColorMap>Data/Textures/Buildings/arena/arena_gate_c.tga</ColorMap>

Required - String value. Path to the image file for the color map texture for the object.

Object XML -> NormalMap element

<Object>
    ...
    <NormalMap>Data/Textures/Buildings/arena/arena_gate_n.tga</NormalMap>
    ...
</Object>

Required - Path to the image file for the normal map texture for the object.

NormalMap element -> element text

<NormalMap>Data/Textures/Buildings/arena/arena_gate_n.tga</NormalMap>

Required - String value. Path to the image file for the normal map texture for the object.

Object XML -> TranslucencyMap element

<Object>
    ...
    <TranslucencyMap>Data/Textures/Buildings/arena/arena_gate_tl.tga</TranslucencyMap>
    ...
</Object>

Optional - Path to the image file for the translucency map texture for the object.

TranslucencyMap element -> element text

<TranslucencyMap>Data/Textures/Buildings/arena/arena_gate_tl.tga</TranslucencyMap>

Required - String value. Path to the image file for the translucency map texture for the object.

Object XML -> WindMap element

<Object>
    ...
    <WindMap>Data/Textures/Buildings/arena/arena_gate_wind.tga</WindMap>
    ...
</Object>

Optional - Path to the image file for the wind map texture for the object.

WindMap element -> element text

<WindMap>Data/Textures/Buildings/arena/arena_gate_wind.tga</WindMap>

Required - String value. Path to the image file for the wind map texture for the object.

Object XML -> SharpnessMap element

<Object>
    ...
    <SharpnessMap>Data/Textures/Buildings/arena/arena_gate_sharpness.tga</SharpnessMap>
    ...
</Object>

Optional - String value. Path to the image file for the sharpness map texture for the object. Used for weapon objects.
TODO: links to/from other file types for this field?

SharpnessMap element -> element text

<SharpnessMap>Data/Textures/Buildings/arena/arena_gate_sharpness.tga</SharpnessMap>

Required - String value. Path to the image file for the sharpness map texture for the object. Used for weapon objects.

Object XML -> Label element

<Object>
    ...
    <Label>impale</Label>
    ...
</Object>

Optional - This is referenced by the editor to display a label for the object in the level, while in edit mode.
TODO: Is this right? Or is it for gameplay scripting? -merlyn

Label element -> element text

<Label>impale</Label>

Required - String value. This is referenced by the editor to display a label for the object in the level, while in edit mode.
TODO: Is this right? Or is it for gameplay scripting? -merlyn

Object XML -> WeightMap element

<Object>
    ...
    <WeightMap>Data/Textures/Buildings/arena/arena_gate_w.tga</WeightMap>
    ...
</Object>

Optional - Path to the image file for the weight map texture for the object.

WeightMap element -> element text

<WeightMap>Data/Textures/Buildings/arena/arena_gate_w.tga</WeightMap>

Required - String value. Path to the image file for the weight map texture for the object.

Object XML -> PaletteMap element

<Object>
    ...
    <PaletteMap label_red="Bars"
                label_green="Ropes"
                label_blue="Banner 1"
                label_alpha="Banner 2"
                label_other="Banner 3">
        Data/Textures/Buildings/arena/arena_gate_m.tga
    </PaletteMap>
    ...
</Object>

Optional - Specifies a set of different tintable areas on this object. The labels are the text displayed in the editor interface. Each color channel of the specified image will be used as a mask to specify where on the object's model the tinting should be limited to.

PaletteMap element -> element text

<PaletteMap ...>
    Data/Textures/Buildings/arena/arena_gate_m.tga
</PaletteMap>

Required - String value. Path to the image file for the color masks, used when there's tint parameters that limit the tint to a specific area on the object, such as character clothing colors, a tintable area on a weapon, etc.

PaletteMap element -> label_red attribute

<PaletteMap label_red="Clothing Color 1">
    Data/Textures/Buildings/arena/arena_gate_m.tga
</PaletteMap>

Optional - String value. The text displayed in the editor interface, next to the editable color corresponding to the red channel of the tint mask image.

PaletteMap element -> label_green attribute

<PaletteMap label_green="Clothing Color 2">
    Data/Textures/Buildings/arena/arena_gate_m.tga
</PaletteMap>

Optional - String value. The text displayed in the editor interface, next to the editable color corresponding to the green channel of the tint mask image.

PaletteMap element -> label_blue attribute

<PaletteMap label_blue="Clothing Color 3">
    Data/Textures/Buildings/arena/arena_gate_m.tga
</PaletteMap>

Optional - String value. The text displayed in the editor interface, next to the editable color corresponding to the blue channel of the tint mask image.

PaletteMap element -> label_alpha attribute

<PaletteMap label_alpha="Clothing Color 4">
    Data/Textures/Buildings/arena/arena_gate_m.tga
</PaletteMap>

Optional - String value. The text displayed in the editor interface, next to the editable color corresponding to the alpha channel of the tint mask image.

PaletteMap element -> label_other attribute

<PaletteMap label_alpha="Clothing Color 5">
    Data/Textures/Buildings/arena/arena_gate_m.tga
</PaletteMap>

Optional - String value. The text displayed in the editor interface, next to the editable color corresponding to the "other" channel of the tint mask image.
TODO: What the heck even is a "other" channel on an image? Does this even do anything in code, besides get parsed? -merlyn

Object XML -> DetailMaps element

<Object>
    ...
    <DetailMaps>
        <DetailMap colorpath="Data/Textures/Buildings/detail_textures/wood_grain_c.tga"
                   normalpath="Data/Textures/Buildings/detail_textures/wood_grain_n.tga"
                   materialpath="Data/Materials/wood.xml" />
        ...
    </DetailMaps>
    ...
</Object>

Optional - A list of secondary material layers that provide fine, repeated visual detail on top of the object's main texture layers.

Object XML -> DetailMaps element -> DetailMap element

<DetailMap colorpath="Data/Textures/Buildings/detail_textures/wood_grain_c.tga"
           normalpath="Data/Textures/Buildings/detail_textures/wood_grain_n.tga"
           materialpath="Data/Materials/wood.xml" />

Optional - The parameters for the detail map textures that repeat across the model, providing finer-scale detail. There can be up to four of these.

DetailMap element -> colorpath attribute

<DetailMap colorpath="Data/Textures/Buildings/detail_textures/wood_grain_c.tga" ... />

Required - String value. Specifies the path to the image for this detail map's color map texture.

DetailMap element -> normalpath attribute

<DetailMap normalpath="Data/Textures/Buildings/detail_textures/wood_grain_n.tga" ... />

Required - String value. Specifies the path to the image for the detail map's normal map texture.

DetailMap element -> materialpath attribute

<DetailMap materialpath="Data/Materials/wood.xml" ... />

Required - String value. Specifies the path to the Material XML for the given detail map level.
TODO: What is this used for? Aren't detail maps a visual-only thing? -merlyn

Object XML -> DetailObjects element

Object XML -> DetailObjects element -> DetailObject element

DetailObject element -> obj_path attribute

DetailObject element -> weight_path attribute

DetailObject element -> normal_conform attribute

DetailObject element -> density attribute

DetailObject element -> min_embed attribute

DetailObject element -> max_embed attribute

DetailObject element -> min_scale attribute

DetailObject element -> max_scale attribute

DetailObject element -> view_distance attribute

DetailObject element -> jitter_degrees attribute

DetailObject element -> overbright attribute

DetailObject element -> tint_weight attribute

DetailObject element -> collision_type attribute

Object XML -> ShaderName element

ShaderName element -> element text

Object XML -> avg_color element

<Object>
    ...
    <avg_color r = "100" g = "128" b = "47" />
    ...
</Object>

Optional - The color that the object should use for rendering acceleration, e.g. if a texture hasn't loaded in, or for simplified lighting.
TODO: Is this even remotely correct? Kinda just guessing, without looking at the code. -merlyn

avg_color element -> r attribute

<avg_color r = "100" ... />

Required - Integer value. Specifies the intensity of the red channel of the average color. Value is between 0 and 255.

avg_color element -> g attribute

<avg_color ... g = "128" ... />

Required - Integer value. Specifies the intensity of the green channel of the average color. Value is between 0 and 255.

avg_color element -> b attribute

<avg_color ... b = "47" />

Required - Integer value. Specifies the intensity of the blue channel of the average color. Value is between 0 and 255.

Object XML -> MaterialPath element

<Object>
    ...
    <MaterialPath>Data/Materials/wood.xml</MaterialPath>
    ...
</Object>

Optional - Specifies the path to the Material XML for the object.
This is used for physics interaction events with this object, including sounds, particles, and decals that will be applied when collisions occur.

MaterialPath element -> element text

<MaterialPath>Data/Materials/wood.xml</MaterialPath>

Required - String value. Specifies the path to the Material XML for the object.
This is used for physics interaction events with this object, including sounds, particles, and decals that will be applied when collisions occur.

Object XML -> Flags element

<Object>
    ...
    <Flags transparent = "true"
           no_collision = "true"
           clamp_texture = "true"
           bush_collision = "true"
           terrain_fixed = "true"
           dynamic = "true"
           double_sided = "true"
    />
    ...
</Object>

Optional - A list of flags that will be applied to this object, if set to true. Some of these flags affect rendering (e.g. double_sided), some affect physics (e.g. no_collision), and others affect gameplay interactions with this object (e.g. bush_collision).

Flags element -> transparent attribute

<Flags transparent = "true" ... />

Optional - Boolean value. If true, then the object will be rendered in the transparent rendering pass.
This flag doesn't make the object transparent on its own, and must also be coupled with transparent shader flags and a transparency map texture.

Flags element -> no_collision attribute

<Flags no_collision = "true" ... />

Optional - Boolean value. If true, then the object will not trigger collisions with players, items, or weapons.

Flags element -> clamp_texture attribute

<Flags clamp_texture = "true" ... />

Optional - Boolean value. If true, then the object will render with its texture clamped at its edges, instead of repeating.

Flags element -> bush_collision attribute

<Flags bush_collision = "true" ... />

Optional - Boolean value. If true, then the object will trigger jiggle physics when items and characters collide with it. Physics objects will also be slowed down when interacting with it, but not completely blocked. It will also impact line of sight.

Flags element -> terrain_fixed attribute

<Flags terrain_fixed = "true" ... />

Optional - Boolean value. If true, then the object will be locked to the terrain when placed.
TODO: Is this an accurate description, or does it do something else? -merlyn

Flags element -> dynamic attribute

<Flags dynamic = "true" ... />

Optional - Boolean value. If true, then the object will be considered to move by script, and the physics engine will use that information for optimization
TODO: Is this an accurate description, or does it do something else? -merlyn

Flags element -> double_sided attribute

<Flags double_sided = "true" ... />

Optional - Boolean value. If true, then the object will have its polygons rendered double-sided. This is useful for objects such as flags and cloth, that have no thickness.

Object XML -> GroundOffset element

<Object>
    ...
    <GroundOffset>0.5</GroundOffset>
</Object>

Optional - The Y offset to position this object away from the ground, when placed in the world.

GroundOffset element -> element text

<GroundOffset>0.5</GroundOffset>

Required - Decimal value. The Y offset to position this object away from the ground, when placed in the world.

Object XML -> ColorTint element

<Object>
    ...
    <ColorTint r = "101" g = "129" b = "46" />
</Object>

Optional - The color that the object should be tinted, by default. This can be overridden in the editor after the object is placed in the world.

ColorTint element -> r attribute

<ColorTint r = "101" ... />

Required - Integer value. Specifies the intensity of the red channel of the tint color. Value is between 0 and 255.

ColorTint element -> g attribute

<ColorTint ... g = "129" ... />

Required - Integer value. Specifies the intensity of the green channel of the tint color. Value is between 0 and 255.

ColorTint element -> b attribute

<ColorTint ... b = "46" />

Required - Integer value. Specifies the intensity of the blue channel of the tint color. Value is between 0 and 255.