Chapter 11. Some general concepts

Animations, themes, models

Table of Contents

Theme
Theme directory and file structure
Theme inheriting
Model
Animation
Animation and files
Animation and Model

This chapter should explain some general concepts used in map or monster creation.

Theme

While most of the monsters and game objects look the same in every level (e.g. all items - it would be really confusing if the healing apple was in different levels different), some change their graphical coat according to the tileset used in the map or to the legend. (E.g. lifts or killing pikes)

If you are designing a new tileset, it is likely that you will also want to make a theme for it or at least add some items to any of the existing ones.

Theme directory and file structure

In every theme directory must be a theme definition file with name theme.xml . Below you can see an example, contents of file gfx/themes/IceTheme/theme.xml .

<?xml version="1.0" ?>
<gfx_theme>
  <info>
    <name>Ice Theme</name>
    <directory>themes/IceTheme</directory>
  </info>

  <data>
    <image name="apex" image="ice_apex.tga" />

    <image name="bridge_wide" image="ice_bridge_wide.tga" />
    <image name="bridge" image="ice_bridge.tga" />

    <image name="switch_on" image="ice_switch_on.tga" />
    <image name="switch_off" image="ice_switch_off.tga" />
  </data>
</gfx_theme>
	

Elements inside the 'info' block should be self-explaining. Both are compulsory.

Section 'data' contains one or more elements 'image'. every of them assigns an image file to a string. Path to an image is relative to theme directory, so 'ice_bridge.tga' means 'gfx/themes/IceTheme/ice_bridge.tga'.

You may ask: and what are the strings? (Content of attribute 'name'.) Every game object, which changes it's look according to a theme, asks the theme for it's own images giving some unique strings. E.g. Switch has two such strings: "switch_on" and "switch_off". To get the strings, see source code, another theme, or ask a question to development mailing list.

Theme inheriting

At least in the default campaign (levels from locs/DefaultCampaign) I sometimes work with level inheritage. Most of the themed objects have their entries in theme DefaultTheme and that is a theme of DefaultCampaign. Some nested levelsets than either haven't got their own theme and use the whole of inherited one, or define their own entries just for some objects and inherit the others.

Theme inheritage isn't a property of theme, but of levelset.