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

    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 2 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 4 replies
    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
×
×
  • Create New...