GAE/Skill XML

= Common Skill Elements =

type
This tells the engine what sort of skill this is, and must by one of 'stop', 'move', 'attack', 'build', 'harvest', 'repair', 'be_built', 'produce', 'upgrade', 'morph', 'load', 'unload' or 'die'

name
This is a name you give to identify the skill, and is used in command XML elements to identify the skills the command uses. 

ep-cost
How many energy points used for each use of skill 

speed
This important parameter controls how fast each skill cycle is executed, the effect of this parameter is discussed separately for each skill type.

anim-speed
This value controls the animation speed of the model. 

animation
Identifies the G3D file to use for the unit while this skill is being executed. 

sound
Control if the skill has a sound, and if so an offset into the skill cycle to begin playing it.  

effects
A container for a set of effects that are applied to this unit while it is executing this skill. See Effects.

particles
A container for a set of particle systems that are started when this skill is executed. See.

= Skills By Type =

be-built
If any other unit in a faction has a build command that can build this unit, then this unit must provide a be-built skill. The skill speed of the be-built skill is largely irrelevant.     

die
Specific Elements: All units without exception must have a die skill. No commands reference the die skill, it is set when the unit is killed, and plays exactly one cycle, if the fade parameter is false the unit then completely disappears, if fade is true the animation will 'stick' at end, and after a while the corpse will fade and sink into the ground.

     <sound-file path="path/to/sound.wav"/>

stop
A stop skill is an idle (do nothing) skill, all units must have at least one stop skill. The speed of a stop skill effectively defines a 'reaction time', if a unit is idling and has a very low stop skill speed, it may noticeably lag in reacting to new orders. Conversely, an excessively high stop skill speed stresses the engine (faster cycle leads to more command updates). A suggested range for 'troops' would be 200-300 (command updates every 1/2 - 1/3 of a second).

There are at least two situations in which you may wish to deliberately specify a slow stop skill speed, the harvest command uses two stop skills, the second of which, stop-loaded, is played (for one cycle only) when the unit has finished loading a resource, before it goes back to the store. In this case, the speed effectively controls how long the unit will wait, and will be largely dictated by the anim-speed.

The other case is the patrol command, where a stop skill with a low speed might be used to have the unit pause slightly at either end of the patrol route.

<name value="stop_skill"/> <ep-cost value="0" /> <anim-speed value="300" /> <animation path="path/to/model.g3d" />

move
Move skills are fairly straight forward, the skill speed controls the speed the unit moves at.

<name value="move_skill"/> <ep-cost value="0"/> <anim-speed value="100"/> <animation path="path/to/model.g3d"/>

harvest
Harvest skills are required to collect resources, the skill speed controls the rate at which the resources are collected, but this is controlled in conjunction with parameters of the command that uses it, see the Harvest command for more details.

<name value="harvest_skill"/> <ep-cost value="0"/> <anim-speed value="80"/> <animation path="models/harvesting.g3d"/> <sound enabled="true" start-time="0"> <sound-file path="sounds/file1.wav"/> <sound-file path="sounds/file2.wav"/>

