Customizing GenMod

The GenMod UI lets you control what will go into your Mod, and how much. But if you want to get even more control over your Mod, you need to modify one of the XML data files that GenMod uses.

GenModData.xml contains all the raw data for TileSets, Layouts, Containers, Treasure, and pre-defined creatures. CreatureData.xml contains raw data for CreatureTypes, CreatureMods, and SpellSets.

The remainder of this document covers the different sections of these two XML files. Warning: the information here tends to lag behind the current state of affairs in the XML files. We have tried to keep the comment sections in those files up to date, so your best bet may be to consult the XML files directly.

Containers

GenMod creates new containers and optionally adds treasure to them. If you want to use a pre-existing container, place it under the Furniture section.

Containers are built from two different elements: a ContainerType and one or more ContainerMods.

ContainerType

A ContainerType combines a general class of container (barrel, box, chest) with a Morrowind model file (NIF), and other information (ex., size, capacity) that GenMod needs to know in order to place the new container into the world.

ContainerTypes have the following attributes:

UniqueName

This field is only used for specifying items in a Theme (so you can call out for a specific type of container in a cell). Note that unique names must be separated by a comma.

FName

The name the user will see when interacting with the container in the game.

Lock

Lock controls how likely it is for a container to be locked. A value of 0.0 means it will *never* be locked. This is the default value if no Lock information is given. A value of 1.0 means a container of that type will *always* be locked. A value of 0.5 gives a 50% chance the container will be locked.

ModelFile

The NIF file, including subdirectory, of the Net Immerse model used to display this type of container in the world.

Weight

TES uses Weight to control how much stuff will fit into a container. So if a container as a "weight" of 200, that means it can hold 200 kilos (pounds, whatever) of "stuff."

ContainerMod

A ContainerMod associates a user-defined name (ex., "SmugglerHoard") with one or more InventorySets. When GenMod creates a new container, it combines a ContainerType with one or more ContainerMods to build a container with stuff in it.

The attributes for a ContainerMod are:

Name

Currently optional, but gives some idea of what the ContainerMod is trying to do. Ex., "Apothecary," "Traveler's Aid."

MinWeight

[Optional] This specifies the minimum capacity ("weight") that a ContainerType must have in order to receive this Mod. Useful for keeping large, heavy items out of the smaller containers.

Type

[Optional] This is a list of one or more ContainerType Types (ex., Barrel, Bedroom, Chest, Corpse) that this Mod applies to. This is useful for keeping hard objects like armor and weapons out of sacks.

Each Mod references one or more InventorySets. The InventorySet nodes in the ContainerMod are really only references to InventorySets that must be fully defined elsewhere. The attributes for one of these InventorySet references are:

UniqueName

The name of one or more previously defined Inventory Sets.

Ratio

The percentage chance that the InventorySet will actually get used.

Min/Max

How many items / occurrences of the InventorySets will get used. The default values are 1 for both Min and Max. If you specify a Max of 2, for example, GenMod will pick up to two of the named InventorySets for the container. In the example shown here:

  • InventorySet UniqueName="FatiguePotions, HealthPotions, ManaPotions" Max="2"

GenMod could pick FatiguePotions twice, or it could pick FatiguePotions and HealthPotions, or any other combination of 2 items from the list, including 2 of the same thing.

ContainerTheme

A ContainerTheme controls the mix of ContainerTypes that appear together on a level. The structure of these themes is discussed in the Themes section

Creatures (Created by GenMod)

CreatureData.xml contains most of the information for new creatures. Only the InventorySet information, which is used by both new containers and new creatures, is stored in the main GenModData.xml

When GenMod creates a new creature, it starts with a CreatureType and then applies some number of CreatureMods to it. The CreatureType determines which graphics (NIF) file is used, the basic name of the creature (e.g., "Ogre"), and a base set of attributes, skills, optional starting inventory, optional starting spells, etc.

A CreatureMod modifies a CreatureType by increasing or decreasing the creature's attributes, skills, etc. Each CreatureMod also adds a prefix or postfix to the creature's name (e.g., "Ogre Mage").

Both the CreatureType and CreatureMod nodes are complex, with numerous attributes and up to 7 different sub-nodes (Attributes, Stats, Misc, Inventory, Spells, InventorySet, SpellSet). Most of the values in those nodes mirror fields in Morrowind.

