Changes between Version 1 and Version 2 of Actors


Ignore:
Timestamp:
Jun 26, 2012, 5:59:42 AM (12 years ago)
Author:
historic_bruno
Comment:

Updated with XML example, added some links

Legend:

Unmodified
Added
Removed
Modified
  • Actors

    v1 v2  
    11''Actors'' are the graphical representations of objects in the game. They combine meshes, textures, animations and props, and also control some other graphical features (such as whether the objects casts shadows or has transparent textures).
    22
    3 Actor data is stored in XML files, which can be edited by hand, but usually the [wiki:Actor_Editor Actor Editor] is used instead.
     3Actor data is stored in XML files, which can be edited by hand, but usually the [wiki:Actor_Editor Actor Editor] is used instead. Actor XML files are located in subdirectories of `art\actors\` for a given mod (see [wiki:Mod_Layout mod layout]).
    44
    55== Randomness ==
     6
    67To allow some visual variety between otherwise-identical units, actors can contain 'random' elements. (They are not strictly random - a designer can choose a particular variation of the actor.)
    78
    8 [wiki:image:actoreditor.png|right|thumb Example of actor data]
    9 To achieve this, the actor is split into a set of ''groups'', each of which contains several ''variants''. See the image for an example - each row represents a variant, and groups are separated by empty lines. The second group controls helmets; when creating a unit, one of the variants ('Helmet A' or 'Helmet B') will be chosen at random, and so the unit will have either 'Advanced Helmet A' or 'Advanced Helmet B' for its 'helmet' prop.
    10 The first group has a single variant called 'base'. Since it's the only variant in that group, it will always be chosen, and so its data will always be used for that actor.
     9To achieve this, the actor is split into a set of ''groups'', each of which contains several ''variants''. '''TODO: Example with screenshot'''
    1110
    12 The ''frequency'' of each variant controls how likely it is to be chosen - in the example, 'Head A' will be chosen about twice as often as 'Head B'. If a variant's frequency is set to 0, it will never be chosen by the randomiser. A zero-frequency variant can still be selected by the game - for example, actors could have 'Summer' and 'Winter' variants, with the default always being Summer, and then the game could change the whole world to Winter.
     11The ''frequency'' of each variant controls how likely it is to be chosen. If a variant's frequency is set to 0, it will never be chosen by the randomiser. A zero-frequency variant can still be selected by the game - for example, actors could have 'Summer' and 'Winter' variants, with the default always being Summer, and then the game could change the whole world to Winter.
    1312
    1413== Terminology ==
    15 Mainly to help me understand myself:
     14
    1615 * ''Variant'': a named collection of data items, specifying the actor's texture, animations, etc (or any subset of those data). Shown in the [wiki:Actor_Editor Actor Editor] as a single row.
    1716 * ''Group'': a set of variants; represented in the [wiki:Actor_Editor Actor Editor] by a block of rows, separated from other groups by blank rows.
     
    1918 * ''Variation'': a set of choices, one from each group, making up a particular version of the actor.
    2019 * ''Selection'': a text string that usually matches a variant name; the chosen variation will use variants which match one of the selections, where possible.
     20
     21== Actor XML format ==
     22
     23The following is an example of version 1 of the actor XML (edited for clarity).
     24
     25{{{
     26#!xml
     27<?xml version="1.0" encoding="utf-8"?>
     28<actor version="1">
     29  <castshadow/>
     30  <group>
     31    <variant frequency="100" name="Base">
     32      <animations>
     33        <animation file="biped/inf_sword_ready_a.dae" name="Idle" speed="100"/>
     34        ...
     35        <animation file="biped/walk_spearshield.psa" name="Walk" speed="120"/>
     36        <animation file="biped/walk_spearshield.psa" name="Walk" speed="111"/>
     37        ...
     38      </animations>
     39      <mesh>skeletal/m_tunic_short.dae</mesh>
     40      <props>
     41        <prop actor="props/units/heads/head_hele_b.xml" attachpoint="head"/>
     42        <prop actor="props/units/shields/rome_parma_b.xml" attachpoint="shield"/>
     43        ...
     44      </props>
     45      <texture>skeletal/rome_ijv_b.png</texture>
     46    </variant>
     47  </group>
     48  <group>
     49    <variant frequency="100" name="Idle"/>
     50    <variant name="Melee">
     51      <props>
     52        <prop actor="props/units/weapons/verutum_reverse.xml" attachpoint="loaded-r_hand"/>
     53        <prop actor="props/units/weapons/verutum.xml" attachpoint="projectile"/>
     54        <prop actor="" attachpoint="r_hand"/>
     55      </props>
     56    </variant>
     57    <variant name="gather_tree">
     58      ...
     59    </variant>
     60    ...
     61  </group>
     62  <material>player_trans.xml</material>
     63</actor>
     64}}}