Difference between revisions of "3D Objects"

From Wolfire Games Wiki
Jump to: navigation, search
(Deprecated tags: Removed "or will have no effect if used", they should simply not be used.)
m (Tags)
(37 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
<?xml version="1.0" ?>
 
<?xml version="1.0" ?>
 
<Object>
 
<Object>
<Model>Data/Custom/Markuss/Examples/Models/SimpleObject.obj</Model>
+
<Model>Data/Mods/example_mod/Data/Models/SimpleObject.obj</Model>
<ColorMap>Data/Custom/Markuss/Examples/Textures/SimpleObject_Color.tga</ColorMap>
+
<ColorMap>Data/Mods/example_mod/Data/Textures/SimpleObject_Color.tga</ColorMap>
<NormalMap>Data/Custom/Markuss/Examples/Textures/Blank_Norm.tga</NormalMap>
+
<NormalMap>Data/Mods/example_mod/Data/Textures/Blank_Norm.tga</NormalMap>
 
   <ShaderName>cubemap</ShaderName>
 
   <ShaderName>cubemap</ShaderName>
 
<MaterialPath>Data/Materials/default.xml</MaterialPath>
 
<MaterialPath>Data/Materials/default.xml</MaterialPath>
Line 20: Line 20:
  
 
=== Model and Texture Requirements ===
 
=== Model and Texture Requirements ===
[[Image:SimpleObject.jpg|thumb|Simple object and texture UV layout]]
+
* Only quads and triangles in models
 +
* Models use the Wavefront .obj format
 +
* Textures need to be square
 +
* Texture resolution need to be a power of two (32x32, 64x64, 128x128 and so on)
 +
* The .tga format is recommended for textures, but .png and .tif work also.
  
Models need to be constructed from quads and triangles only and be saved in the Wavefront .obj format. Textures need to be square and their resolution need to be a power of two, so 32x32 works, 32x64 does not work (since it's not square) and 31x31 does not work (since 31 is not a power of two). Textures can be in .png, .tga or .tif format.
+
==== Converting normal maps ====
 +
The normal maps that you get from some applications might not be instantly usable in the Phoenix engine without some edits. For instance, if you are using an object space normal map from Xnormal you need to do this:
 +
 
 +
1. Swap blue and green channels
 +
2. Invert red and blue channels
 +
 
 +
You an do this in Photoshop, Substance Designer or similar. Note that using Gimp for this will destroy your alpha channel, so it is not recommended to use this.
  
 
== Object .xml File ==
 
== Object .xml File ==
Line 49: Line 59:
 
|-
 
|-
 
! flags
 
! flags
| <flags no_collision=true double_sided=true/> || Used to set boolean values on the object
+
| <flags no_collision=true double_sided=true/> || Used to set boolean values on the object (see [[#Flags|flags]])
 
|}
 
|}
  
Line 71: Line 81:
 
|-
 
|-
 
! no_collision
 
! no_collision
| Disables physics collisions with this object
+
| Disables physics collisions with this object.
 
|-
 
|-
 
! double_sided
 
! double_sided
 
| The backsides of the object gets rendered as well.
 
| The backsides of the object gets rendered as well.
 +
|-
 +
! bush_collision
 +
| Makes the object give some resistance when passed through while the object wobbles a bit and generates leaf particles. If a character jumps into this object at high enough speed they will ragdoll.
 
|}
 
|}
  
==Alternative object System==
+
==Collision/Physics Objects==
The engine automatically generates a simplified physics object and uses the object’s UV layout to place the shadow maps, these can be overridden by providing alternative .OBJ files that contain the desired information. These objects are placed in the same folder and share the same name as the original .OBJ file with a suffix to tell the engine what data they hold:
+
The engine automatically generates a simplified physics object from your model but this can be overridden by providing an alternative .OBJ file. The file is placed in the same folder and shares the same name as the original .OBJ file with a suffix:
  
 
===Suffixes===
 
===Suffixes===
'''YourObject_COL.obj''' - contains simplified geometry for physics calculations
+
[[Image:PhysicsObject.jpg|thumb|Physics mesh should be placed on top of the render mesh]]
 +
[[Image:HullObject.jpg|thumb|Hull objects are placed over render mesh like physics objects]]
 +
{| class="wikitable"
 +
|-
 +
! Suffix !! Description
 +
|-
 +
! <span style="color: gray">YourObject</span>_COL.obj
 +
| Contains simplified geometry for physics calculations.
 +
|-
 +
! <span style="color: gray">YourObject</span>HULL.obj
 +
| Same as _COL but has extra info, used with weapons.
 +
|}
 +
 
 +
Note HULL doesn’t have an underscore to separate it from the file name!
 +
 
 +
===Physics objects (_COL)===
 +
Simplified geometry such as boxes an cylinders which are used for collision detection, they are aligned to your object based on “relative position” in your 3D program so you should place the physics mesh on top of your render mesh upon export.
 +
 
 +
===Hull objects (HULL)===
 +
They are very similar to physics objects but are used for items and weapons, the only difference is that they contain a free-floating triangle which defines the object’s center of gravity.
 +
 
 +
==Shaders==
 +
There are two texture maps that are required for an object to be loaded in the engine. Those are the '''ColorMap''' and the '''NormalMap''' textures. Some shaders allow - but do not require - for additional maps to be specified for different purposes. Shaders with "obj" in their name expect the supplied NormalMap texture to be in object space, those without expect tangent space.
  
'''YourObject.obj_UV2''' - contains same object but with no overlapping UVs
+
Here are the most common channel designations of the ColorMap and NormalMap textures:
  
'''YourObjectHULL.obj''' - same as _COL but has extra info, used with weapons
+
<u>'''ColorMap'''</u><br />
 +
'''RGB''' - Color<br />
 +
'''A''' - Reflectivity
  
''NOTE:''
+
<u>'''NormalMap'''</u><br />
 +
'''RGB''' - Normal<br />
 +
'''A''' - Color tint mask
  
''The suffix formats are inconsistent, _COL is placed before the file extension while _UV2 is place after, and HULL doesn’t even have an underscore to separate it from the file name!''
+
Any deviations from this standard for any shader in the table below can be seen in the ''Non-standard channel designation'' column. This includes any optional textures.
  
===Physics objects (_COL)===
+
{| class="wikitable"
[[Image:PhysicsObject.jpg|thumb|Physics mesh should be placed on top of the render mesh]]
+
|-
 +
! Tag !! Non-standard channel designation !! Description
 +
|-
 +
! cubemap
 +
|
 +
|| Standard shader.
 +
|-
 +
! cubemapobj
 +
|
 +
|| Same as Cubemap but uses object-space normal maps instead of tangent space.
 +
|-
 +
! cubemapobjitem
 +
|
 +
|| Object space version of CubemapItem.
 +
|-
 +
! cubemapalpha
 +
|
 +
<u>'''ColorMap'''</u><br />
 +
'''A''' - Transparency
 +
 
 +
<u>'''NormalMap'''</u><br />
 +
'''A''' - Reflectivity
 +
||
 +
[[Image:CubemapAlpha.jpg|thumb|cubemapalpha shader]]
 +
Texels that do not have a transparency of 0.0 or 1.0 have depth sorting issues with each other.
 +
|-
 +
! cubemapobjchar
 +
|
 +
<u>'''NormalMap'''</u><br />
 +
'''A''' - Sun fresnel mask
 +
|| Intended for use with characters, shine is sharp, uses object space normals. The sun fresnel effect brightens up the edges of the object when it is between the camera and the sun.
 +
|-
 +
! plant
 +
|
 +
<u>'''ColorMap'''</u><br />
 +
'''A''' - Transparency
 +
 
 +
<u>'''NormalMap'''</u><br />
 +
'''A''' - No effect
  
Simplified geometry such as boxes an cylinders which are used for collision detection, they are aligned to your object based on “relative position” in your 3D program so you should place the physics mesh on top of your render mesh upon export.
+
<u>'''TranslucencyMap'''</u><br />
 +
'''RGB''' - Translucency color<br />
 +
'''A''' - No effect
  
===Shadow UV objects (_UV2)===
+
<u>'''WindMap'''</u><br />
[[Image:UVObject.jpg|thumb|Color texture UVs left, shadow UVs right, each face needs its own UV space]]
+
'''R''' - Wind mask<br />
 +
'''GBA''' - No effect
 +
|| [[Image:Translucency.jpg|thumb|plant shader]]
 +
Has transparency like cubemapalpha but no reflectivity.
  
These objects tell the engine how to place the shadow map on the rendered object if the original UV layout isn’t appropriate, the shadow maps require UV layouts with no over-lapping faces, this can usually be achieved using the “automatic unwrapping” tools found in most 3D applications.
+
The '''TranslucencyMap''' texture adds its color to the surface multiplied by the amount of light it receives, this effect ignores the normal of the surface, so if one side receives light from for instance the sun, the other side will also get the color added. If unspecified it defaults to 0.0 (no translucency) across the entire surface.
  
===Hull objects (HULL)===
+
The '''WindMap''' texture defines intensity of a vertex wind effect. If unspecified it defaults to 1.0 (active) across the entire surface.
[[Image:HullObject.jpg|thumb|Hull objects are placed over render mesh like physics objects]]
+
|}
They are very similar to physics objects but are used for items and weapons, the only difference is that they contain a free-floating triangle which defines the object’s center of gravity.
 
  
 +
==Materials==
 +
These are the materials that can be assigned to objects. These only work on terrains and not on objects placed in the world.
  
==Items and Weapons==
+
* Cloth_Fabric
[[Image:Weapons.jpg|thumb|Example weapons, handles show the location of characters hands]]
+
* Cloth_Leather
 +
* Default
 +
* Dirt
 +
* DirtyRock
 +
* Drygrass
 +
* Grass
 +
* Gravel
 +
* Rock
 +
* Rocks
 +
* Sand
 +
* Snow
 +
* Wood
  
Items and Weapons are aligned to the character based on their position relative to the center of the scene in your 3D app, you should load the .obj files of the example objects for reference. To make an object “pick-up-able” you need another .XML file that you load in place of the regular object properties file, it stores the info needed that is not defined in the regular object properties file:
+
==Items==
 +
Items are things that a character can pick up in the game, a large part of the items in the game are weapons. An item .xml file is needed to make an object into an item. The item .xml files that come with the game can be found in ../Overgrowth/Data/Items/. Items are picked up by their center point.
  
 +
As an example, here is the item .xml file for the flint_knife weapon that comes with the game:
 
<pre>
 
<pre>
 
<?xml version="1.0" ?>
 
<?xml version="1.0" ?>
 
<item>
 
<item>
 
     <type>weapon</type>
 
     <type>weapon</type>
     <appearance obj_path = "Data/Custom/Markuss/Examples/1-Handed.xml"/>
+
     <appearance obj_path = "Data/Objects/Weapons/flint_knife.xml"/>
 
     <grip ik_attach = "rightarm"
 
     <grip ik_attach = "rightarm"
           anim = "Data/Animations/r_dogweapongrip.anm"/>
+
           anim = "Data/Animations/r_dogweapongrip.anm"
     <physics mass = "1 kg"/>
+
  hands = "1"/>
 +
    <sheathe ik_attach = "hip"
 +
          anim = "Data/Animations/r_dogweaponsheathed.anm"/>
 +
     <physics mass = "0.4 kg"/>
 +
    <points>
 +
        <pommel x="0" y="-0.081" z="0"/>
 +
        <guard x="0" y="0.10" z="0"/>
 +
        <tip x="0" y="0.33" z="0"/>
 +
    </points>
 +
    <label>knife</label>
 +
    <lines>
 +
        <wood start="pommel" end="guard"/>
 +
        <metal start="guard" end="tip"/>
 +
    </lines>
 +
    <anim_override idle = "Data/Animations/r_knifestancerear.xml"
 +
                  movement = "Data/Animations/r_weaponmovestance.xml"/>
 +
    <attack_override moving = "Data/Attacks/knifeslash.xml"
 +
                    moving_close = "Data/Attacks/knifeslash.xml"
 +
                    stationary = "Data/Attacks/knifeslash.xml"
 +
                    stationary_close = "Data/Attacks/knifeslash.xml"/>
 +
    <range multiply = "0.8"/>
 
</item>
 
</item>
 
</pre>
 
</pre>
Item properties file
 
  
 
===Tags===
 
===Tags===
'''<type>''' - defines what type of item the object is.
+
{| class="wikitable"
 
+
|-
'''<appearance obj_path>''' - links to the regular object definition file.
+
! Tag !! Example use !! Description
 
+
|-
'''<grip ik_attach anim>''' - defines what bone the object is attached to, links to an animation file.
+
! type
 
+
|
'''<physics mass>''' - changes the pitch(?) of the sound made by the object hitting things.
+
<pre><type>weapon</type></pre>
 
+
|| Defines what kind of item the object is. Can be ''weapon'', ''collectible'' or ''misc''.
'''<anim_override idle>''' - overrides the idle animation of a character holding the item.
+
|-
 
+
! appearance
''NOTE:''
+
|
 
+
<pre><appearance
''Not sure what the animation file in <grip ik_attach anim> does.''
+
    obj_path="Data/Objects/Weapons/MyWeapon.xml"/></pre>
 
+
|| Path to the object .xml file to use as a visual representation of this item.
''<anim_override idle> is only used for 2-handed weapons at the moment.''
+
|-
 
+
! grip
''NOTE:''
+
|
 
+
<pre><grip
''There is a bug that makes weapons turn invisible when loading levels with them already in it, you can fix this by having the “regular-object" version somewhere in the level as well.''
+
    ik_attach="rightarm"
 
+
    anim="Data/Animations/r_dogweapongrip.anm"/></pre>
==Shaders==
+
|| ik_attach defines what bone the object is attached to when it's held. Anim is the place where the weapon will be held at. You create these in blender using one of the existing rigs that comes with the game (preferably the rabbit_rig).
'''Cubemap''' – closest thing to a “standard shader”, it has a cube-map based on the sky texture and a specular shine, the visibility of the cube map and shine is controlled with color texture’s alpha channel, white = fully reflective and shiny. Similarly, the normal-map texture’s alpha channel controls where color tinting happens, white = full effect. The cube map’s visibility is inversely affected by the brightness of the texture, you should make the color texture close to black for materials that are reflective such as chrome and glass.
+
|-
 
+
! sheathe
'''CubemapObj''' - same as Cubemap but uses object-space normal maps instead of tangent space.
+
|
 
+
<pre><sheathe
'''CubemapItem''' - same as Cubemap but the shine is sharper.
+
    ik_attach="hip"
 
+
    anim="Data/Animations/r_dogweaponsheathed.anm"/></pre>
'''CubemapObjItem''' - object-space version of CubemapItem.
+
|| ik_attach defines where to attach the object when sheathed. Anim is the place where the weapon will be sheathed at. You create these in Blender using one of the existing rigs that the game comes with (preferably the rabbit_rig).
 
+
|-
[[Image:CubemapAlpha.jpg|thumb|CubemapAlpha]]
+
! physics
'''CubemapAlpha''' - has transparency controlled by the color texture’s alpha channel, cube map and shine are controlled by the normal-map texture’s alpha channel instead. CubemapAlpha has depth sorting issues with other transparent objects, enabling anti-aliasing fixes this somewhat.
+
|
 
+
<pre><physics mass="1 kg"/></pre>
'''CubemapObjChar''' - used for characters, shine is sharp, uses object space normals. There is no tangent-space version of CubemapObjChar and no object-space version of CubemapAlpha at the moment.
+
|| Changes the pitch of the sound made by the object hitting things. Also changes how overall heavy it is.
 
+
|-
[[Image:Translucency.jpg|thumb|Translucency (Plant Shader)]]
+
! points
'''Plant''' - has transparency like CubemapAlpha but no cube map/shine. Translucency texture increases the brightness of the object while ignoring diffuse lighting, black = no effect. Wind texture defines intensity of a vertex ripple effect, black = no ripple. Both textures are linked in the object definition file using the <TranslucencyMap> and <WindMap> tags.
+
|
 
+
<pre><points>
==Materials==
+
    <pommel x="0" y="-0.081" z="0"/>
[[Image:Materials.jpg|thumb|Sound tiles]]
+
    <guard x="0" y="0.10" z="0"/>
These are the sounds made and the particles emitted when you hit an object. I’ve set up some tiles for you to walk on to preview each material, here is a list:
+
    <tip x="0" y="0.33" z="0"/>
 
+
</points></pre>
: Cloth_Fabric
+
|| Defines a number of points on the weapon that can be used with the ''lines'' element to define what material a part of the weapon has.
: Cloth_Leather
+
|-
: Default
+
! lines
: Dirt
+
|
: DirtyRock
+
<pre><lines>
: Drygrass
+
    <wood start="pommel" end="guard"/>
: Grass
+
    <metal start="guard" end="tip"/>
: Gravel
+
</lines></pre>
: Rock
+
|| Defines what materials go between what points that are defined in the points tag.
: Rocks
+
|-
: Sand
+
! anim_override
: Snow
+
|
: Wood
+
<pre><anim_override
 
+
    idle="Data/Animations/r_weaponidlestance.xml"/></pre>
Note that some of these don’t emit particles.
+
|| Overrides animations of a character holding the item. Animation keywords that can be overridden are idle and movement (maybe more). This is used for for instance two handed weapons, spears and so on, where the default animation looks weird.
 +
|-
 +
! attack_override
 +
|
 +
<pre><attack_override
 +
    moving="Data/Attacks/knifeslash.xml"
 +
    moving_close="Data/Attacks/knifeslash.xml"
 +
    stationary="Data/Attacks/knifeslash.xml"
 +
    stationary_close="Data/Attacks/knifeslash.xml"/></pre>
 +
|| What attacks should be used with this weapon in different contexts.
 +
|-
 +
! range
 +
|
 +
<pre><range multiply="0.8"/></pre>
 +
|| Multiply multiplies the range with the specified value to make a weapon reach further or shorter.
 +
|}

Revision as of 17:34, 5 October 2017

based on this forum post by member Markuss. There is a linked .zip file attached to the forum post. it can be found here: http://www.markstockton.com/misc/Guide/Examples.zip

Introduction

Phoenix uses .xml files to store information about what textures a certain model should use as well as other information such as what shader it should use. This is the file you choose when loading an object. Here is an example object .xml file:

<?xml version="1.0" ?>
<Object>
	<Model>Data/Mods/example_mod/Data/Models/SimpleObject.obj</Model>
	<ColorMap>Data/Mods/example_mod/Data/Textures/SimpleObject_Color.tga</ColorMap>
	<NormalMap>Data/Mods/example_mod/Data/Textures/Blank_Norm.tga</NormalMap>
  	<ShaderName>cubemap</ShaderName>
	<MaterialPath>Data/Materials/default.xml</MaterialPath>
</Object>

All object .xml files that ship with the game are located in ../Overgrowth/Data/Objects/.

Model and Texture Requirements

  • Only quads and triangles in models
  • Models use the Wavefront .obj format
  • Textures need to be square
  • Texture resolution need to be a power of two (32x32, 64x64, 128x128 and so on)
  • The .tga format is recommended for textures, but .png and .tif work also.

Converting normal maps

The normal maps that you get from some applications might not be instantly usable in the Phoenix engine without some edits. For instance, if you are using an object space normal map from Xnormal you need to do this:

1. Swap blue and green channels
2. Invert red and blue channels

You an do this in Photoshop, Substance Designer or similar. Note that using Gimp for this will destroy your alpha channel, so it is not recommended to use this.

Object .xml File

The object .xml files contain all information about a single object (model) that can be spawned in the engine. This aims to be a full reference over all tags and flags that can be used in an object .xml.

Tags

Note: This list is incomplete.

Tag Example use Description
Model <Model>Data/Models/MyModel.obj</Model> path to the model file (.obj)
ColorMap <ColorMap>Data/Textures/MyColorMap.tga</ColorMap> path to the color texture file (.tga, .tif or .png)
NormalMap <NormalMap>Data/Textures/MyNormalMap.tga</NormalMap> Path to the normal map texture file (.tga, .tif or .png)
ShaderName <ShaderName>cubemapobj</ShaderName> Name of shader to use from ../Overgrowth/Data/GLSL/ (.frag and .vert)
MaterialPath <MaterialPath>Data/Materials/DirtyRock.xml</MaterialPath> Path to the material to be used
flags <flags no_collision=true double_sided=true/> Used to set boolean values on the object (see flags)

Deprecated tags

These tags are deprecated and should not be used.

Tag Example use Description
ShaderPath <ShaderPath>Data/GLSL/cubemapobj</ShaderPath> path to the shader to use (.frag & .vert), replaced by ShaderName

Flags

Flags are entered as boolean attributes in an element called "flags" that is located under the "Object" element. For more information about the "flags" tag, look under tags. All flags have a default value of false.

Flag Description
no_collision Disables physics collisions with this object.
double_sided The backsides of the object gets rendered as well.
bush_collision Makes the object give some resistance when passed through while the object wobbles a bit and generates leaf particles. If a character jumps into this object at high enough speed they will ragdoll.

Collision/Physics Objects

The engine automatically generates a simplified physics object from your model but this can be overridden by providing an alternative .OBJ file. The file is placed in the same folder and shares the same name as the original .OBJ file with a suffix:

Suffixes

Physics mesh should be placed on top of the render mesh
Hull objects are placed over render mesh like physics objects
Suffix Description
YourObject_COL.obj Contains simplified geometry for physics calculations.
YourObjectHULL.obj Same as _COL but has extra info, used with weapons.

Note HULL doesn’t have an underscore to separate it from the file name!

Physics objects (_COL)

Simplified geometry such as boxes an cylinders which are used for collision detection, they are aligned to your object based on “relative position” in your 3D program so you should place the physics mesh on top of your render mesh upon export.

Hull objects (HULL)

They are very similar to physics objects but are used for items and weapons, the only difference is that they contain a free-floating triangle which defines the object’s center of gravity.

Shaders

There are two texture maps that are required for an object to be loaded in the engine. Those are the ColorMap and the NormalMap textures. Some shaders allow - but do not require - for additional maps to be specified for different purposes. Shaders with "obj" in their name expect the supplied NormalMap texture to be in object space, those without expect tangent space.

Here are the most common channel designations of the ColorMap and NormalMap textures:

ColorMap
RGB - Color
A - Reflectivity

NormalMap
RGB - Normal
A - Color tint mask

Any deviations from this standard for any shader in the table below can be seen in the Non-standard channel designation column. This includes any optional textures.

Tag Non-standard channel designation Description
cubemap Standard shader.
cubemapobj Same as Cubemap but uses object-space normal maps instead of tangent space.
cubemapobjitem Object space version of CubemapItem.
cubemapalpha

ColorMap
A - Transparency

NormalMap
A - Reflectivity

cubemapalpha shader

Texels that do not have a transparency of 0.0 or 1.0 have depth sorting issues with each other.

cubemapobjchar

NormalMap
A - Sun fresnel mask

Intended for use with characters, shine is sharp, uses object space normals. The sun fresnel effect brightens up the edges of the object when it is between the camera and the sun.
plant

ColorMap
A - Transparency

NormalMap
A - No effect

TranslucencyMap
RGB - Translucency color
A - No effect

WindMap
R - Wind mask
GBA - No effect

plant shader

Has transparency like cubemapalpha but no reflectivity.

The TranslucencyMap texture adds its color to the surface multiplied by the amount of light it receives, this effect ignores the normal of the surface, so if one side receives light from for instance the sun, the other side will also get the color added. If unspecified it defaults to 0.0 (no translucency) across the entire surface.

The WindMap texture defines intensity of a vertex wind effect. If unspecified it defaults to 1.0 (active) across the entire surface.

Materials

These are the materials that can be assigned to objects. These only work on terrains and not on objects placed in the world.

  • Cloth_Fabric
  • Cloth_Leather
  • Default
  • Dirt
  • DirtyRock
  • Drygrass
  • Grass
  • Gravel
  • Rock
  • Rocks
  • Sand
  • Snow
  • Wood

Items

Items are things that a character can pick up in the game, a large part of the items in the game are weapons. An item .xml file is needed to make an object into an item. The item .xml files that come with the game can be found in ../Overgrowth/Data/Items/. Items are picked up by their center point.

As an example, here is the item .xml file for the flint_knife weapon that comes with the game:

<?xml version="1.0" ?>
<item>
    <type>weapon</type>
    <appearance obj_path = "Data/Objects/Weapons/flint_knife.xml"/>
    <grip ik_attach = "rightarm"
          anim = "Data/Animations/r_dogweapongrip.anm"
		  hands = "1"/>
    <sheathe ik_attach = "hip"
          anim = "Data/Animations/r_dogweaponsheathed.anm"/>
    <physics mass = "0.4 kg"/>
    <points>
        <pommel x="0" y="-0.081" z="0"/>
        <guard x="0" y="0.10" z="0"/>
        <tip x="0" y="0.33" z="0"/>
    </points>
    <label>knife</label>
    <lines>
        <wood start="pommel" end="guard"/>
        <metal start="guard" end="tip"/>
    </lines>
    <anim_override idle = "Data/Animations/r_knifestancerear.xml"
                   movement = "Data/Animations/r_weaponmovestance.xml"/>
    <attack_override moving = "Data/Attacks/knifeslash.xml"
                     moving_close = "Data/Attacks/knifeslash.xml"
                     stationary = "Data/Attacks/knifeslash.xml"
                     stationary_close = "Data/Attacks/knifeslash.xml"/>
    <range multiply = "0.8"/>
</item>

Tags

Tag Example use Description
type
<type>weapon</type>
Defines what kind of item the object is. Can be weapon, collectible or misc.
appearance
<appearance
    obj_path="Data/Objects/Weapons/MyWeapon.xml"/>
Path to the object .xml file to use as a visual representation of this item.
grip
<grip
    ik_attach="rightarm"
    anim="Data/Animations/r_dogweapongrip.anm"/>
ik_attach defines what bone the object is attached to when it's held. Anim is the place where the weapon will be held at. You create these in blender using one of the existing rigs that comes with the game (preferably the rabbit_rig).
sheathe
<sheathe
    ik_attach="hip"
    anim="Data/Animations/r_dogweaponsheathed.anm"/>
ik_attach defines where to attach the object when sheathed. Anim is the place where the weapon will be sheathed at. You create these in Blender using one of the existing rigs that the game comes with (preferably the rabbit_rig).
physics
<physics mass="1 kg"/>
Changes the pitch of the sound made by the object hitting things. Also changes how overall heavy it is.
points
<points>
    <pommel x="0" y="-0.081" z="0"/>
    <guard x="0" y="0.10" z="0"/>
    <tip x="0" y="0.33" z="0"/>
</points>
Defines a number of points on the weapon that can be used with the lines element to define what material a part of the weapon has.
lines
<lines>
    <wood start="pommel" end="guard"/>
    <metal start="guard" end="tip"/>
</lines>
Defines what materials go between what points that are defined in the points tag.
anim_override
<anim_override
    idle="Data/Animations/r_weaponidlestance.xml"/>
Overrides animations of a character holding the item. Animation keywords that can be overridden are idle and movement (maybe more). This is used for for instance two handed weapons, spears and so on, where the default animation looks weird.
attack_override
<attack_override
    moving="Data/Attacks/knifeslash.xml"
    moving_close="Data/Attacks/knifeslash.xml"
    stationary="Data/Attacks/knifeslash.xml"
    stationary_close="Data/Attacks/knifeslash.xml"/>
What attacks should be used with this weapon in different contexts.
range
<range multiply="0.8"/>
Multiply multiplies the range with the specified value to make a weapon reach further or shorter.