build
Build skills are used to build other units, the skill speed is used to control the rate at which hp are added to the unit being built. Each skill cycle will add (max_hp / time)[from the built unit's parameters] hp to the unit under construction.

<name value="build_skill"/> <ep-cost value="0"/> <anim-speed value="80"/> <animation path="path/to/model.g3d"/> <sound enabled="true" start-time="0"> <sound-file path="sounds/buildsound1.wav"/> <sound-file path="sounds/buildsound2.wav"/> <sound-file path="sounds/buildsound3.wav"/>

repair
Specific Elements: [all optional] <max-range value="2" />      &lt;!-- default value: 1 --&gt; &lt;!-- default value: the same formulae as used in build (see above) --&gt; <multiplier value="1.5" />   &lt;!-- default value:  1.0 --&gt; <pet-only value="false" />   &lt;!-- default value: false --&gt; <self-allowed value="true" /> &lt;!-- default value: true --&gt; <self-only value="false" />  &lt;!-- default value: false --&gt;

Repair skills are used to restore hp to other units, similar to the build command, but with more options to override the default amount of hp to restore each skill cycle. If amount is not specified the same formulae as is used in the build skill is taken as the base value, which can then be modified by the multiplier.

If pet-only is true, the skill can only be used to heal pets of this unit. likewise, if self-only is true it can only be used to self-heal, setting both is an error. Setting self-allowed to false and self-only to true is also erroneous.

<name value="repair_skill"/> <ep-cost value="0"/> <anim-speed value="60"/> <animation path="path/to/model.g3d"/> <sound enabled="true" start-time="0"> <sound-file path="sounds/repairsound.wav"/> <multiplier value="1.2" /> <self-allowed="false" />

produce
Specific Elements: [optional] <pet value="true" max="3" /> &lt;-- default: false & 0 --&gt;

The produce skill is used to create new units (and also by the generate command for non-unit producibles). Each complete skill cycle adds one 'production point' the the current command, when the number a production points accumulated reaches the produced units time parameter the production is complete.

The pet node can be used to specify that units produced by this skill are pets of the producing unit, and special rules apply to them. The max attribute is used to then limit how many pets the owner unit can have. Note: This element is going to be moved to the Produce command in the near future.

<name value="produce_skill"/> <ep-cost value="0"/> <anim-speed value="80"/> <animation path="models/producing.g3d"/>

upgrade
The upgrade skill is essentially the same as the produce skill, except that it produces upgrades rather than units. The same 'production point' system is applied.

<name value="upgrade_skill"/> <ep-cost value="0" /> <anim-speed value="300" /> <animation path="models/upgrading_anim.g3d" />

morph
Again, the morph skill is similar to produce, the production point system is used, one added per skill cycle, until the morphed-to unit's time parameter is reached, at which point the morph completes.

<name value="morph_skill"/> <ep-cost value="0"/> <anim-speed value="75"/> <animation path="models/morphing.g3d"/>

load
Specific Elements: <max-range value="3" />

The load skill is used to house other units. Only one unit can be loaded in each skill cycle, so the skill speed controls how fast units can be loaded. The max-range value controls how close the units must be before they can be loaded.

<name value="load_skill"/> <ep-cost value="0"/> <anim-speed value="120"/> <animation path="models/transport_loading.g3d"/> <sound enabled="true" start-time="0"> <sound-file path="sounds/transport_load.wav"/> <max-range value="3"/>

unload
Specific Elements: <max-range value="3" />

The unload skill takes housed units and puts them back in the real world, as with load, only one unit can be unloaded per cycle, so the speed controls the rate at which units can be released.

<name value="unload_skill"/> <ep-cost value="0"/> <anim-speed value="120"/> <animation path="models/transport_unloading.g3d"/> <sound enabled="true" start-time="0"> <sound-file path="sounds/transport_unload.wav"/> <max-range value="2"/>

attack
Specific Elements: <attack-strength value="140"/> &lt;!-- attack strength, base value for damage done --&gt; <attack-var value="40"/>      &lt;!-- attack of unit = attack-strenght +- attack-var --&gt; <attack-range value="7"/>     &lt;!-- attack range --&gt; <attack-type value="energy"/> &lt;!-- type of attack, one of the values from the tech XML --&gt; <attack-fields>               &lt;!-- should really be attack-zones --&gt; &lt;!-- interpreted as 'surface', can target any surface units --&gt; &lt;!-- can target any aerial units --&gt; </attack-fields> <attack-start-time value="0.6"/> &lt;!-- offset into the skill cycle the attack is applied (or projectile launched) --&gt; &lt;!-- parameters for projectile attacks --&gt; <particle value="true" path="particle_proj.xml"> &lt;!-- path to XML file --&gt; <sound-file path="sounds/attack.wav"/> &lt;!-- parameters for splash attacks --&gt; <particle value="true" path="particle_splash.xml"/> &lt;!-- path to XML file --&gt; &lt;!-- the radius of the splash --&gt; <damage-all value="true"/>   &lt;!-- *does not currently work* whether the splash damages 'all' or only 'enemy' units --&gt;

Attack skills deal damage to enemies. The formulae used to calculate the damage dealt in each attack is (attack-strength +/- attack-var - target.armor) * damage-multiplier. Where damage-multiplier is the appropriate value for this attack-type and the targets armor-type. For splash attacks the base value (attack-strength +/- attack-var) is first divided by (distance + 1), effectively scaling the value down more the further the target is from the centre of the splash.

The attack-fields describes what units can be targeted by this attack, these are no longer fields but zones, of which there are two, surface and air, all fields other than air map to the surface zone, and 'land' specified here means 'surface' to the engine.

<name value="attack_skill"/> <ep-cost value="0"/> <anim-speed value="60"/> <animation path="models/attacking.g3d"/> <sound enabled="true" start-time="0.2"> <sound-file path="sounds/attack1.wav"/> <sound-file path="sounds/attack2.wav"/> <attack-strength value="150"/> <attack-var value="25"/> <attack-range value="8"/> <attack-type value="piercing"/> <attack-fields> </attack-fields> <attack-start-time value="0.6"/>