Classic Battlefield Modding Wikia
Tags: apiedit Visual edit
Tags: apiedit Visual edit
Line 1: Line 1:
  +
<blockquote>'''Understanding Navmesh Materials'''</blockquote><blockquote>The materials.mtl file defines the "materials" that represent something for a navmesh. The possible materials are "ground", "ladder', "water", and "deepwater". The different materials are shown as different colours: Green for ground, Yellow for water, Blue for deepwater and Red for Ladder material. </blockquote>
 
  +
[[File:3dsnew4.jpg|thumb|544x544px]]
<blockquote>WIP - Placeholder</blockquote><blockquote></blockquote><blockquote>have two special materials added to my max materials library, called Default and Default2:</blockquote><blockquote></blockquote>
 
  +
<blockquote>A navmesh created by BF2Editor will never have any faces under the "ladder" material. DICE tried to get the bots to use ladders but ran into problems. Since the ladder material already existed in BF2Editor, the Material Group for ladder (g ladder) and the "use material" entries for ladder (usemtl ladder) will always be created. To keep the bots from getting "stuck" DICE changed BF2Editor so that it would never create any faces with ladder material when it made a navmesh. Also, the bot AI code was changed so that if a bot touched a "ladder" it would "jump off" and go somewhere else.  Therefore the only usable materials for a Navmesh are "ground", "water", and "deepwater". <br>
 
  +
<br>
 
  +
'''How Materials are defined in the Navmesh''' <br>
 
  +
<br>
 
  +
The Infantry.obj or Vehicle.obj navmesh files use a materials.mtl files in the same folder. The materials.mtl file defines the "materials" used by the navmesh. The obj format can be read by any text editor such as Notepad. In the obj format, the materials are defined as follows:</blockquote><blockquote>- All of the Material Groups <br>
 
  +
g ground <br>
 
  +
g ladder <br>
 
  +
g water <br>
 
<blockquote><br>
+
g deepwater <br>
  +
<br>
the easiest way to create these is to just import a navmesh, then use the 'get material' eyedropper on it. set the colours as shown to make it easier to understand which material is which, and i have mine set to 50% transparency so that overlaps etc. are easier to spot. the Default2 material is identical except for the colour-shift; i use that one for preopt and manifold objects, so i can have these and the navmesh both visible at the same time and still tell which object is which. Every time i import a new navmesh, i get these materials from the library and apply Default to both the Infantry/Vehicle meshes and go on from there.</blockquote>
 
  +
- All of the materials Used to make a "Face" <br>
  +
usemtl ground <br>
  +
usemtl ladder <br>
  +
usemtl water <br>
  +
usemtl deepwater </blockquote><blockquote>An .obj file from BF2Editor will have each Material Group with the material directly below it because BF2Editor "gathers" all the entries of the same material together. <br>
  +
i.e. <br>
  +
g ground <br>
  +
usemtl ground <br>
  +
<br>
  +
<br>
  +
Every Face entry under a "usemtl" line all use the material at the top of the list. <br>
  +
i.e. <br>
  +
g ground <br>
  +
</blockquote><blockquote>usemtl ground </blockquote><blockquote>'''Setting Materials in 3dsmax'''</blockquote><blockquote>For minor edits to a Navmesh, the materials will normally not need to be edited. But, for major editing, it is easier to import a navmesh with the needed materials, then use the 'get material' eyedropper on it. set the colors as shown to make it easier to understand which material is which. A setting of 50% transparency is useful so that overlaps etc. are easier to spot. </blockquote>
  +
[[File:Materia editor.png|thumb|952x952px]]
 
<blockquote>A useful tip for major editing in 3dsMax, is to add two special materials to your max materials library, called Default and Default2, The Default2 material is identical except for the colour-shift; to use for preopt and manifold objects, in order to have these and the navmesh both visible at the same time and still tell which object is which. Every time you import a new navmesh, get these materials from the library and apply Default to both the Infantry/Vehicle meshes and go on from there.</blockquote><blockquote><br></blockquote>

Revision as of 02:03, 31 October 2016

Understanding Navmesh Materials

The materials.mtl file defines the "materials" that represent something for a navmesh. The possible materials are "ground", "ladder', "water", and "deepwater". The different materials are shown as different colours: Green for ground, Yellow for water, Blue for deepwater and Red for Ladder material.

3dsnew4.jpg

A navmesh created by BF2Editor will never have any faces under the "ladder" material. DICE tried to get the bots to use ladders but ran into problems. Since the ladder material already existed in BF2Editor, the Material Group for ladder (g ladder) and the "use material" entries for ladder (usemtl ladder) will always be created. To keep the bots from getting "stuck" DICE changed BF2Editor so that it would never create any faces with ladder material when it made a navmesh. Also, the bot AI code was changed so that if a bot touched a "ladder" it would "jump off" and go somewhere else.  Therefore the only usable materials for a Navmesh are "ground", "water", and "deepwater".


How Materials are defined in the Navmesh 

The Infantry.obj or Vehicle.obj navmesh files use a materials.mtl files in the same folder. The materials.mtl file defines the "materials" used by the navmesh. The obj format can be read by any text editor such as Notepad. In the obj format, the materials are defined as follows:

- All of the Material Groups 

g ground 
g ladder 
g water 
g deepwater 

- All of the materials Used to make a "Face" 
usemtl ground 
usemtl ladder 
usemtl water 

usemtl deepwater 

An .obj file from BF2Editor will have each Material Group with the material directly below it because BF2Editor "gathers" all the entries of the same material together. 

i.e. 
g ground 
usemtl ground 


Every Face entry under a "usemtl" line all use the material at the top of the list. 
i.e. 
g ground 

usemtl ground 

Setting Materials in 3dsmax

For minor edits to a Navmesh, the materials will normally not need to be edited. But, for major editing, it is easier to import a navmesh with the needed materials, then use the 'get material' eyedropper on it. set the colors as shown to make it easier to understand which material is which. A setting of 50% transparency is useful so that overlaps etc. are easier to spot.

Materia editor.png

A useful tip for major editing in 3dsMax, is to add two special materials to your max materials library, called Default and Default2, The Default2 material is identical except for the colour-shift; to use for preopt and manifold objects, in order to have these and the navmesh both visible at the same time and still tell which object is which. Every time you import a new navmesh, get these materials from the library and apply Default to both the Infantry/Vehicle meshes and go on from there.