The best way to create a new creature type of your own is to start with an existing creature defined in the XML, copy it, and modify the values to suit what you are aiming for.

Creatures (Standard Morrowind)

The structure of the Creature tag is the same as for other Content items. However, Creatures can only appear in CreatureThemes. Also, we support filtering of Creatures by expansion pack, like we do with tile sets. Add the Expansion attribute (e.g., Expansion="Tribunal.esm") to mark a creature as being dependent on a specific expansion pack.

We treat Leveled Creatures the same as normal creatures, so you can reference any leveled creature by UniqueName.

Our "Type" information is similar to TES, but not exactly the same. For things that swim, we make the Type="Fish". For things that fly, we make the Type="Bird". This helps us avoid putting things that swim into dry areas, and things that fly into single-story buildings. For now, GenMod avoids placing Birds and Fish, unless you call for them by UniqueName in your CreatureTheme.

Creature Themes

Creature themes have the same fields and items as content themes, but all ThemeItem Types must be Creature.

Effects

Effects are pre-defined scripts that you can attach to items. The UniqueName of the effect is the name of its script. You can put more than one script name into this attribute, separating the names with commas. The generator will pick one of the names at random.

Effect items are only placed when you randomly generate a dungeon. Also, if you don't want effect items at all, you will have to use the Random Generation Dialog to turn them off. (We ran out of space on the main dialog....)

Each effect can have several Target items. The generator will randomly select one or more of the target items and create a new Miscellaneous item that has the script attached to it. (We only create Miscellaneous items at this time. There is no way to tell the generator to create, say, a book. Even if you are using a book model file, and the thing really, really looks like a book, it will still wind up as a Miscellaneous item.) Then the new items will be placed into the dungeon, possibly more than once each.

Target items have a Friendly Name attribute, which is what the player will see when they place the mouse over the item. You can put more than one value into this attribute, separating the names with commas. The generator will pick one of the names at random.

