Difference between revisions of "Xml File Formats"

From Wolfire Games Wiki
Jump to: navigation, search
m (Actor XML)
m (Undo revision 6152 by Merlyn (talk))
Line 17: Line 17:
 
</pre>
 
</pre>
  
== Character element ==
+
=== Character element ===
 
<pre>
 
<pre>
 
<Character>Data/Characters/rabbot.xml</Character>
 
<Character>Data/Characters/rabbot.xml</Character>
Line 24: Line 24:
 
'''Required''' - Path to [[Xml File Formats#Character XML|Character XML]]
 
'''Required''' - Path to [[Xml File Formats#Character XML|Character XML]]
  
== ControlScript element ==
+
=== ControlScript element ===
 
<pre>
 
<pre>
 
<ControlScript>enemycontrol.as</ControlScript>
 
<ControlScript>enemycontrol.as</ControlScript>

Revision as of 09:15, 4 September 2023

TODO:

Level, Saved Object, Prefab - These have more confusing schemas, to the point where I'm not entirely sure they're distinct types from one another, and I haven't nailed them down yet -merlyn

Actor XML

This is the top-level XML file for an NPC or combat character. It binds a Character XML file to an AI angelscript file.
When a level references a character, this is the file type that is referenced.

Example

<?xml version="1.0" ?>
<Actor>
    <Character>Data/Characters/rabbot.xml</Character>
    <ControlScript>enemycontrol.as</ControlScript>
</Actor>

Character element

<Character>Data/Characters/rabbot.xml</Character>

Required - Path to Character XML

ControlScript element

<ControlScript>enemycontrol.as</ControlScript>

Required - Path to AI angelscript. Relative to Data/Scripts folder

Asset Preload XML

TODO:

Attachment XML

TODO:

Attack XML

TODO:

Character XML

TODO:

Decal XML

TODO:

Events XML

TODO:

Hotspot XML

TODO:

Item XML

TODO:

Layered Song XML

TODO:

Level Meta XML

TODO:

Material XML

This XML file specifies the sounds that will be played when a character or item interacts with a world object. It is used to model the sound differences between wood, metal, soil, ice, etc.

Data/Materials/default.xml is the global "default" material, if the material isn't specified by the world object.

When the engine or a gameplay script detects a physics event, the code will do a lookup against the current material, for an event with that event name. If the event name is found, then the corresponding sound will be triggered.

Some of these events and materials might specify modifiers (soft, heavy, etc). If they do, the code will first do the lookup against the <events mod="themod"> version of the event.
If an event with the given name is not found with that modifier, the code will then lookup a version of the same event name, but with no modifiers specified.

Some of the values, if not specified, will look at a global "base" material to find the value of the parameter. max_distance is the only one of those parameters right now.

Data/Materials/base.xml is the global "base" material.

Example

From Data/Materials/default.xml, which is the material XML file that is used from other XMLs, if not required and not specified.

<?xml version="1.0" ?>
<material>
    <events>
        <leftrunstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_run.xml" attached="true"/>
        <rightrunstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_run.xml" attached="true"/>
        <leftwallstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_wallrun.xml" attached="true"/>
        <rightwallstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_wallrun.xml" attached="true"/>
        <leftwalkstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_walk.xml" attached="true"/>
        <rightwalkstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_walk.xml" attached="true"/>
        <leftcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_crouchwalk.xml" attached="true"/>
        <rightcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_crouchwalk.xml" attached="true"/>
        <leftcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_crouchwalk.xml" attached="true"/>
        <rightcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_crouchwalk.xml" attached="true"/>
        <land soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_jump_land.xml" attached="true"/>
        <land_soft soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_jump_land_soft.xml" attached="true"/>
        <land_slide soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_jump_land_slide.xml" attached="true"/>
        <slide soundgroup="Data/Sounds/concrete_foley/slide_concrete_short.xml" attached="true"/>
        <kick soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_kick.xml" attached="true"/>
        <sweep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_sweep.xml" attached="true"/>
        <jump soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_jump.xml" attached="true"/>
        <roll soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_roll.xml" attached="true"/>
        <edge_grab soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_edge_grab.xml" attached="true"/>
        <edge_crawl soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_edgecrawl.xml" attached="true"/>
        <bodyfall soundgroup="Data/Sounds/concrete_foley/bf_concrete.xml" attached="true"/>
        <bodyfall_light soundgroup="Data/Sounds/concrete_foley/bf_concrete_light.xml" attached="true"/>
        <bodyfall_medium soundgroup="Data/Sounds/concrete_foley/bf_concrete_medium.xml" attached="true"/>
        <bodyfall_heavy soundgroup="Data/Sounds/concrete_foley/bf_concrete_heavy.xml" attached="true"/>
        <weapon_drop_light soundgroup="Data/Sounds/weapon_foley/impact/weapon_drop_light_stone.xml" attached="true"/>
        <weapon_drop_medium soundgroup="Data/Sounds/weapon_foley/impact/weapon_drop_medium_stone.xml" attached="true"/>
        <weapon_drop_heavy soundgroup="Data/Sounds/weapon_foley/impact/weapon_drop_heavy_stone.xml" attached="true"/>
        <blood_spatter soundgroup="Data/Sounds/blood/spatter_hard.xml"/>
        <blood_drip soundgroup="Data/Sounds/blood/drip_lowpass.xml"/>
    </events>
    <events mod="heavy">
        <leftrunstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_run.xml" attached="true"/>
        <rightrunstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_run.xml" attached="true"/>
        <leftwallstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_wallrun.xml" attached="true"/>
        <rightwallstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_wallrun.xml" attached="true"/>
        <leftwalkstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_walk.xml" attached="true"/>
        <rightwalkstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_walk.xml" attached="true"/>
        <leftcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_crouchwalk.xml" attached="true"/>
        <rightcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_crouchwalk.xml" attached="true"/>
        <leftcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_crouchwalk.xml" attached="true"/>
        <rightcrouchwalkstep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_crouchwalk.xml" attached="true"/>
        <land soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_jump_land.xml" attached="true"/>
        <land_soft soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_jump_land.xml" attached="true"/>
        <land_slide soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_jump_land.xml" attached="true"/>
        <kick soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_kick.xml" attached="true"/>
        <sweep soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_sweep.xml" attached="true"/>
        <jump soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_jump.xml" attached="true"/>
        <roll soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_roll.xml" attached="true"/>
        <edge_grab soundgroup="Data/Sounds/concrete_foley/fs_heavy_concrete_edge_grab.xml" attached="true"/>
    </events>
    <events mod="soft">
        <weapon_drop_light soundgroup="Data/Sounds/weapon_foley/impact/soft_bag_on_hard.xml" attached="true"/>
        <weapon_drop_medium soundgroup="Data/Sounds/weapon_foley/impact/soft_bag_on_hard.xml" attached="true"/>
        <weapon_drop_heavy soundgroup="Data/Sounds/weapon_foley/impact/soft_bag_on_hard.xml" attached="true"/>
    </events>
    <physics hardness = "1.0" friction = "1.0" sharp_penetration = "0.0" />
</material>

From Data/Materials/base.xml, which specifies the default max_distance values for all materials.

<?xml version="1.0" ?>
<material>
    <events>
        <leftrunstep max_distance = "40.0"/>
        <rightrunstep max_distance = "40.0"/>
        <leftwallstep max_distance = "40.0"/>
        <rightwallstep max_distance = "40.0"/>
        <leftwalkstep max_distance = "25.0"/>
        <rightwalkstep max_distance = "25.0"/>
        <leftcrouchwalkstep max_distance = "10.0"/>
        <rightcrouchwalkstep max_distance = "10.0"/>
        <land max_distance = "60.0"/>
        <land_soft max_distance = "30.0"/>
        <land_slide max_distance = "20.0"/>
        <slide max_distance = "30.0"/>
        <kick max_distance = "25.0"/>
        <sweep max_distance = "25.0"/>
        <jump max_distance = "40.0"/>
        <roll max_distance = "15.0"/>
        <edge_grab max_distance = "25.0"/>
        <edge_crawl max_distance = "15.0"/>
        <bodyfall max_distance = "80.0"/>
        <bodyfall_light max_distance = "40.0"/>
        <bodyfall_medium max_distance = "60.0"/>
        <bodyfall_heavy max_distance = "80.0"/>
        <weapon_drop_light max_distance = "80.0"/>
        <weapon_drop_medium max_distance = "80.0"/>
        <weapon_drop_heavy max_distance = "80.0"/>
        <blood_spatter max_distance = "30.0"/>
        <blood_drip max_distance = "20.0"/>
        <flip max_distance = "20.0"/>
        <choke_grab max_distance = "10.0"/>;
        <choke_move max_distance = "10.0"/>;
        <choke_fall max_distance = "10.0"/>;
    </events>
    <events mod="heavy">
        <leftrunstep max_distance = "50.0"/>
        <rightrunstep max_distance = "50.0"/>
        <leftwallstep max_distance = "50.0"/>
        <rightwallstep max_distance = "50.0"/>
        <leftwalkstep max_distance = "30.0"/>
        <rightwalkstep max_distance = "30.0"/>
        <leftcrouchwalkstep max_distance = "20.0"/>
        <rightcrouchwalkstep max_distance = "20.0"/>
        <land max_distance = "80.0"/>
        <land_soft max_distance = "40.0"/>
        <land_slide max_distance = "40.0"/>
        <kick max_distance = "30.0"/>
        <sweep max_distance = "30.0"/>
        <jump max_distance = "50.0"/>
        <roll max_distance = "25.0"/>
        <edge_grab max_distance = "40.0"/>
    </events>
</material>

Events element

<material>
    <events mod="soft">
        ...
    </events>
</material>

Contains a list of event elements that override default properties for this material.

Mod attribute

Optional - Specifies that this list of events only apply when the given material modifier is specified. TODO: what is a material modifier?

Event element

<material>
    <events>
        <leftrunstep soundgroup="Data/Sounds/concrete_foley/fs_light_concrete_run.xml" attached="true" max_distance = "40.0"/>
        ...
    </events>
</material>

The sound (and physical properties of the sound) for a given material interaction event. The name of the element corresponds to the name of the event (in this example, leftrunstep).

soundgroup attribute

Optional - Specifies the Sound Group XML for the material interaction event.

attached attribute

Optional - Boolean value. If true, the sound (group) will be played as a sound that is attached to the character that triggered the material event.

max_distance attribute

Optional - Decimal value. The max distance that the sound can be while still being made audible to the player.
If it is not specified for a given material event, then the corresponding value in Data/Materials/base.xml will be used instead.

Mod XML

TODO:

Music XML

TODO:

Nav Mesh Meta XML

TODO:

Object XML

TODO:

Particle XML

TODO:

Path XML

TODO:

Reaction XML

TODO:

Retarget XML

TODO:

Rig XML

TODO:

Shader Preload XML

TODO:

Sound Group XML

TODO:

Synced Animation Group XML

TODO:

Version Manifest XML

TODO:

Voice XML

TODO: