GameTools material.xml

From Wikiid
Revision as of 21:03, 23 October 2007 by SteveBaker (Talk | contribs) (New page: The file 'material.xml' (in the 'data' directory) lists the names of texture maps - which when they appear in the game are treated somehow specially. Ideally, this kind of information woul...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The file 'material.xml' (in the 'data' directory) lists the names of texture maps - which when they appear in the game are treated somehow specially. Ideally, this kind of information would come from whatever 3D modeller program you use - but in reality there is somewhat patchy support for the kinds of additional data the game needs.

For example - the game needs to know that water polygons are special because some objects such as boats can float on water and others cannot. There is no clear way to know what's water and what isn't from the data we get from the modeller so we look up the name of the texture map in this 'material.xml' file and see if it's marked as being special.

Texture maps that are not listed here are treated as plain, ordinary surfaces with no special properties - so you only have to list the special stuff.

Example

Here is an example of a 'material.xml' file:

 <?xml version="1.0" ?>
 <matlist>
   <material name="leaves" collide="false" />
   <material name="ocean"  collide="false" texture_velocity="0 0.24 0" water_surface="true" />
 </matlist>

Structure

Since this is an XML 'material' file, the first three lines must always be:

 <?xml version="1.0" ?>
 <matlist>

...and the last line is always:

 </matlist>

Between those tags are a number of material setup commands:

 <material name="XXX" ... />

XXX is the name of the texture map - without its path-name and without a file extension. Any polygons with a texture that matches that name will take on whatever properties are listed in this record:

collide="boolean
Can this object pose an obstacle to things moving through it. Leaves, smoke, water do not and should be set to "false" - the default is "true".
texture_velocity="u v w
If this attribute is set, the texture will move across the surface at the specified rate in meters per second in the U, V and W directions (W should currently always be zero because we only have 2D textures.
water_surface="boolean
Set "true" if these polygons represent a water surface. Since these will generally have collide="false" set, objects will only collide with them if the object is floating.


Wikiid Pages relating to gameTools (edit)
gameTools - Main page
gameTools - Support Tools :
plb_to_ac3d, mklevel, mktile, mktree, tiled, autogen_java, mk3dgallery
gameTools - File Formats :
title_screen.rgb, ultimate.xml, material.xml, decoration.xml, physics.xml
tiled.xml, tiled_autotiles.xml, Level files, Tile naming scheme, PLB files
gameTools - Source Code :
Game functions: gameCamera, gameClock, gameChecksum/gameHashTable, gameHTTP,
gameIsect, gameJoystick, gameParticleManager, gameScreen/gameMouse,
gameSky, gameStarter, gameStrokeFont, gameUtils
Material database: MatList/MatEntry
Tile map handling: TileObject/MapFlag/MapEntry/Map
Java Interfacing: JavaLink
Image file loading: liImage/liImageFactory
3D Model file loading: loadPLB, PLB exporter
Physics: Sabot, Bullet, gameTools - Use with Blender, PLB exporter
Object management: Object


Wikiid Pages relating to Lemur of Lima (edit)
Lemur of Lima - Main page
Lemur of Lima - Controls
Lemur of Lima - Levels :
List of Levels, Level design, Screen shots, Models
Lemur of Lima - Java Plugins :
Java plugin API, Event handling, Flags, GameInterface API , Alphabetical Index
Lemur of Lima - Source Code Documentation :
Initialisation, Main Loop, gameTools