Target items also have other required information, such as the model file name, icon file name (shown in the player's inventory screen), size, weight, and value. You can specify a minimum and maximum value, separated by a comma, in the Value field. The generator will randomly pick a value between those two.

Furniture

Furniture includes beds, tables, chairs, bookshelves, and pre-defined containers (GenMod will not modify the contents of "furniture" containers, as that would affect every instance of the container in the game world).

Our classification system is different from Morrowind's. We classify activators (ex., beds) as furniture. We classify containers in two ways, depending on whether they are being reused and not modified (classed as Furniture) or if you are going to add items to the container during editing (classed as Container).

Furniture items have the following attributes:

UniqueName

is the ID/Name of the item as seen in the editor.

SizeX, SizeY, SizeZ

The amount of space the item takes up in the game.

Stack

Determines whether the container or furniture item can have things placed on top of it and/or under it. There are actually several different possible values for the Stack attribute, as shown here:

  • No: Item does not support stacking. E.g., beds. This is the default.
  • Bottom: Item must be on the floor, but can have things on top of it. E.g., tables.
  • Top: Item can be on the floor, but can also sit on top of something else. Cannot have anything stacked on top of it, tho. E.g., chests.
  • Multi: Multiple items of this type can appear in a single grid. These items cannot be stacked on top of each other tho, which differentiates them from Stack="Yes" items. E.g., futons.
  • Yes: Item can be on floor, on bottom of stack, or on top of stack. This value is really a combination of BOTTOM, TOP, and MULTI. E.g., barrels, crates.
  • TopMulti: A combination of MULTI and TOP. These items can be on top of other things, but not on the bottom. Also, multiple of this item can appear in a grid, in situations where they are on the ground. E.g., small sacks, urns, baskets.

ZRotate

Rotation required so the item can be placed against a north wall. By default, this is assumed to be zero.

InventorySets

An Inventory Set is a logical collection of objects, subdivided into multiple inventory lists. Each list inside a set is assigned a level number. This number tells GenMod how powerful a player needs to be to receive that particular list of items from the set.

You can reference an Inventory Set in a ContainerMod or a CreatureMod. When GenMod creates a new type of container/creature using that Mod, it will pick a list from the Inventory Set, based on either the anticipated level of the player or the level of the creature.

Inventory Items have the following attributes:

UniqueName

One or more Morrowind unique identifiers, either of LeveledItems or of some specific item type (Misc, Armor, Weapons, etc.) that a player, NPC, creature, or container can have in their inventory.

Min/Max

Determines how many of the item the recipient will get. The default is 1 for both Min and Max. GenMod will randomly pick a value between Min and Max for each recipient.

Ratio

Controls how often that item will show up. A Ratio of 0.75 means that 3/4ths of the creatures/containers that use that InventorySet will wind up with the item in their inventory.

Layouts

Layouts control the shape of rooms that the generator creates. Layouts are 2D grids, with Rows (Height) and Columns (Width). Layouts can also have be nested inside each other, and can have an Offset, which is given in Rows, Columns, and Z-Units relative to their parent Layout.

Cave and room layouts are, unfortunately, not interchangeable. Cave tiles are not always square-shaped and are not all the same size. This makes it a bit more difficult to create a cave layout that "works."

If you are just starting to create new layouts, we recommend you begin with Room layouts, as they are fairly easy to create, and you can typically draw a floor plan on graph paper and translate that directly to a layout and expect it to work. With cave layouts, there is no such guarantee, and you can typically expect to do much more tweaking to get a cave layout working correctly.

Layout Attributes

Height

The number of Rows in this Layout.

LayoutName

The name the user sees in the UI when selecting a Layout.

OffsetX, OffsetY, OffsetZ

The number of Rows, Columns, and Z-Units this layout is offset from its parent.

Type

Either "Room" or "Cave."

Width

The number of Columns in this Layout.

Rows and Columns

Rows and Columns do not have attributes of their own. A Row contains Columns, and a Column contains zero or more Tile Names. Multiple tile names are mainly useful for placing doors, which often require three tiles (doorway, doorjamb, and door). Separate multiple tile names with commas.

Trailing rows and columns that are empty can be skipped. Leading rows and columns must be specified, even if they are empty.

Nested Layouts

Nested layouts are most useful for building multi-story buildings or dungeons. All the tiles in a layout are treated as having the same Z position. To add another story or level, create a nested layout with an OffsetZ. Use OffsetZ="1.0" to create a second story. Or OffsetZ="-1.0" to create a basement. You can also use OffsetZ="0.5" to capture a bi-level structure.

Lights, Decorators, and Children

Lights and decorators are both attached directly to individual tiles in a tile set. These are all optional elements.

Each tile can have several lights to choose from. It can also have several decorators. And each light or decorator can have several child nodes to choose from. For this reason, you can use the optional list markers: AllLights, AllDecorators, Children. These are optional wrappers. You can actually add lights to a tile without having them inside an AllLights node. However, if you want to control how often those lights show up, or control how many lights appear, then you need to add the AllLights node. These nodes have optional attribute values:

The Light, Decorator, and Child nodes define optional elements that get attached to the owning tile. All offsets are specified in relationship to the owning tile. I.e., even a Child element's offset is relative to the tile, not to its owning element.

GenMod does not care what kind of thing you put into the Light, Decorator, and Child nodes. The separation of Lights from Decorators is artificial, and is there only to let you control the relative frequency of Lights separately from other "window dressing" elements. It is common for Lights to have child elements that are not lights (e.g., torches have torch holders, many lanterns have ropes, etc.) In some situations, it might make sense to define the holder as if it were the light, and then have multiple children that are all lights, to provide more variety of lighting. This is allowed.

A Child node can itself have Children.

When GenMod adds elements to tiles, Lights are added first, then Decorators, with Furniture/Monsters getting added last. For this reason, it is sometimes possible for Decorators to seem to be under-represented, compared to their requested Frequency/Ratio. This can happen when a single type of Tile has Lights and Decorators of the same Type. We use the Type attribute to do collision detection, and we won't put a Wall decorator into a tile that already has a Wall light. Thus, if the Lights for a Tile are all Wall lights, and have a frequency of 1.0, then the generator will never be able to put Tapestries into that Tile. This is really desirable, because the tapestries would catch fire, and then your whole dungeon might burn down.

Light, Decorator, and Child nodes have these attributes:

The first light has a 50% chance of being selected. The second light has a 30%, and the third light has a 10%. It's okay that the numbers don't add up to 100%. If the numbers add up to more than 100%, later elements in the list may never appear. If the numbers add up to less than 100%, the missing percents are added back to the first element in the list.

Light Levels and Fog

This tells us how much light/fog will be in the cell (this is the amount of light before any lanterns, candles, or torches are added). Note that fog levels especially seem to be fairly video-card dependent. You may or may not see much difference between different fog levels.

The Name field is a user-defined name, to make it easier for the user to choose a light level.

Each type of light is represented by three integer values in the range of 0 to 255, which represents the amount of Red, Green, and Blue light coming from the associated source.

Fog has the following two fields:

SpellSets

A Spell Set is a logical collection of spells, subdivided into multiple lists of spells. Each list inside a set is assigned a level number. This number tells GenMod how powerful a creature needs to be to receive that particular list of spells from the set.

You can reference a Spell Set in a CreatureMod. When GenMod creates a new type of creature using that Mod, it will pick a spell list from the Spell Set, based on the monster's level.

Spell Items have the following attributes:

UniqueName

One or more Morrowind unique identifiers of a spell, power, or ability that a player or NPC can have.

Ratio

Controls how often that spell will show up. A Ratio of 0.75 means that 3/4ths of the creatures that use that SpellSet will wind up with the item in their inventory.

Themes

Themes control what kind of items get put into a cell. There are three types of themes, FurnitureTheme, ContainerTheme, and CreatureTheme, but the structure of all themes is the same.

Each theme must have a name, and can have zero or more Item nodes inside it. The "Empty" theme doesn't have any items in it, for cases where you want to lay out all the contents by hand.

For each item, you can specify the following attributes:

Type

[Optional] The class or sub-class of object to place. This is useful if you want a general class of item. For example, if this is a ContainerTheme, you might specify "Chest" to select from any available chest.

UniqueName

[Optional] The UniqueName of a Creature, Furniture item, or ContainerType. You can specify multiple names here, separated by commas, and GenMod will select randomly from the list. Ex., for a Furniture theme:

UniqueName="furn_com_r_bookshelf_01, furn_de_p_bookshelf_01"

tells GenMod to select from one of two bookshelves. If you don't specify a UniqueName, the generator will randomly select items from the set of all available items of that type.

Min/Max

Lets you control the exact number of items of that type to be put into the cell. This can be useful if you want, say, exactly one of an item to show up. If not specified, the values of Min and Max are controlled by the Ratio and the size of the level being built. It is generally better to use the Ratio, rather than Min/Max, because the Ratio takes into account the size of the level.

You can specify either Min (and have the generator calculate a Max) OR a Max (and have the generator calculate a Min) OR leave both undefined, and have the generator calculate both Min and Max using the Ratio.

Ratio

Controls the relative number of items of that type that GenMod puts into a level. This is generally better than specifying a Min and a Max, as it lets GenMod put more of an item in a larger cell and fewer of that item in a smaller cell. If you specify both a Min and a Max, the Ratio is ignored.

In general, the Ratio is applied to the number of available "tiles" on the level. Furniture is placed against walls inside rooms, so for placing a piece of Furniture with a Ratio of 0.1, GenMod would count the total number of wall tiles and would multiply those by 0.1. This means that one wall tile in ten will wind up with a piece of furniture of that type.

Note that the above explanation is a bit simplified, because GenMod also takes into account the Frequency information specified in the UI. Thus, the actual calculation is "NumberOfTiles * Ratio * Frequency." If the Frequency in the UI is 0.5 and the Ratio is 0.1, the result is a final multiplier of 0.05, or one tile in twenty getting that item.

Tile Sets

A tile set contains the building blocks for rooms, stairs, and hallways.

TileSet Attributes

TsName

The name the user sees in the UI when selecting the tile set.

TsType

Classifies tile sets as being "room" or "cave" tile sets.

TsSize

The amount of x,y,z space each tile takes up.

WallThickness

Used when placing contents (furniture, containers, etc.) into a cell. Some tile sets have thicker walls and/or curving floors that force the generator to move items further into the room.

Expansion

If this tileset requires a specific expansion pack, use this attribute, and put the filename of the ESM master file the tileset is dependent on. E.g., Expansion="Tribunal.esm". GenMod filters the list of tilesets it uses based on the master files you have selected in the UI. This attribute is optional, and if not specified, GenMod assumes the tileset is part of Morrowind.esm.

FloorOffset

Gives a Z-delta, which will be used when the generator places furniture, containers, or monsters into the cell. This is mainly used with cave tilesets, as their sloping floors force us to raise items higher than normal.

Tiles

To be complete, a tile set must have the following tiles defined for it. When the generator reads in the XML file, it automatically creates "mirror" images of each of these tiles: ex., CornerNW is mirrored into CornerNE, CornerSW, and CornerSE. Please note that the generator specifically looks for the tiles listed below; that is, you can't specify, say, WallS and expect the generator to mirror based on that.

Note that the tiles listed below are just required tiles for random generation and for supporting the pre-defined layouts. You can add define your own types of tiles if you want, and call out for them in your layouts. Just be aware that the random generator uses layouts when creating levels, so if you create a specialized layout that uses tiles specific to a single tileset, but not supported by all tilesets, that layout may cause some problems with randomly generated levels.

Required

Auto Mirrored

CornerNW

CornerNE, CornerSW, CornerSE

WallN

WallS, WallE, WallW

Center

[N/A]

DoorwayN

DoorwayS, DoorwayE, DoorwayW

DoorjambN

DoorjambS, DoorjambE, DoorjambW

DoorN

DoorS, DoorE, DoorW

HallNS

HallEW

HallEndN

HallEndS, HallEndE, HallEndW

Hall3WayN

Hall3WayS, Hall3WayE, Hall3WayW

Hall4Way

[N/A]

HallCornerNW

HallCornerNE, HallCornerSW, HallCornerSE

StairsUpN

StairsUpS, StairsUpE, StairsUpW
StairsDnN, StairsDnS, StairsDnE, StairsDnW

TrapDoorUp

[N/A]

TrapDoorDn

[N/A]

Used only in Cave TileSets

Center_2

[N/A]

HallNS_2

HallEW_2

StairsUpN_2

StairsUpS_2, StairsUpE_2, StairsUpW_2
StairsDnN_2, StairsDnS_2, StairsDnE_2, StairsDnW_2

As you can see, Cave TileSets have additional required tiles. These "_2" tiles usually map to the same Morrowind static object as their normal cousins. However, they have different OffsetXYZs. These tiles are required because not all Cave tiles are square-shaped. In order to support layouts, we need a way to turn the rectangular cave tiles into square tiles. We do this by combining, for example, a Center and a Center_2 tile in the same grid; together they make a single square center tile.

We also use these tiles to "align" larger tiles (such as the hall corner tile and the hall 4-way tile, which are both larger than normal tiles) inside the row/column confines of the layout.

Tile Attributes

All tile attributes are optional and default to 0 in most cases (except that Scale defaults to 1.0).

Area

Used only with certain cave tiles. The allowed values of Area are "HalfSize" and "QuarterSize." Corner cave tiles are almost always quarter size, and hallways and room walls are almost always half size.

DeltaZ

Used for stairs and ramps, this indicates the change in height provided by the stairs.

OffsetX, OffsetY, OffsetZ

Used mainly for Doorjambs and Doors, but sometimes for other items in a tile set. OffsetZ is used more frequently, because some tilesets are not centered around "Z=0", while others are.

Requires

Used when one tile cannot be used without another tile also being present. We use this to connect the Center and Center_2 tiles in cave layouts; the Roof tile and Floor tile in the Daedric tileset; and the 4-way hall with the shaft cap in the Telvani tileset. The value of the Requires attribute is the logical name (ex., "Center_2") of another tile in the tileset. NOTE: The required tile must appear before the tile that requires it. e.g.:

  • <Center_2 ... />
  • <Center Requires="Center_2" .../>

Rotate

The x,y,z rotation of the item. This is rarely used, but a few tiles need to be rotated around the x/y axis. Specify the rotation as: Rotate="x,y,z", where x, y, and z are the actual number of degrees the item is to be rotated about that axis. Most items only need ZRotate.

Scale

Used mainly for Doorjambs and Doors, as I couldn't find any that fit the 512x512 tileset.

ZRotate

The rotation required to make the specified Static element face the desired direction.

Platforms

Platforms are used in caves. Without platforms, it is very difficult to place furniture due to the heavily-sloped floor . Platforms are strange beasts, living in a halfway world between being a TileSet and a piece of Furniture.

Platforms are made up of three components: flooring, stairs, and beams.

Traps

Each trap represents a spellcrafting item from the Morrowind.esm file. When the generator assigns a trap to a chest or door, it uses one of these trap definitions. Traps have a single attribute, UniqueName, the unique id of the spell to use for the trap.