Jump to content
The Dark Mod Forums

Descriptions in material defs


Serpentine

Recommended Posts

I've been working with materials, and I've run into a bunch of materials with quoted descriptions, as quoted surface types which are not needed as far as I can tell - thus far I've just been converting them, i.e

"flesh" -> flesh

eg:

models/md5/chars/thief/tunic //shadowcasting
{
   qer_editorimage	models/md5/chars/thief/thief_d_ed
   "flesh"
   noselfshadow

diffusemap models/md5/chars/thief/thief_d
specularmap    models/md5/chars/thief/thief_s

"description" "herpa derp" -> description "herpa derp"

eg:

fogs/real_fog
{
noShadows
blendLight
"description"	"A blend light instead of a foglight. Works best when covering the entire map and bound to the player, but can also look better (no artefacts) than real foglights. Does not fog any postprocess surface, like water or sky. These need to be colored sep. to match the fog color, either by using custom materials on them, or by putting a patch over them with textures/darkmod/fogs/real_fog_layer_moving on it."

{
	blend add
	map      textures/fog/realfog
	zeroclamp   // make sure it doesn't bleed over the edges
}
}

 

Is there not perhaps a reason they were used? I know that TDM specific surface types need to be quoted. I see that DR shows both "description" and description - however I think it's easier to just use the intended, unquoted form.

 

On the up side : If I can get my solver to better respect tables, I should also be able to clean all of our materials and simplify a bunch of redundant/inefficient stuff, a few more human touches (like removing terrible id style literals, "-.3" :argh:). At a later date we can most likely use it to remove workarounds from ambient/tdm specific stuff once tech4 is out, with a bit more control than the id internal stuff.

Link to comment
Share on other sites

Please do not remove the quotes. Reasons:

 

* We use them for consistency (and consistency is good), if you remove them, we have suddenly two styles in the files.

* Also, it is totally unclear why and whether D3 parses this correctly, it might be a side-effect of the parser for how much we know.

* Editors know how to color "foo" (it is a string to them), but not foo (it could be anything from a keyword to some unknown text).

* And last but not least, I am not sure my own parser for these files understands them without quotes. In any cases, the quotes make things much more machine-readable.

 

So, in short, please leave the quotes alone. It is not worth changing the files, it doesn't save space, and it hurts real world usage cases (the editing with color alone is worth to not change them).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Errr, the reason that I want to change these is that they are not in keeping with the style and syntax, neither will do their intended task. Doom3 just silently ignores anything it doesn't understand in a material.

 

They are fixes, rather than changes for the sake of changing — don't worry Tels ;)

 

This also allows me to better fix incorrect ordering resulting in material types being ignored - which is why I'm on this little mission(tho there's an easier way to do it, this is at least semi fun).

Link to comment
Share on other sites

Errr, the reason that I want to change these is that they are not in keeping with the style and syntax, neither will do their intended task. Doom3 just silently ignores anything it doesn't understand in a material.

 

They are fixes, rather than changes for the sake of changing — don't worry Tels ;)

 

This also allows me to better fix incorrect ordering resulting in material types being ignored - which is why I'm on this little mission(tho there's an easier way to do it, this is at least semi fun).

 

Er, if you mean you change '"flesh"' to 'flesh', well, thats ok. But not '"description" "foo"' to 'description foo' :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

For the sake of completeness:

 

* We use them for consistency (and consistency is good), if you remove them, we have suddenly two styles in the files.

From my sample of non-test materials:

\bdescription\s+"[^"]+" = 872 
"description"\s+"[^"]+" = 4

So no — "description" "text" — is inconsistent.

 

* Editors know how to color "foo" (it is a string to them), but not foo (it could be anything from a keyword to some unknown text).

DR can use either, d3edit only uses the correct form of : description "desc"

 

* And last but not least, I am not sure my own parser for these files understands them without quotes. In any cases, the quotes make things much more machine-readable.

I'm pretty sure it then also works with the other TDM files which use the correct form. I also think you're actually thinking about the correct form, since a parser would want a keyword not a quoted string :)

 

But not '"description" "foo"' to 'description foo' :)

nope, as I said : "description" "derp" -> description "derp"

 

100% sure changing it will do nothing in this case, and we're then back to the doom3/tdm guideline syntax for this issue at least. The 'accepted' language for materials is a very bad thing to go on, you can really do whatever you want in them — so long as the tokenizer runs over them — the result of anything that isn't valid is just silently ignored. As such it's a bad thing to trust.

 

Sooooo

 

I'll let you make the changes then? (they're the top 4 defs in tdm_fogs.mtr) :)

Link to comment
Share on other sites

No, just you do them, I have already way too much to do :)

 

And yes, I meant the version that is currently used in the majority of files (probaby confusing with the def files). And I agree, the "parser" in D3 is bad, as it just is the tokenizer and that accepts anything as "valid". One of these days...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
×
×
  • Create New...