Surface Types: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
 
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Original_Reference|Ishtvan|2974}}
{{Original_Reference|Ishtvan|2974}}


Okay, adding the new surface types wasn't as easy as I thought, but I have put in a system for it and it works. This is subject to change. However, unless people really don't like this, I think we can go with this.
= What are Surfaces Types? =
 
'''Surfaces types''' are used to tell what sound to play when you walk on a surface (this code is already in D3, we just have to tell it what sounds to play and how loud those sounds should be to AI). They are also used when objects collide or a projectile hits a surface, to play a specific sound, give off a specific particle effect, or to trigger a specific action (rope arrow only sticks in wood; only "climbable" surfaces can be climbed).
 
They also determine armor factors in combat (an arrow will bounce off the AI's helmet, but if you shoot it right into the eye opening, it will hurt).
 
Doom 3 had a limited list of only 16 surface types. To support the wildly different surfaces that TDM needs, we expanded that system by using a small trick. This article explains what types you can use, and how.
 
= Old (D3) Surface Types =


The following surfaces are standard D3 surfaces. We cannot change the name of these even if we wanted to.
The following surfaces are standard D3 surfaces. We cannot change the name of these even if we wanted to.


= Old (D3) Surface Types =
Put one of these in the first line of the .mtr definition:
Put these in the first line of the .mtr file


* none
* none
Line 18: Line 25:
* plastic
* plastic
* ricochet
* ricochet
* surftype10
* surftype10 (??)
* surftype11
* surftype11 (??)
* surftype12
* surftype12 (??)
* surftype13
* surftype13 (??)
* surftype14
* surftype14 (??)


= New (unique to TDM) surface types =  
= New (unique to TDM) surface types =  
Use surftype15 and put surface in description string (this list is not fixed, we can keep adding to it):
 
Use ''surftype15''' and put surface in description string (this list is not fixed, we can keep adding to it):


* tile
* tile
Line 51: Line 59:
* armor_chain
* armor_chain
* armor_plate
* armor_plate
* undeadbone
* undeadflesh (like flesh, but less vulnerable to mundane damage)
* paper
* hardwood


= Instructions on putting in new surfaces =
= Instructions on putting in new surfaces =
We had to do some tricks to expand the list of surfaces. In the material file, put '''surftype15''' as the first line. Then, in the "description" line, put the new surface type in quotes. If you want to add anything after that, that's fine, just make sure the surface type is the first thing in the description, and you put a space after it.
 
In the material file, put "'''surftype15''' " as the first line. Then, in the "description" line, put the new surface type in quotes. If you want to add anything after that, that's fine, just make sure the surface type is the first thing in the description, and you put a space after it.


NOTE: Old surfaces can be entered the same way as new surfaces, but it decreases performance
NOTE: Old surfaces can be entered the same way as new surfaces, but it decreases performance
Line 63: Line 76:
  {     
  {     
     wood
     wood
 
     qer_editorimage  textures/darkmod/mansion/floor/manfloor03.tga
     qer_editorimage  textures/darkmod/mansion/floor/manfloor03.tga
     diffusemap      textures/darkmod/mansion/floor/manfloor03.tga       
     diffusemap      textures/darkmod/mansion/floor/manfloor03.tga       
Line 90: Line 103:
As of now, there is no system to tell you when you make a typo in the new surface type name that goes in the description field. The surface just won't play the proper sounds, etc, it will play the default sounds or none. In the final release, we will hopefully include a quick parser that will go thru the material files for the map and let you know if the new surface types don't match the valid ones.
As of now, there is no system to tell you when you make a typo in the new surface type name that goes in the description field. The surface just won't play the proper sounds, etc, it will play the default sounds or none. In the final release, we will hopefully include a quick parser that will go thru the material files for the map and let you know if the new surface types don't match the valid ones.


= What surfaces do =
= See also =
Surfaces are used to tell what sound to play when you walk on a surface (this code is already in D3, we just have to tell it what sounds to play and how loud those sounds should be to AI). They are also used when a projectile hits a surface, to play a specific sound, give off a specific particle effect, or, in the future, to trigger a specific action (rope arrow only sticks in wood).
* [[Damage Multiplier for Surfaces]]
 
We also plan to play a sound unique to the combination of two surfaces when two objects collide (for example, a ceramic cup hitting a wood floor). We also plan to use surfaces to determine armor factors in combat (an arrow will bounce off the AI's helmet, but if you shoot it right into the eye opening, it will hurt). Some of these are for coding purposes only, like "climbable." This does not mean we have any climbing code done, it's just planning for the future.
 
Also note that soundprop data has not been added for the majority of surfaces, so it's not a bug that AI don't respond to your footsteps on wood or carpet, it just doesn't have the footstep volume modifier data entered for those surfaces yet.


[[Category:Textures]]
{{textures}}
[[Category:Editing]]

Latest revision as of 22:42, 1 April 2016

Originally written by Ishtvan on http://forums.thedarkmod.com/topic/2974

What are Surfaces Types?

Surfaces types are used to tell what sound to play when you walk on a surface (this code is already in D3, we just have to tell it what sounds to play and how loud those sounds should be to AI). They are also used when objects collide or a projectile hits a surface, to play a specific sound, give off a specific particle effect, or to trigger a specific action (rope arrow only sticks in wood; only "climbable" surfaces can be climbed).

They also determine armor factors in combat (an arrow will bounce off the AI's helmet, but if you shoot it right into the eye opening, it will hurt).

Doom 3 had a limited list of only 16 surface types. To support the wildly different surfaces that TDM needs, we expanded that system by using a small trick. This article explains what types you can use, and how.

Old (D3) Surface Types

The following surfaces are standard D3 surfaces. We cannot change the name of these even if we wanted to.

Put one of these in the first line of the .mtr definition:

  • none
  • metal
  • stone
  • flesh
  • wood
  • cardboard
  • liquid
  • glass
  • plastic
  • ricochet
  • surftype10 (??)
  • surftype11 (??)
  • surftype12 (??)
  • surftype13 (??)
  • surftype14 (??)

New (unique to TDM) surface types

Use surftype15' and put surface in description string (this list is not fixed, we can keep adding to it):

  • tile
  • carpet
  • dirt
  • gravel
  • grass
  • rock
  • twigs
  • foliage
  • sand
  • mud
  • brokeglass
  • snow
  • ice
  • squeakboard
  • puddle
  • moss
  • cloth
  • ceramic
  • climbable
  • slate
  • straw
  • armor_leath
  • armor_chain
  • armor_plate
  • undeadbone
  • undeadflesh (like flesh, but less vulnerable to mundane damage)
  • paper
  • hardwood

Instructions on putting in new surfaces

In the material file, put "surftype15 " as the first line. Then, in the "description" line, put the new surface type in quotes. If you want to add anything after that, that's fine, just make sure the surface type is the first thing in the description, and you put a space after it.

NOTE: Old surfaces can be entered the same way as new surfaces, but it decreases performance You could use the surftype15/description method to enter surface types for old D3 textures if you wanted. Entering it the "old" way would lead to slightly faster performance though, since wood is in the enumeration so no string manipulation is required. I don't think this performance impact will be noticable, but you never know.

Examples

Putting in one of the old D3 surface types, wood:

textures/darkmod/mansion/floor/manfloor03
{    
   wood

   qer_editorimage  textures/darkmod/mansion/floor/manfloor03.tga
   diffusemap       textures/darkmod/mansion/floor/manfloor03.tga      
   specularmap      textures/darkmod/mansion/floor/manfloor03_s.tga
}

Putting in a new surface type, tile:

textures/darkmod/mansion/floor/manfloor02cen2
{  
   surftype15 

   description "tile"
 
   qer_editorimage  textures/darkmod/mansion/floor/manfloor02cen2.tga    
   diffusemap       textures/darkmod/mansion/floor/manfloor02cen2.tga  
   specularmap      textures/darkmod/mansion/floor/manfloor02cen2_s.tga
}

Again, note that you could put more in the description line, for example:

   description "tile This is a tile mosaic that might look nice in a mansion entry hall"

This will work because the first word is tile and there's a space after it.

Warning!

As of now, there is no system to tell you when you make a typo in the new surface type name that goes in the description field. The surface just won't play the proper sounds, etc, it will play the default sounds or none. In the final release, we will hopefully include a quick parser that will go thru the material files for the map and let you know if the new surface types don't match the valid ones.

See also